From bcff06a388e019476d747c332d157fbd3e10a541 Mon Sep 17 00:00:00 2001 From: "roberto.cirillo" Date: Mon, 10 Oct 2022 14:47:21 +0200 Subject: [PATCH] add RELEASE_URL input parameter --- Jenkinsfile | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2b681ab..6ea6364 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,10 +10,16 @@ def agent_root_folder = '/var/lib/jenkins' -if ("${params.gCube_release_version}"){ -//locate the release file - String releaseURL = "https://code-repo.d4science.org/gCubeCI/gCubeReleases/raw/branch/master/open/gcube-${gCube_release_version}.yaml" - //load the release file +if ("${params.gCube_release_version}" || "${params.RELEASE_URL}"){ + String releaseURL=''; + if ("${params.gCube_release_version}"){ + //locate the release file + releaseURL = "https://code-repo.d4science.org/gCubeCI/gCubeReleases/raw/branch/master/open/gcube-${gCube_release_version}.yaml" + }else{ + releaseURL = "${params.RELEASE_URL}" + } + +//load the release file def text = releaseURL.toURL().getText() //parsing def jsonConfig = new Yaml().load(text) @@ -30,10 +36,6 @@ if ("${params.gCube_release_version}"){ def deployList def backupList -if (params.deployFile) { - println "Using custom deploy file" - deployList = params.deployFile -} pipeline { agent { @@ -73,7 +75,8 @@ pipeline { DEPLOY_CATEGORY="${env.DEPLOY_CATEGORY}" //Job name of the release pipeline RELEASE_JOB='gCubeBuilder' - + //URL to the YAML file. Used alternatively to RELEASE_JOB + RELEASE_URL= "${params.RELEASE_URL}" } parameters { @@ -95,10 +98,13 @@ pipeline { string(name: 'report_number', defaultValue: '', description: 'The build report number on Git to pull the notes. Leave blank if executed outside gCube release.') - - string(name: 'report', + string(name: 'RELEASE_URL', defaultValue: '', - description: 'The build report. Leave blank to pull the build report from Git. Leave blank if executed outside gCube release.') + description: 'URL to the yaml file. Leave blank if executed outside gCube release.') + +// string(name: 'report', +// defaultValue: '', +// description: 'The build report. Leave blank to pull the build report from Git. Leave blank if executed outside gCube release.') }