try to remove brackets

This commit is contained in:
Roberto Cirillo 2023-06-15 15:58:52 +02:00
parent d55c3c728f
commit 1a63a95de4
1 changed files with 5 additions and 7 deletions

12
Jenkinsfile vendored
View File

@ -367,14 +367,12 @@ def deployRelease(def categoryList, def yaml){
smartgears=(sg !=null ) ? sg[0] : ''
}else if (category =="${PORTLET_CATEGORY}"){
//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 " name: $it.name, version: $it.version, extension: war " }
echo "portlets: $portlets"
def jsonContent= "{\"generic_portlets\":"+portlets+"}"
def parser = new JsonSlurper()
def json = parser.parseText(jsonContent)
echo "json: $json"
// echo " json: $portlets"
// portlets += "}"
writeJSON file: 'portlets.json', json: json
echo "json: $jsonContent"
writeJSON file: 'portlets.json', json: jsonContent
// def read = readJSON file: 'portlets.json'
// println("Portlets found: "+read.name+" "+read.version+ " "+read.extension)
def output = sh(returnStdout: true, returnStdoutTrim: true, script: "mv portlets.json $ANSIBLE_ROOT_FOLDER")