error in empty project ? why ?
This commit is contained in:
parent
52b5e51c72
commit
2756d0042e
|
|
@ -12,18 +12,22 @@ def git_take(projects, git_remote) {
|
|||
projects.each { project ->
|
||||
if (fileExists(project)) {
|
||||
dir(project) {
|
||||
sh '''
|
||||
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
|
||||
'''
|
||||
sh """
|
||||
git clone https://${GIT_USER}:${GIT_PASS}@git.arti24.eu/gitea/${project}.git || exit 1
|
||||
"""
|
||||
if (!fileExists(project)) {
|
||||
error("Nie udało się pobrać lub utworzyć katalogu projektu ${project}")
|
||||
}
|
||||
|
||||
}
|
||||
dir(project) {
|
||||
sh "git --no-pager log -n 1 --pretty=format:'%h %ad %s' --date=short"
|
||||
|
|
|
|||
Loading…
Reference in New Issue