diff --git a/Jenkinsfile.x b/Jenkinsfile.x index 8f3ddf12d9..1d3f2507b8 100644 --- a/Jenkinsfile.x +++ b/Jenkinsfile.x @@ -16,13 +16,13 @@ node ('hyp-x') { // trigger build on x86_64 node env.PROJECT_DIR = "gopath/src/github.com/hyperledger" env.GOPATH = "$WORKSPACE/gopath" env.PATH = "$GOPATH/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:${nodeHome}/bin:$PATH" - def REFSPEC = sh(returnStdout: true, script: 'echo ${JOB_NAME} | grep "verify"').trim() + def jobname = sh(returnStdout: true, script: 'echo ${JOB_NAME} | grep "verify" && echo patchset || echo merge').trim() def failure_stage = "none" // delete working directory deleteDir() - stage("Fetch Patchset") { // fetch gerrit refspec on latest commit + stage("Fetch Patchset") { try { - if (REFSPEC != null) { + if (jobname == "patchset") { println "$GERRIT_REFSPEC" println "$GERRIT_BRANCH" checkout([ diff --git a/Jenkinsfile.z b/Jenkinsfile.z index 768d1c4dd4..846ef19f61 100644 --- a/Jenkinsfile.z +++ b/Jenkinsfile.z @@ -18,14 +18,14 @@ node('hyp-z') { env.PROJECT_DIR = "gopath/src/github.com/hyperledger" env.GOPATH = "$WORKSPACE/gopath" env.PATH = "$GOPATH/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:~/npm/bin:/home/jenkins/.nvm/versions/node/v${NODE_VER}/bin:$PATH" - def REFSPEC = sh(returnStdout: true, script: 'echo ${JOB_NAME} | grep "verify"').trim() + def jobname = sh(returnStdout: true, script: 'echo ${JOB_NAME} | grep "verify" && echo patchset || echo merge').trim() def failure_stage = "none" // delete working directory deleteDir() stage("Fetch Patchset") { // fetch gerrit refspec on latest commit cleanWs() try { - if (REFSPEC != null) { + if (jobname == "patchset") { println "$GERRIT_REFSPEC" println "$GERRIT_BRANCH" checkout([