diff --git a/Jenkinsfile b/Jenkinsfile index f50ec6e..f2fe140 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,16 +71,17 @@ if (verbose) { } def jobs = [:] -def previous_report_file = '' -if (resume_from) { - previous_report_file = "${agent_root_folder}/build_jobs.${resume_from}.csv" +def previous_report_content = '' +def previous_report_file = "${agent_root_folder}/build_jobs.${resume_from}.csv" + +/*if (resume_from) { echo "Previous report file: ${previous_report_file}" jobs = parseJobs(previous_report_file) if (verbose) { for (job in jobs) println job } -} +}*/ pipeline { @@ -134,6 +135,15 @@ pipeline { //see https://jenkins.io/doc/book/pipeline/syntax/#stages stages { + stage('resume') { + steps { + sh 'cat ${PREVIOUS_JOB_REPORT}' + content = readFile ${PREVIOUS_JOB_REPORT} + jobs = parseJobs(content) + for (job in jobs) + println job + } + } stage('initialize') { steps { sh ''' @@ -269,10 +279,9 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path, jobs) { Loads the jobs from the given report. */ @NonCPS -def parseJobs(job_file) { +def parseJobs(content) { def jobs = [:] //try { - def content = readFile file:job_file println content content.splitEachLine(',') { columns -> if (columns[0].startsWith('#') || columns[0].startsWith('JobName'))