Fix Jenkins checkout auth on external agents

This commit is contained in:
2026-03-15 02:01:01 +01:00
parent 08b4247850
commit 5235eb2aa4

3
Jenkinsfile vendored
View File

@@ -14,8 +14,9 @@ pipeline {
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
sshagent(credentials: ['gitea-ssh']) { withCredentials([sshUserPrivateKey(credentialsId: 'gitea-ssh', keyFileVariable: 'GIT_KEYFILE')]) {
sh ''' sh '''
export GIT_SSH_COMMAND="ssh -i $GIT_KEYFILE -o StrictHostKeyChecking=accept-new"
if [ -d .git ]; then if [ -d .git ]; then
git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
git fetch --tags --force --progress origin git fetch --tags --force --progress origin