Fix Jenkins checkout auth on external agents
This commit is contained in:
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user