Parse job report before the pipeline execution.
This commit is contained in:
parent
f2298fff63
commit
517153a3ae
|
@ -70,6 +70,12 @@ if (verbose) {
|
|||
jsonConfig.gCube_release.Components.each { println it.key }
|
||||
}
|
||||
|
||||
def jobs = parseJobs("${agent_root_folder}/build_jobs.${env.BUILD_NUMBER -1}.csv")
|
||||
for (job in jobs) {
|
||||
println "$job"
|
||||
}
|
||||
|
||||
|
||||
pipeline {
|
||||
|
||||
// see https://jenkins.io/doc/book/pipeline/syntax/#agent
|
||||
|
@ -157,7 +163,7 @@ pipeline {
|
|||
stage('build maven-parent') {
|
||||
steps {
|
||||
script {
|
||||
if ( ("${resume}" == 'true') && (wasSuccess('maven-parent')) ) {
|
||||
if ( ("${resume}" == 'true') && (jobs['maven-parent'] == 'SUCCESS') ) {
|
||||
// propagate success
|
||||
sh "echo -e \\\"maven-parent,SUCCESS\\\">> $JOB_REPORT"
|
||||
} else {
|
||||
|
@ -242,14 +248,12 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path) {
|
|||
Check if the job was successfully completed in teh given report.
|
||||
*/
|
||||
@NonCPS
|
||||
boolean wasSuccess(job_name) {
|
||||
boolean ret = false
|
||||
new File("${agent_root_folder}/build_jobs.${env.BUILD_NUMBER -1}.csv").splitEachLine(',') { columns ->
|
||||
if (job_name.equalsIgnoreCase(columns[0]) && columns[1].equalsIgnoreCase('SUCCESS')) {
|
||||
ret = true
|
||||
println "NAME: ${columns[0]} STATUS: ${columns[1]}"
|
||||
return
|
||||
}
|
||||
def parseJobs(job_file) {
|
||||
def jobs = [:]
|
||||
new File(job_file).splitEachLine(',') { columns ->
|
||||
if (columns[0].startsWith('#') || columns[0].startsWith('GroupID'))
|
||||
return
|
||||
jobs["${columns[0]}"] = columns[1]
|
||||
}
|
||||
ret;
|
||||
jobs;
|
||||
}
|
Loading…
Reference in New Issue