3
0

add step to push to gitea

This commit is contained in:
Arne Teuke
2025-11-26 19:52:51 +01:00
parent 543334eb32
commit 78e3b57ff1

17
Jenkinsfile vendored
View File

@@ -104,16 +104,17 @@ pipeline {
stage('Mirror to Gitea') { stage('Mirror to Gitea') {
steps { steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) { withCredentials([usernamePassword(
credentialsId: 'Jenkins-gitea',
usernameVariable: 'GITEA_USER',
passwordVariable: 'GITEA_TOKEN')]) {
script { script {
// Checkout from GitLab (already done implicitly) // Checkout from GitLab (already done implicitly)
sh """ sh '''
git config user.name "Jenkins Server" git remote remove gitea || true
git config user.email jenkins@confdroid.com git remote add gitea https://${GITEA_USER}:${GITEA_TOKEN}@gitea.confdroid.com/confdroid/puppet_cd.git
git checkout master git push --mirror gitea
git remote add gitea https://gitea.confdroid.com/confdroid/puppet_cd.git '''
git push --mirror gitea
"""
} }
} }
} }