generated from gCubeCI/Pipeline-Docker-Template
check json slurper method
This commit is contained in:
parent
203967e625
commit
77cf75579c
|
@ -367,11 +367,13 @@ 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' ] }
|
||||||
// def jsonContent= "{\"generic_portlets\":"+portlets+"}"
|
def jsonContent= "{\"generic_portlets\":"+portlets+"}"
|
||||||
// echo "json: $jsonContent"
|
def parser = new JsonSlurper()
|
||||||
echo " json: $portlets"
|
def json = parser.parseText(jsonContent)
|
||||||
|
echo "json: $json"
|
||||||
|
// echo " json: $portlets"
|
||||||
// portlets += "}"
|
// portlets += "}"
|
||||||
writeJSON file: 'portlets.json', json: portlets
|
writeJSON file: 'portlets.json', json: json
|
||||||
// def read = readJSON file: 'portlets.json'
|
// def read = readJSON file: 'portlets.json'
|
||||||
// println("Portlets found: "+read.name+" "+read.version+ " "+read.extension)
|
// println("Portlets found: "+read.name+" "+read.version+ " "+read.extension)
|
||||||
def output = sh(returnStdout: true, returnStdoutTrim: true, script: "mv portlets.json $ANSIBLE_ROOT_FOLDER")
|
def output = sh(returnStdout: true, returnStdoutTrim: true, script: "mv portlets.json $ANSIBLE_ROOT_FOLDER")
|
||||||
|
|
Loading…
Reference in New Issue