From 31c46b8fbd837df1d394a05bd6965eadb9d6c2e3 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Wed, 11 Dec 2019 22:47:01 -0500 Subject: [PATCH] Use readfile to read the job report. --- Jenkinsfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a9d7796..75ecb3e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,10 +74,6 @@ def jobs = [:] if (resume_from) { def previous_report_file = "${agent_root_folder}/build_jobs.${resume_from}.csv" echo "Previous report file: ${previous_report_file}" - def lines = new File("${agent_root_folder}/build_jobs.${resume_from}.csv").readLines() - lines.each { String line -> - println line - } jobs = parseJobs(previous_report_file) if (verbose) { for (job in jobs) @@ -163,7 +159,7 @@ pipeline { echo -e "GroupID,ArtifactID,Version,SCM URL,Build Number,Distribution URL,Filename,Packaging" >> ${AGENT_ROOT_FOLDER}/build_commits.csv #job report - cat ${PREVIOUS_JOB_REPORT} || echo "${previous_report_file} not available" + cat ${PREVIOUS_JOB_REPORT} || echo "${PREVIOUS_JOB_REPORT} not available" ls -lrt ${AGENT_ROOT_FOLDER}/ echo "#Build ${PIPELINE_BUILD_NUMBER}" > ${JOB_REPORT} echo "#StartTime ${date}" >> ${JOB_REPORT} @@ -275,7 +271,9 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path, jobs) { def parseJobs(job_file) { def jobs = [:] try { - new File(job_file).splitEachLine(',') { columns -> + def content = readFile file:job_file + println content + content.splitEachLine(',') { columns -> if (columns[0].startsWith('#') || columns[0].startsWith('JobName')) return jobs["${columns[0]}"] = columns[1]