SPEC-6370 Mark a build as "NOT_BUILT" if it didnt build anything

This commit is contained in:
Esteban Papp
2021-04-16 13:56:46 -07:00
committed by GitHub
parent 5ef212624f
commit 41981412c5
+6
View File
@@ -469,6 +469,8 @@ try {
return
}
def someBuildHappened = false
// Build and Post-Build Testing Stage
def buildConfigs = [:]
@@ -479,6 +481,7 @@ try {
def envVars = GetBuildEnvVars(platform.value.PIPELINE_ENV ?: EMPTY_JSON, build_job.value.PIPELINE_ENV ?: EMPTY_JSON, pipelineName)
envVars['JOB_NAME'] = "${branchName}_${platform.key}_${build_job.key}" // backwards compatibility, some scripts rely on this
def nodeLabel = envVars['NODE_LABEL']
someBuildHappened = true
buildConfigs["${platform.key} [${build_job.key}]"] = {
node("${nodeLabel}") {
@@ -538,6 +541,9 @@ try {
echo 'All builds successful'
}
if (!someBuildHappened) {
currentBuild.result = 'NOT_BUILT'
}
}
catch(Exception e) {
error "Exception: ${e}"