Calculate previous job number.
This commit is contained in:
parent
517153a3ae
commit
68826de759
|
@ -70,12 +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")
|
||||
def report_number = env.BUILD_NUMBER -1
|
||||
def jobs = parseJobs("${agent_root_folder}/build_jobs.${report_number}.csv")
|
||||
for (job in jobs) {
|
||||
println "$job"
|
||||
}
|
||||
|
||||
|
||||
pipeline {
|
||||
|
||||
// see https://jenkins.io/doc/book/pipeline/syntax/#agent
|
||||
|
@ -250,10 +250,12 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path) {
|
|||
@NonCPS
|
||||
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]
|
||||
}
|
||||
try {
|
||||
new File(job_file).splitEachLine(',') { columns ->
|
||||
if (columns[0].startsWith('#') || columns[0].startsWith('GroupID'))
|
||||
return
|
||||
jobs["${columns[0]}"] = columns[1]
|
||||
}
|
||||
} catch() {println "Previous job report not available"}
|
||||
jobs;
|
||||
}
|
Loading…
Reference in New Issue