jobs/buildAll: workaround for administration permissions
getting the result of buildJob needs approval but as we are triggering the job anonymous this is not possible. Thus, this workaround is implemented Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
74ef65ec33
commit
ea82dedaa1
|
|
@ -82,11 +82,15 @@ pipeline {
|
||||||
for (machine in listOfTargets) {
|
for (machine in listOfTargets) {
|
||||||
if(isMachineSane(machine)) {
|
if(isMachineSane(machine)) {
|
||||||
println "BUILDING ${machine}"
|
println "BUILDING ${machine}"
|
||||||
def buildjob = runBuildJob(common, machine, "${params.BUILD_BRANCH}")
|
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||||
if((buildJob.getResult() != 'SUCCESS') && isBuildSuccess) {
|
if(!runBuildJob(common, machine, "${params.BUILD_BRANCH}")) {
|
||||||
|
println "Building ${machine} failed"
|
||||||
|
if(isBuildSuccess) {
|
||||||
isBuildSuccess = false
|
isBuildSuccess = false
|
||||||
firstMachineFailing = machine
|
firstMachineFailing = machine
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} // end isMachineSane
|
} // end isMachineSane
|
||||||
} // end for
|
} // end for
|
||||||
if(!isBuildSuccess) {
|
if(!isBuildSuccess) {
|
||||||
|
|
@ -155,7 +159,7 @@ def runBuildJob(commonHelpers, buildTarget, buildBranch) {
|
||||||
try {
|
try {
|
||||||
buildJob = build(job: "${env.BUILD_IMG_JOB}",
|
buildJob = build(job: "${env.BUILD_IMG_JOB}",
|
||||||
quietPeriod: 0,
|
quietPeriod: 0,
|
||||||
propagate: false,
|
propagate: true,
|
||||||
wait: true,
|
wait: true,
|
||||||
parameters: [string(name: 'TARGET', value: buildTarget),
|
parameters: [string(name: 'TARGET', value: buildTarget),
|
||||||
string(name: 'BUILD_BRANCH', value: buildBranch),
|
string(name: 'BUILD_BRANCH', value: buildBranch),
|
||||||
|
|
@ -174,8 +178,5 @@ def runBuildJob(commonHelpers, buildTarget, buildBranch) {
|
||||||
error("Something went really wrong with ${env.BUILD_IMG_JOB} (TARGET=${buildTarget})")
|
error("Something went really wrong with ${env.BUILD_IMG_JOB} (TARGET=${buildTarget})")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(buildJob.getResult() != 'SUCCESS') {
|
return (buildJob.getResult() != 'SUCCESS')
|
||||||
currentBuild.result = 'FAILURE'
|
|
||||||
}
|
|
||||||
return buildJob
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue