Load the build report as local file when the report_file is specified.

This commit is contained in:
Manuele Simi 2020-06-07 22:33:18 -04:00
parent 14383ce589
commit 288e30491e
1 changed files with 15 additions and 4 deletions

19
Jenkinsfile vendored
View File

@ -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?')