From 78e3b57ff1d0eb463256be04bd50017cce5f6939 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Wed, 26 Nov 2025 19:52:51 +0100 Subject: [PATCH] add step to push to gitea --- Jenkinsfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c1b112b..edd5a29 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,16 +104,17 @@ pipeline { stage('Mirror to Gitea') { steps { - sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) { + withCredentials([usernamePassword( + credentialsId: 'Jenkins-gitea', + usernameVariable: 'GITEA_USER', + passwordVariable: 'GITEA_TOKEN')]) { script { // Checkout from GitLab (already done implicitly) - sh """ - git config user.name "Jenkins Server" - git config user.email jenkins@confdroid.com - git checkout master - git remote add gitea https://gitea.confdroid.com/confdroid/puppet_cd.git - git push --mirror gitea - """ + sh ''' + git remote remove gitea || true + git remote add gitea https://${GITEA_USER}:${GITEA_TOKEN}@gitea.confdroid.com/confdroid/puppet_cd.git + git push --mirror gitea + ''' } } }