OP#793 fix mirror
This commit is contained in:
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@@ -20,6 +20,23 @@ pipeline {
|
|||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
|
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') {
|
stage('SonarScan') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
||||||
@@ -93,7 +110,7 @@ pipeline {
|
|||||||
git rm -f Jenkinsfile
|
git rm -f Jenkinsfile
|
||||||
git rm -r --cached .vscode || echo "No .vscode to remove from git"
|
git rm -r --cached .vscode || echo "No .vscode to remove from git"
|
||||||
git commit --amend --no-edit --allow-empty
|
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" \
|
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
|
||||||
push master --mirror
|
push master --mirror
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user