moving jsonConfig decalration outside the if

This commit is contained in:
Roberto Cirillo 2022-10-10 17:18:24 +02:00
parent 74df921160
commit 9c6e18204f
1 changed files with 4 additions and 2 deletions

6
Jenkinsfile vendored
View File

@ -11,6 +11,8 @@ import org.yaml.snakeyaml.Yaml
def agent_root_folder = '/var/lib/jenkins'
def verbose = true
def jsonConfig
def text
if ("${params.gCube_release_version}" || "${params.RELEASE_URL}"){
String releaseURL='';
if ("${params.gCube_release_version}"){
@ -21,9 +23,9 @@ if ("${params.gCube_release_version}" || "${params.RELEASE_URL}"){
}
//load the release file
def text = releaseURL.toURL().getText()
text = releaseURL.toURL().getText()
//parsing
def jsonConfig = new Yaml().load(text)
jsonConfig = new Yaml().load(text)
if (verbose)
println jsonConfig.inspect()
echo "Building gCube v. ${jsonConfig.gCube_release.Version}"