fix collection

This commit is contained in:
Roberto Cirillo 2023-06-16 09:39:37 +02:00
parent 30f75a203e
commit 0ec2f9b56d
1 changed files with 3 additions and 2 deletions

5
Jenkinsfile vendored
View File

@ -368,8 +368,9 @@ def deployRelease(def categoryList, def yaml){
}else if (category =="${PORTLET_CATEGORY}"){ }else if (category =="${PORTLET_CATEGORY}"){
//def portlets="{\"generic_portlets\": "; //def portlets="{\"generic_portlets\": ";
// portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } // portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] }
portlets += component_list?.collect{ return " {\"group_id\": \"$it.group_id\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "} // portlets += component_list?.collect{ return " {\"group_id\": \"$it.group_id\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "}
portlets.removeAll(["\"group_id\": \"null\""]); portlets += component_list?.collect{ if ($it.group_id != null) return "{\"group_id\": \"$it.group_id\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "; else return "{\"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"}"}
// portlets.removeAll(["\"group_id\": \"null\""]);
echo "portlets: $portlets" echo "portlets: $portlets"
def jsonContent= "{\"generic_portlets\": "+portlets+"}" def jsonContent= "{\"generic_portlets\": "+portlets+"}"
echo "json: $jsonContent" echo "json: $jsonContent"