From 1bb3efa63810fc609351c16d79d2ebab7e134461 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Sun, 27 Sep 2026 14:06:12 +0200 Subject: [PATCH] OP#793 fix mirror --- Jenkinsfile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9e8c23c..0d99053 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,24 @@ pipeline { stages { - stage('SonarScan') { + stage('pull master') { + steps { + sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) { + sh ''' + git config user.name "Jenkins Server" + git config user.email jenkins@confdroid.com + # Ensure we're on the development branch (triggered by push) + git checkout development + # Create jenkins branch from development + git checkout -b jenkins-build-$BUILD_NUMBER + # Optionally merge master into jenkins to ensure compatibility + git merge origin/master --no-ff || { echo "Merge conflict detected"; exit 1; } + ''' + } + } + } + + stage('SonarScan') { steps { withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) { sh ''' @@ -93,7 +110,7 @@ pipeline { git rm -f Jenkinsfile git rm -r --cached .vscode || echo "No .vscode to remove from git" git commit --amend --no-edit --allow-empty - git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_nagios.git + git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_minio.git git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ push master --mirror '''