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