Manage the exception of a missing previous job report.
This commit is contained in:
parent
6e93df90e1
commit
f9634a8c8b
|
@ -132,11 +132,15 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
if (resume) {
|
if (resume) {
|
||||||
content = readFile("${previous_report_file}")
|
try {
|
||||||
println "JOB REPORT CONTENT: ${content}"
|
content = readFile("${previous_report_file}")
|
||||||
jobs = parseJobs(content)
|
println "JOB REPORT CONTENT: ${content}"
|
||||||
sh "rm ${AGENT_ROOT_FOLDER}/build_commits.csv || true"
|
jobs = parseJobs(content)
|
||||||
sh "cp ${PREVIOUS_COMMIT_REPORT} ${AGENT_ROOT_FOLDER}/build_commits.csv"
|
sh "rm ${AGENT_ROOT_FOLDER}/build_commits.csv || true"
|
||||||
|
sh "cp ${PREVIOUS_COMMIT_REPORT} ${AGENT_ROOT_FOLDER}/build_commits.csv"
|
||||||
|
} catch (Exception e) {
|
||||||
|
println "Previous job report not available or not parsable"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,15 +284,11 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path, jobs) {
|
||||||
@NonCPS
|
@NonCPS
|
||||||
def parseJobs(content) {
|
def parseJobs(content) {
|
||||||
def jobs = [:]
|
def jobs = [:]
|
||||||
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) {
|
|
||||||
println "Previous job report not available or not parsable"
|
|
||||||
}
|
}
|
||||||
jobs;
|
jobs;
|
||||||
}
|
}
|
Loading…
Reference in New Issue