From 0dedd3c9047b121fb5fab82236db201c29b39cb3 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Thu, 20 Jan 2022 00:49:55 -0600 Subject: [PATCH 1/3] Renamed test stage of jenkins pipeline. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7a2c742..91383cb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { sh 'git clean -fd' } } - stage('test') { + stage('startup check') { steps { sh './testrun.sh' logParser failBuildOnError: true, projectRulePath: 'Jenkinsparse', parsingRulesPath: 'Jenkinsparse', showGraphs: true, unstableOnWarning: true, useProjectRule: true From ed23d5190eef9e19a5ffe20194810973ecc4ab61 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Thu, 20 Jan 2022 03:00:47 -0600 Subject: [PATCH 2/3] Renamed startup check stage and restored queue stage. --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 91383cb..58943ef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,12 +8,21 @@ pipeline { sh 'git clean -fd' } } - stage('startup check') { + stage('startup and shutdown check') { steps { sh './testrun.sh' logParser failBuildOnError: true, projectRulePath: 'Jenkinsparse', parsingRulesPath: 'Jenkinsparse', showGraphs: true, unstableOnWarning: true, useProjectRule: true sh 'git reset --hard' } } + stage('queue') { + steps { + checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '359ebf7c-e2b9-45ec-992c-ff8d5549deb6', url: 'git@dev.sys.reslate.xyz:ydeng/rsemcs.git']]]) + sh 'git merge --strategy-option theirs origin/delta' + sshagent(['359ebf7c-e2b9-45ec-992c-ff8d5549deb6']) { + sh 'git push origin master' + } + } + } } } From 04996cc087a12d464e90b80a2352f55a83d22774 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Thu, 20 Jan 2022 03:03:44 -0600 Subject: [PATCH 3/3] Removed setup stage and now only run queue stage on delta branch. --- Jenkinsfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 58943ef..fc67ba1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,6 @@ pipeline { agent any stages { - stage('setup') { - steps { - sh 'git checkout delta' - sh 'git reset --hard origin/delta' - sh 'git clean -fd' - } - } stage('startup and shutdown check') { steps { sh './testrun.sh' @@ -16,6 +9,9 @@ pipeline { } } stage('queue') { + when { + branch '**/delta' + } steps { checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '359ebf7c-e2b9-45ec-992c-ff8d5549deb6', url: 'git@dev.sys.reslate.xyz:ydeng/rsemcs.git']]]) sh 'git merge --strategy-option theirs origin/delta'