From 288e30491ed1a11ff988682aeaf9fcb140fa9e3c Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Sun, 7 Jun 2020 22:33:18 -0400 Subject: [PATCH] Load the build report as local file when the report_file is specified. --- Jenkinsfile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bf9a214..3b9b439 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,11 +9,18 @@ def agent_root_folder = '/var/lib/jenkins/.m2' //locate the build file -String reportURL = "https://code-repo.d4science.org/gCubeCI/gCubeReleaseConfigs/raw/branch/master/closed/${gCube_release_version}/build_commits.${report_number}.csv" -println "Querying ${reportURL}" +def text +if (params.report_file) { + println "Using local report at ${params.report_file}" + text = new File(params.report_file).text -//load and parse the release file -def text = reportURL.toURL().getText() +} else { + String reportURL = "https://code-repo.d4science.org/gCubeCI/gCubeReleaseConfigs/raw/branch/master/closed/${gCube_release_version}/build_commits.${report_number}.csv" + println "Pulling the report from Git at ${reportURL}" + //load the report file + text = reportURL.toURL().getText() +} +// parse the report and extract the data def components = parseBuildCommits(text) assert 0 < components.size(): "No component found in build_commits.${report_number}.csv" for (component in components) { @@ -45,6 +52,10 @@ pipeline { defaultValue: '', description: 'The report number to use for tagging.') + string(name: 'report_file', + defaultValue: '', + description: 'The local file path of the build report. Leave blank to pull the build report from Git.') + booleanParam(name: 'use_report_commits', defaultValue: true, description: 'Use the commits on the report or the latest is on master?')