Compare commits

..

3 Commits

Author SHA1 Message Date
Jenkins Server
b0083a6b43 Merge build 40 into master 2026-06-13 14:57:44 +02:00
Jenkins Server
48dd60ca4a Merge remote-tracking branch 'origin/master' into jenkins-build-40 2026-06-13 14:56:41 +02:00
b0f21964c5 OP#618 add ssh-agent to last stage 2026-06-13 14:56:23 +02:00

32
Jenkinsfile vendored
View File

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