branchName = scm.branches[0].name // for non-multibranch pipelines
env.BRANCH_NAME = branchName // so scripts that read this environment have it (e.g. incremental_build_util.py)
choice(defaultValue: DEFAULT_BUILD_SNAPSHOT, name: 'SNAPSHOT', choices: BUILD_SNAPSHOTS, description: 'Selects the build snapshot to use. A more diverted snapshot will cause longer build times, but will not cause build failures.')
}
if(env.CHANGE_TARGET) {
// PR builds
if(BUILD_SNAPSHOTS.contains(env.CHANGE_TARGET)) {
snapshot = env.CHANGE_TARGET
echo "Snapshot for destination branch \"${env.CHANGE_TARGET}\" found."
@ -470,6 +470,8 @@ try {
echo "Snapshot for destination branch \"${env.CHANGE_TARGET}\" does not exist, defaulting to snapshot \"${snapshot}\""
}
} else {
// Non-PR builds
choice(defaultValue: DEFAULT_BUILD_SNAPSHOT, name: 'SNAPSHOT', choices: BUILD_SNAPSHOTS, description: 'Selects the build snapshot to use. A more diverted snapshot will cause longer build times, but will not cause build failures.')