optimize method deployRelease

This commit is contained in:
Roberto Cirillo 2022-10-13 10:40:28 +02:00
parent eb7bf27c81
commit b0c0011a63
1 changed files with 15 additions and 11 deletions

26
Jenkinsfile vendored
View File

@ -393,18 +393,22 @@ def deployRelease(def categoryList, def json){
String smartgears
def categories=categoryList.split(',')
json.gCube_release.Components.each { group_name, component_list ->
for ( def category : categories){
println ("processing category: "+category)
if("${group_name}" == "$category"){
if (category == 'Distribution'){
//searching smartgears-distribution version in Distribution component of defined inside the yaml file
def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }}
smartgears=(sg !=null ) ? sg[0] : null
println("smartgears version is ${smartgears}")
return
if (categories.contains(group_name)){
println("found category "+group_name+" it is contained in categories to search: "+categories);
for ( def category : categories){
println ("processing category: "+category)
if("${group_name}" == "$category"){
if (category == 'Distribution'){
//searching smartgears-distribution version in Distribution component of defined inside the yaml file
def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }}
smartgears=(sg !=null ) ? sg[0] : null
println("smartgears version is ${smartgears}")
return
}
releaseList += component_list?.collect {return "$it.name,$it.version" }
println("found ${releaseList}");
}
releaseList += component_list?.collect {return "$it.name,$it.version" }
println("found ${releaseList}");
}
}
}