From 08b42478503f42a48f22efb547d10766e8e2a3cc Mon Sep 17 00:00:00 2001 From: Mandel Olaiya Date: Sun, 15 Mar 2026 01:36:10 +0100 Subject: [PATCH] Use Jenkins gitea-ssh credential for agent checkout --- Jenkinsfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7ebb9a..08e1c7a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,15 +14,17 @@ pipeline { stages { stage('Checkout') { steps { - sh ''' - if [ -d .git ]; then - git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git - git fetch --tags --force --progress origin - else - git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git . - fi - git checkout -f origin/master - ''' + sshagent(credentials: ['gitea-ssh']) { + sh ''' + if [ -d .git ]; then + git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + git fetch --tags --force --progress origin + else + git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git . + fi + git checkout -f origin/master + ''' + } } } stage('Build') {