Resume a build olny if resume option is set.

This commit is contained in:
Manuele Simi 2019-12-12 09:02:37 -05:00
parent fbec8bc5db
commit 9a21b62ed7
1 changed files with 10 additions and 11 deletions

21
Jenkinsfile vendored
View File

@ -125,15 +125,14 @@ pipeline {
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
stages {
stage('resume') {
stage('resume previous build?') {
steps {
script {
content = readFile("${previous_report_file}")
println "JOB REPORT CONTENT: ${content}"
jobs = parseJobs(content)
for (job in jobs)
println job
if (resume) {
content = readFile("${previous_report_file}")
println "JOB REPORT CONTENT: ${content}"
jobs = parseJobs(content)
}
}
}
}
@ -272,15 +271,15 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path, jobs) {
@NonCPS
def parseJobs(content) {
def jobs = [:]
//try {
try {
for (String line : content.split('\n')) {
if (!line.startsWith('#') && !line.startsWith('JobName')) {
def columns = line.split(',')
jobs["${columns[0]}"] = columns[1]
}
}
//} catch(Exception e) {
// println "Previous job report not available"
//}
} catch(Exception e) {
println "Previous job report not available or not parsable"
}
jobs;
}