From 9d7fbced7f77127691b25077af80f239b799dd8d Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 15 Jun 2023 12:02:55 +0200 Subject: [PATCH] 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();