diff --git a/jenkins/Jenkinsfile-blossom.premerge b/jenkins/Jenkinsfile-blossom.premerge index 392e5717142..8d287192c5d 100644 --- a/jenkins/Jenkinsfile-blossom.premerge +++ b/jenkins/Jenkinsfile-blossom.premerge @@ -165,22 +165,23 @@ pipeline { steps { script { - // Retrieve PROJECT_VER from version-def.sh, e.g, '..-SNAPSHOT' - PROJECT_VER = sh(returnStdout: true, script: "bash $JENKINS_ROOT/version-def.sh | cut -d ',' -f 3 | cut -d ' ' -f 3") - PROJECT_VER = PROJECT_VER.split('-')[0] // Remove trailing '-SNAPSHOT' - echo PROJECT_VER - - def versions = PROJECT_VER.split('\\.') - major_ver = versions[0].toInteger() - minor_ver = versions[1].toInteger() + container('cpu') { + // Retrieve PROJECT_VER from version-def.sh, e.g, '..-SNAPSHOT' + PROJECT_VER = sh(returnStdout: true, + script: '''#!/bin/bash + source jenkins/version-def.sh >& /dev/null + echo $PROJECT_VER + ''').trim() + PROJECT_VER = PROJECT_VER.split('-')[0] // Remove trailing '-SNAPSHOT' + echo PROJECT_VER + + def versions = PROJECT_VER.split('\\.') + major_ver = versions[0].toInteger() + minor_ver = versions[1].toInteger() - if (major_ver >= 22) { PREMERGE_CI_2_ARGUMENT = "ci_2" - } else { - error("Unsupported major version: $major_ver") + echo PREMERGE_CI_2_ARGUMENT } - - echo PREMERGE_CI_2_ARGUMENT } } }