diff --git a/Jenkinsfile b/Jenkinsfile index 4959f6b..681bb75 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,21 +107,23 @@ pipeline { } stage('Mirror to Gitea') { steps { - withCredentials([usernamePassword( - credentialsId: 'Jenkins-gitea', - usernameVariable: 'GITEA_USER', - passwordVariable: 'GITEA_TOKEN')]) { - script { - sh ''' - git fetch origin - git checkout master - git reset --hard origin/master - git remote get-url master >/dev/null 2>&1 \ - && git remote set-url master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git \ - || git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git - git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ - push --force master refs/heads/master:refs/heads/master - ''' + sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) { + withCredentials([usernamePassword( + credentialsId: 'Jenkins-gitea', + usernameVariable: 'GITEA_USER', + passwordVariable: 'GITEA_TOKEN')]) { + script { + sh ''' + git fetch origin + git checkout master + git reset --hard origin/master + git remote get-url master >/dev/null 2>&1 \ + && git remote set-url master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git \ + || git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git + git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ + push --force master refs/heads/master:refs/heads/master + ''' + } } } }