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