withCredentials([usernamePassword(credentialsId: 'gitea-creds',
usernameVariable: 'GIT_USER', passwordVariable: 'GIT_PASS')]) {
projects.each { project ->
if (fileExists(project)) {
dir(project) {
sh '''
echo "=== Updating ${project} ==="
git remote set-url origin
https://${GIT_USER}:${GIT_PASS}@git.arti24.eu/gitea/${project}.git
git fetch origin
git reset --hard origin/main
'''
}
} else {
sh '''
echo "=== Cloning ${project} ==="
git clone
https://${GIT_USER}:${GIT_PASS}@git.arti24.eu/gitea/${project}.git
'''
}
dir(project) {
sh "git --no-pager log -n 1 --pretty=format:'%h %ad %s'
--date=short"
}
}
}
}
|
||
|---|---|---|
| .. | ||
| lets-encrypt | ||
| create-nginx-with-tools.jenkinsfile | ||
| deploy-dc.yml | ||
| nginx-with-tools-docker.dockerfile | ||
| restart-docker.jenkinsfile | ||
| start-proxy.jenkinsfile | ||
| update-from-git.jenkinsfile | ||