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"
}
}
}
}
|
||
|---|---|---|
| deploy-this | ||
| gitblit | ||
| gitea | ||
| jenkins | ||
| mailu | ||
| nginx-config | ||
| .project | ||