From 195ad81f6579366b06700f90778d7d340c0ea232 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 14 Jun 2023 10:51:01 +0200 Subject: [PATCH 01/31] add condition on Portlet category related to Release deployment --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 688bca2..a773c63 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -82,6 +82,8 @@ pipeline { RELEASE_MANAGER_USER='roberto.cirillo' // name of Smartgears distribution group, defined in the yaml file ( only for release deployments) DISTRIBUTION_CATEGORY='Distribution' + // name of Portlets group, defined in the yaml file ( only for release deployments) + PORTLET_CATEGORY='Portlets' } parameters { @@ -375,6 +377,11 @@ def deployRelease(def categoryList, def yaml){ //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] : '' + }else if (category =="${PORTLET_CATEGORY}"){ + def portlets=component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': war ] } + writeJSON file: 'portlets.json', json: portlets + def read = readJSON file: 'portlets.json' + println("Portlets found: "+read.name+" "+read.version+ " "+read.extension) }else{ releaseList += component_list?.collect {return "$it.name,$it.version" } } From 7f786fbbe7670a84a2d799fe575b99915e013bf9 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 14 Jun 2023 14:59:34 +0200 Subject: [PATCH 02/31] add check on release components --- Jenkinsfile | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a773c63..c2e6feb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -349,24 +349,33 @@ def deployJobs(def serviceList){ } //Deploy only release components. All the component are passed as: componentName,componentVersion def deployReleaseJobs(def serviceList, String smartgears){ - println("Going to deploy release components"); - for (def record : serviceList) { - service=record.split(","); - stage(service[0]){ - println("Processing RELEASE deploy: service "+service[ 0 ]+" with version "+service[ 1 ]+" and SG "+smartgears) - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { - checkupRelease(service[0], service[ 1 ]); - if (smartgears) - deployRelease(service[0], service[ 1 ], smartgears); - else - deployRelease(service[0], service[ 1 ], ''); - } - } + if (serviceList){ + println("Going to deploy release components"); + for (def record : serviceList) { + service=record.split(","); + stage(service[0]){ + println("Processing RELEASE deploy: service "+service[ 0 ]+" with version "+service[ 1 ]+" and SG "+smartgears) + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { + checkupRelease(service[0], service[ 1 ]); + if (smartgears) + deployRelease(service[0], service[ 1 ], smartgears); + else + deployRelease(service[0], service[ 1 ], ''); + } + } + } + + + }else{ + println("Release components not found. Skip this stage"); + } + } // collects all the components defined inside one or more yaml categories matching categoryList def deployRelease(def categoryList, def yaml){ def releaseList = [] + def portlets String smartgears def categories=categoryList.split(',') yaml.gCube_release.Components.each { group_name, component_list -> @@ -378,7 +387,7 @@ def deployRelease(def categoryList, def yaml){ def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }} smartgears=(sg !=null ) ? sg[0] : '' }else if (category =="${PORTLET_CATEGORY}"){ - def 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 ] } writeJSON file: 'portlets.json', json: portlets def read = readJSON file: 'portlets.json' println("Portlets found: "+read.name+" "+read.version+ " "+read.extension) From 045849a57bf7cc76854624abf6145db34d4f7417 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 14 Jun 2023 15:17:44 +0200 Subject: [PATCH 03/31] add new colored print --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c2e6feb..3ef95bc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -221,7 +221,7 @@ pipeline { steps { script{ if("${DEPLOY_CATEGORY}"){ - println("Going to deploy the Release components") + echo '\033[31;1;4mGoing to deploy gCube Release \033[0m' deployRelease("${DEPLOY_CATEGORY}", yamlConfig); }else { println ("CATEGORIES NOT FOUND ON YAML FILE. SKIP TO NEXT STAGE");} } From 65d5636324c5f70343f60d0de8b5a3690abba265 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 14 Jun 2023 15:24:58 +0200 Subject: [PATCH 04/31] fix portlet collection method --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ef95bc..6ce2ffd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -387,7 +387,7 @@ def deployRelease(def categoryList, def yaml){ def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }} smartgears=(sg !=null ) ? sg[0] : '' }else if (category =="${PORTLET_CATEGORY}"){ - 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' ] } writeJSON file: 'portlets.json', json: portlets def read = readJSON file: 'portlets.json' println("Portlets found: "+read.name+" "+read.version+ " "+read.extension) From b26d4cde46b9eb7677155936ceb929b80345d8f4 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 14 Jun 2023 15:29:48 +0200 Subject: [PATCH 05/31] fix portlet collection --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6ce2ffd..20f041b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -375,7 +375,7 @@ def deployReleaseJobs(def serviceList, String smartgears){ // collects all the components defined inside one or more yaml categories matching categoryList def deployRelease(def categoryList, def yaml){ def releaseList = [] - def portlets + def portlets = [] String smartgears def categories=categoryList.split(',') yaml.gCube_release.Components.each { group_name, component_list -> From eacc8c2d9706f2c5afc5b8ddc0f2d888d164ba8e Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 14 Jun 2023 17:04:13 +0200 Subject: [PATCH 06/31] move json file in the right location --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 20f041b..c0a6355 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -389,8 +389,10 @@ def deployRelease(def categoryList, def yaml){ }else if (category =="${PORTLET_CATEGORY}"){ portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } writeJSON file: 'portlets.json', json: portlets - def read = readJSON file: 'portlets.json' - println("Portlets found: "+read.name+" "+read.version+ " "+read.extension) +// 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") + echo "Output: '${output}'" }else{ releaseList += component_list?.collect {return "$it.name,$it.version" } } From b0e4dd25bea6fac7554e304b289b10316102641e Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 11:27:17 +0200 Subject: [PATCH 07/31] small changes --- Jenkinsfile | 104 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c0a6355..17e1566 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -270,16 +270,9 @@ pipeline { } } -//launch ansible deploy -def deploy(String service, String version, String host){ - def now = new Date(); - println("Going to deploy the service "+service+" with version: "+version+" on target: "+host); - def statusCode = sh( script: "cd $ANSIBLE_ROOT_FOLDER;./deployService.sh $service $version $host;", returnStdout: true); - sh(""" - echo " last exit code \$?"; - """) - println("Deploy ended with status: "+statusCode); -} + +/* CHECKUP METHODS */ + //Implement a new method in order to check the input parameters def checkup(String service, String version, String host){ @@ -292,16 +285,6 @@ def checkup(String service, String version, String host){ """) } -//launch ansible deploy -def deployRelease(String service, String version, String smartgears){ - def now = new Date(); - println("Going to deploy the service "+service+" with version: "+version+" on preproduction "); - def statusCode = sh( script: "cd $ANSIBLE_ROOT_FOLDER;git pull;./deployPreprodService.sh $service $version $smartgears ;", returnStdout: true); - sh(""" - echo " last exit code \$?"; - """) - println("Deploy ended with status: "+statusCode); -} //Implement a new method in order to check the input parameters def checkupRelease(String service, String version){ @@ -313,6 +296,10 @@ def checkupRelease(String service, String version){ esac """) } + + +/* DEPLOY METHODS*/ + //parse all csv files found in the local folder and deploy the components defined inside def parseDeployPendingJobs( def deployFolder){ println ("searching files in folder ${deployFolder}"); @@ -347,32 +334,23 @@ def deployJobs(def serviceList){ } } -//Deploy only release components. All the component are passed as: componentName,componentVersion -def deployReleaseJobs(def serviceList, String smartgears){ - if (serviceList){ - println("Going to deploy release components"); - for (def record : serviceList) { - service=record.split(","); - stage(service[0]){ - println("Processing RELEASE deploy: service "+service[ 0 ]+" with version "+service[ 1 ]+" and SG "+smartgears) - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { - checkupRelease(service[0], service[ 1 ]); - if (smartgears) - deployRelease(service[0], service[ 1 ], smartgears); - else - deployRelease(service[0], service[ 1 ], ''); - } - } - } - - - }else{ - println("Release components not found. Skip this stage"); - - } +//Run ansible deploy +def deploy(String service, String version, String host){ + def now = new Date(); + println("Going to deploy the service "+service+" with version: "+version+" on target: "+host); + def statusCode = sh( script: "cd $ANSIBLE_ROOT_FOLDER;./deployService.sh $service $version $host;", returnStdout: true); + sh(""" + echo " last exit code \$?"; + """) + println("Deploy ended with status: "+statusCode); } -// collects all the components defined inside one or more yaml categories matching categoryList + + +/* DEPLOY RELEASE METHODS*/ + + +// collects all the components defined inside one or more yaml categories matching categoryList and invoke the deploy def deployRelease(def categoryList, def yaml){ def releaseList = [] def portlets = [] @@ -403,3 +381,41 @@ def deployRelease(def categoryList, def yaml){ } deployReleaseJobs(releaseList, smartgears); } + +//Deploy only release components, starting from a servicelist. All the component are passed as: componentName,componentVersion +def deployReleaseJobs(def serviceList, String smartgears){ + if (serviceList){ + println("Going to deploy release components"); + for (def record : serviceList) { + service=record.split(","); + stage(service[0]){ + println("Processing RELEASE deploy: service "+service[ 0 ]+" with version "+service[ 1 ]+" and SG "+smartgears) + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { + checkupRelease(service[0], service[ 1 ]); + if (smartgears) + deployReleaseJob(service[0], service[ 1 ], smartgears); + else + deployReleaseJob(service[0], service[ 1 ], ''); + } + } + } + + + }else{ + println("Release components not found. Skip this stage"); + + } + +} + + +//Run ansible deploy related to a single service +def deployReleaseJob(String service, String version, String smartgears){ + def now = new Date(); + println("Going to deploy the service "+service+" with version: "+version+" on preproduction "); + def statusCode = sh( script: "cd $ANSIBLE_ROOT_FOLDER;git pull;./deployPreprodService.sh $service $version $smartgears ;", returnStdout: true); + sh(""" + echo " last exit code \$?"; + """) + println("Deploy ended with status: "+statusCode); +} From b86ed090b9ae2f658dc47723e710c59bd122c309 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 11:35:11 +0200 Subject: [PATCH 08/31] fix some comments --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 17e1566..a0b79f8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -162,7 +162,7 @@ pipeline { } steps { sh ''' - echo '\033[31;1;4mNew pending deploy added to the queue/033[0m' + echo '\033[31;1;4mNew pending deploy/033[0m' echo "Cron build enabled. Adding ${TRIGGER_JOB} - ${TRIGGER_VERSION} to the queue" touch $DEPLOY_FILE; if grep -q \"\${TRIGGER_JOB}\" \${DEPLOY_FILE}; then @@ -212,10 +212,10 @@ pipeline { anyOf{ triggeredBy 'BuildUpstreamCause' triggeredBy 'UpstreamCause' - //added just for testing . To Remove. + // added just for testing . To Remove. triggeredBy cause: "UserIdCause", detail: "${RELEASE_MANAGER_USER}" } - // we should improve this conditional check + // we should improve this conditional check equals(actual: "${params.TRIGGER_JOB}", expected: "${RELEASE_JOB}") } steps { @@ -223,7 +223,7 @@ pipeline { if("${DEPLOY_CATEGORY}"){ echo '\033[31;1;4mGoing to deploy gCube Release \033[0m' deployRelease("${DEPLOY_CATEGORY}", yamlConfig); - }else { println ("CATEGORIES NOT FOUND ON YAML FILE. SKIP TO NEXT STAGE");} + }else println ("CATEGORIES NOT FOUND. ENVIRONMENT NOT SET FOR RELEASE DEPLOYMENT. NOTHING TO DO"); } } } From 9d7fbced7f77127691b25077af80f239b799dd8d Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 12:02:55 +0200 Subject: [PATCH 09/31] add portlets to the deploy job. first attempt --- Jenkinsfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a0b79f8..d7826ce 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -271,8 +271,8 @@ pipeline { } } -/* CHECKUP METHODS */ +/* CHECKUP METHODS */ //Implement a new method in order to check the input parameters def checkup(String service, String version, String host){ @@ -285,7 +285,6 @@ def checkup(String service, String version, String host){ """) } - //Implement a new method in order to check the input parameters def checkupRelease(String service, String version){ sh(""" @@ -320,6 +319,7 @@ def parseDeployPendingJobs( def deployFolder){ deployJobs(serviceList.unique()) } } + //Deploy jobs from an input list with the following elements: serviceName,serviceVersion,targetHost. Create a new stage for any job def deployJobs(def serviceList){ for (def record : serviceList) { @@ -349,9 +349,9 @@ def deploy(String service, String version, String host){ /* DEPLOY RELEASE METHODS*/ - // collects all the components defined inside one or more yaml categories matching categoryList and invoke the deploy def deployRelease(def categoryList, def yaml){ + def isPortlet= false def releaseList = [] def portlets = [] String smartgears @@ -370,7 +370,7 @@ def deployRelease(def categoryList, def yaml){ // 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") - echo "Output: '${output}'" + isPortlet= true }else{ releaseList += component_list?.collect {return "$it.name,$it.version" } } @@ -379,11 +379,11 @@ def deployRelease(def categoryList, def yaml){ } } } - deployReleaseJobs(releaseList, smartgears); + deployReleaseJobs(releaseList, smartgears, isPortlet); } //Deploy only release components, starting from a servicelist. All the component are passed as: componentName,componentVersion -def deployReleaseJobs(def serviceList, String smartgears){ +def deployReleaseJobs(def serviceList, String smartgears, boolean isPortlet){ if (serviceList){ println("Going to deploy release components"); for (def record : serviceList) { @@ -399,8 +399,9 @@ def deployReleaseJobs(def serviceList, String smartgears){ } } } - - + if (isPortlet){ + deployReleaseJob('generic-portlet', '',''); + } }else{ println("Release components not found. Skip this stage"); @@ -408,7 +409,6 @@ def deployReleaseJobs(def serviceList, String smartgears){ } - //Run ansible deploy related to a single service def deployReleaseJob(String service, String version, String smartgears){ def now = new Date(); From ce2beba79496065972b4950a9b0d09d478629696 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 12:15:15 +0200 Subject: [PATCH 10/31] fix deploy condition --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7826ce..eaf235a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -384,7 +384,7 @@ def deployRelease(def categoryList, def yaml){ //Deploy only release components, starting from a servicelist. All the component are passed as: componentName,componentVersion def deployReleaseJobs(def serviceList, String smartgears, boolean isPortlet){ - if (serviceList){ + if (serviceList || isPortlet){ println("Going to deploy release components"); for (def record : serviceList) { service=record.split(","); @@ -402,6 +402,7 @@ def deployReleaseJobs(def serviceList, String smartgears, boolean isPortlet){ if (isPortlet){ deployReleaseJob('generic-portlet', '',''); } + }else{ println("Release components not found. Skip this stage"); From 8e4a4ea24918049c4e20603c9d14a23117d1ef6e Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 12:38:46 +0200 Subject: [PATCH 11/31] change ANSIBLE_ROOT_FOLDER value --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eaf235a..797bedb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,7 +57,7 @@ pipeline { AGENT_ROOT_FOLDER = "${agent_root_folder}" // folder where all the pending deployment will be added PENDING_DEPLOY_FOLDER="${agent_root_folder}/CD/" - ANSIBLE_ROOT_FOLDER = "${agent_root_folder}/ansible-repos/ansible-playbooks/d4science-ghn-cluster/CD" + ANSIBLE_ROOT_FOLDER = "${agent_root_folder}/ansible-repos/ansible-playbooks/d4science-ghn-cluster" PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}" // deploy file related to the current pipeline job DEPLOY_FILE = "${PENDING_DEPLOY_FOLDER}deploy.${PIPELINE_BUILD_NUMBER}.csv" @@ -339,7 +339,7 @@ def deployJobs(def serviceList){ def deploy(String service, String version, String host){ def now = new Date(); println("Going to deploy the service "+service+" with version: "+version+" on target: "+host); - def statusCode = sh( script: "cd $ANSIBLE_ROOT_FOLDER;./deployService.sh $service $version $host;", returnStdout: true); + def statusCode = sh( script: "cd ${ANSIBLE_ROOT_FOLDER}/CD;./deployService.sh $service $version $host;", returnStdout: true); sh(""" echo " last exit code \$?"; """) @@ -414,7 +414,7 @@ def deployReleaseJobs(def serviceList, String smartgears, boolean isPortlet){ def deployReleaseJob(String service, String version, String smartgears){ def now = new Date(); println("Going to deploy the service "+service+" with version: "+version+" on preproduction "); - def statusCode = sh( script: "cd $ANSIBLE_ROOT_FOLDER;git pull;./deployPreprodService.sh $service $version $smartgears ;", returnStdout: true); + def statusCode = sh( script: "cd ${ANSIBLE_ROOT_FOLDER}/CD;git pull;./deployPreprodService.sh $service $version $smartgears ;", returnStdout: true); sh(""" echo " last exit code \$?"; """) From 6ada59467f73ad638cf6b5ac2c607f057672d3bf Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 14:54:23 +0200 Subject: [PATCH 12/31] fix json file --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 797bedb..9d91750 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -365,7 +365,9 @@ def deployRelease(def categoryList, def yaml){ def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }} smartgears=(sg !=null ) ? sg[0] : '' }else if (category =="${PORTLET_CATEGORY}"){ + portlets="{ \"generic_portlets\": "; portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } + portlets += "}" writeJSON file: 'portlets.json', json: portlets // def read = readJSON file: 'portlets.json' // println("Portlets found: "+read.name+" "+read.version+ " "+read.extension) From 12be87c1180e50d16c06ddcac21ac2cc5e6adbfa Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 15:04:07 +0200 Subject: [PATCH 13/31] fix json file generation --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9d91750..f65267d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -365,9 +365,9 @@ def deployRelease(def categoryList, def yaml){ def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }} smartgears=(sg !=null ) ? sg[0] : '' }else if (category =="${PORTLET_CATEGORY}"){ - portlets="{ \"generic_portlets\": "; + portlets="\"generic_portlets\": "; portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } - portlets += "}" + // portlets += "}" writeJSON file: 'portlets.json', json: portlets // def read = readJSON file: 'portlets.json' // println("Portlets found: "+read.name+" "+read.version+ " "+read.extension) From 14dcf64e6d50eb56a1d5650411029040bd6a1824 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 15:15:32 +0200 Subject: [PATCH 14/31] fix json --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f65267d..a0ec611 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -365,10 +365,12 @@ def deployRelease(def categoryList, def yaml){ def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }} smartgears=(sg !=null ) ? sg[0] : '' }else if (category =="${PORTLET_CATEGORY}"){ - portlets="\"generic_portlets\": "; + //def portlets="{\"generic_portlets\": "; portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } - // portlets += "}" - writeJSON file: 'portlets.json', json: portlets + def jsonContent= "{\"generic_portlets\":"+portlets+"}" + echo "json: $json" + // portlets += "}" + 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") From f9c047663821ec7fa8b53710a159d1ed5dd706c2 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 15:22:52 +0200 Subject: [PATCH 15/31] fix variable name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a0ec611..c64eca9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -368,7 +368,7 @@ def deployRelease(def categoryList, def yaml){ //def portlets="{\"generic_portlets\": "; portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } def jsonContent= "{\"generic_portlets\":"+portlets+"}" - echo "json: $json" + echo "json: $jsonContent" // portlets += "}" writeJSON file: 'portlets.json', json: jsonContent // def read = readJSON file: 'portlets.json' From 203967e625aa7f4c99ce428ee265a6c3ea90863e Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 15:28:26 +0200 Subject: [PATCH 16/31] restore old variable for debugging --- Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c64eca9..8de43ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -367,10 +367,11 @@ def deployRelease(def categoryList, def yaml){ }else if (category =="${PORTLET_CATEGORY}"){ //def portlets="{\"generic_portlets\": "; portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } - def jsonContent= "{\"generic_portlets\":"+portlets+"}" - echo "json: $jsonContent" +// def jsonContent= "{\"generic_portlets\":"+portlets+"}" +// echo "json: $jsonContent" + echo " json: $portlets" // portlets += "}" - writeJSON file: 'portlets.json', json: jsonContent + writeJSON file: 'portlets.json', json: portlets // 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") From 77cf75579c00073736de59957e95e48774682eab Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 15:42:29 +0200 Subject: [PATCH 17/31] check json slurper method --- Jenkinsfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8de43ed..fc5e436 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -367,11 +367,13 @@ def deployRelease(def categoryList, def yaml){ }else if (category =="${PORTLET_CATEGORY}"){ //def portlets="{\"generic_portlets\": "; portlets += component_list?.collect{ return [ 'name': "$it.name", 'version': "$it.version", 'extension': 'war' ] } -// def jsonContent= "{\"generic_portlets\":"+portlets+"}" -// echo "json: $jsonContent" - echo " json: $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: portlets + writeJSON file: 'portlets.json', json: json // 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") From d55c3c728f9202f2a2254ea8572209d180aae25b Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 15:45:55 +0200 Subject: [PATCH 18/31] add json slurper import --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index fc5e436..8f45ef7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,6 @@ #!groovy import org.yaml.snakeyaml.Yaml +import groovy.json.JsonSlurper /** * Deploy gCube components on D4Science Infrastructure (dev and preprod environments) From 1a63a95de4df646673f9926e0d297e763146b894 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 15:58:52 +0200 Subject: [PATCH 19/31] try to remove brackets --- Jenkinsfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8f45ef7..a6ee0f4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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") From 1609eb2c1e90470da17eea9eb7d74545130c9a38 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 16:07:00 +0200 Subject: [PATCH 20/31] fix again json syntax --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a6ee0f4..253b75d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -368,7 +368,7 @@ def deployRelease(def categoryList, def yaml){ }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+"}" echo "json: $jsonContent" From ba88a51028be2c8b7be94e9d72f0916e6a7dff25 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 16:13:56 +0200 Subject: [PATCH 21/31] add brackets to json creation string --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 253b75d..025b372 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -368,7 +368,7 @@ def deployRelease(def categoryList, def yaml){ }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+"}" echo "json: $jsonContent" From 48e2c3fd47aaeb72a5176e6480353f96d499a127 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 17:12:50 +0200 Subject: [PATCH 22/31] fix json syntax --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 025b372..1448eda 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -370,7 +370,7 @@ def deployRelease(def categoryList, def yaml){ // 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 jsonContent= "{\"generic_portlets\": "+portlets+"}" echo "json: $jsonContent" writeJSON file: 'portlets.json', json: jsonContent // def read = readJSON file: 'portlets.json' From dd691f73c94f8065bbd51582575bb5f25e25687f Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 08:56:40 +0200 Subject: [PATCH 23/31] add check on group_id just for test --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1448eda..04db713 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -368,7 +368,7 @@ def deployRelease(def categoryList, def yaml){ }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 " {\"group_id\": \"${it.group} ?: \"org.gcube.portlets.user\"\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "} echo "portlets: $portlets" def jsonContent= "{\"generic_portlets\": "+portlets+"}" echo "json: $jsonContent" From a52265bcdddd5208c845922f4ef8cd13c72cb652 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 09:04:06 +0200 Subject: [PATCH 24/31] remove default from group_id field --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 04db713..bd34b0b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -368,7 +368,7 @@ def deployRelease(def categoryList, def yaml){ }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 " {\"group_id\": \"${it.group} ?: \"org.gcube.portlets.user\"\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "} + portlets += component_list?.collect{ return " {\"group_id\": \"$it.group\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "} echo "portlets: $portlets" def jsonContent= "{\"generic_portlets\": "+portlets+"}" echo "json: $jsonContent" From 2fbc25b0fd92ecbce6c1452e59cdddb4b3d15e74 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 09:12:28 +0200 Subject: [PATCH 25/31] fix group field name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bd34b0b..631b9c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -368,7 +368,7 @@ def deployRelease(def categoryList, def yaml){ }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 " {\"group_id\": \"$it.group\", \"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\"} "} echo "portlets: $portlets" def jsonContent= "{\"generic_portlets\": "+portlets+"}" echo "json: $jsonContent" From 87931065a3f376ffc9cb91cdb73edaf824db10a7 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 09:16:19 +0200 Subject: [PATCH 26/31] try to remove the null values --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 631b9c7..002c821 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -369,6 +369,7 @@ def deployRelease(def categoryList, def yaml){ //def portlets="{\"generic_portlets\": "; // 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.removeAll([null]); echo "portlets: $portlets" def jsonContent= "{\"generic_portlets\": "+portlets+"}" echo "json: $jsonContent" From 30f75a203eda7392276076e144bd239b823c649c Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 09:22:28 +0200 Subject: [PATCH 27/31] fix remove unset group --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 002c821..b6aaf8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -369,7 +369,7 @@ def deployRelease(def categoryList, def yaml){ //def portlets="{\"generic_portlets\": "; // 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.removeAll([null]); + portlets.removeAll(["\"group_id\": \"null\""]); echo "portlets: $portlets" def jsonContent= "{\"generic_portlets\": "+portlets+"}" echo "json: $jsonContent" From 0ec2f9b56df5ef1ed191ab1cd3873bc4ba0e2478 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 09:39:37 +0200 Subject: [PATCH 28/31] fix collection --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b6aaf8d..8138ac1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -368,8 +368,9 @@ def deployRelease(def categoryList, def yaml){ }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 " {\"group_id\": \"$it.group_id\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "} - portlets.removeAll(["\"group_id\": \"null\""]); +// portlets += component_list?.collect{ return " {\"group_id\": \"$it.group_id\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "} + 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" def jsonContent= "{\"generic_portlets\": "+portlets+"}" echo "json: $jsonContent" From f823ac8d197fdc6797e2c3b1b050016b5f9f4bf1 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 09:41:08 +0200 Subject: [PATCH 29/31] fix collection --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8138ac1..2c40755 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -369,7 +369,7 @@ def deployRelease(def categoryList, def yaml){ //def portlets="{\"generic_portlets\": "; // 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{ 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 += 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" def jsonContent= "{\"generic_portlets\": "+portlets+"}" From 974a264b3222ce86b69af58642b979a7a9ad9904 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 16 Jun 2023 09:44:32 +0200 Subject: [PATCH 30/31] fix collection condition --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c40755..a4ef77d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -369,7 +369,7 @@ def deployRelease(def categoryList, def yaml){ //def portlets="{\"generic_portlets\": "; // 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{ 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 += 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" def jsonContent= "{\"generic_portlets\": "+portlets+"}" From 951d53cef25bc5fa239ec816233fc92aace11ae7 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 7 Sep 2023 12:21:14 +0200 Subject: [PATCH 31/31] managed the smartgears-distribution-legacy component just in case it is present on release file --- Jenkinsfile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a4ef77d..dcdf2d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -362,21 +362,14 @@ def deployRelease(def categoryList, def yaml){ for ( def category : categories){ if("${group_name}" == "$category"){ if (category == "${DISTRIBUTION_CATEGORY}"){ - //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"; }} + //searching smartgears-distribution (os smartgears-distribution-legacy) version in Distribution component defined inside the yaml file + def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution' || "$it.name" == 'smartgears-distribution-legacy' ){ return "$it.version"; }} 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 " {\"group_id\": \"$it.group_id\", \"name\": \"$it.name\", \"version\": \"$it.version\", \"extension\": \"war\"} "} 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" def jsonContent= "{\"generic_portlets\": "+portlets+"}" 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") isPortlet= true }else{