From b86849b1e425a3c0040c61787b7777d2c6d53bf0 Mon Sep 17 00:00:00 2001 From: Mandel Olaiya Date: Fri, 10 Apr 2026 18:39:59 +0200 Subject: [PATCH] Harden Jenkins checkout bootstrap --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 433c3ae..a404560 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,11 @@ pipeline { sh ''' export GIT_SSH_COMMAND="ssh -i $GIT_KEYFILE -o StrictHostKeyChecking=accept-new" if [ -d .git ]; then - git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + if git remote get-url origin >/dev/null 2>&1; then + git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + else + git remote add origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + fi git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master else git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .