From 2756d0042eda12a2c2f069f9254a2e788606fd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ku=C5=9B?= Date: Thu, 4 Sep 2025 11:54:21 +0200 Subject: [PATCH] error in empty project ? why ? --- deploy-this/update-from-git.jenkinsfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/deploy-this/update-from-git.jenkinsfile b/deploy-this/update-from-git.jenkinsfile index 45a6d7a..1338134 100755 --- a/deploy-this/update-from-git.jenkinsfile +++ b/deploy-this/update-from-git.jenkinsfile @@ -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"