From ed1071bdb48bdf53d719080cd4ee64fcc92a83f7 Mon Sep 17 00:00:00 2001 From: "roberto.cirillo" Date: Thu, 13 Oct 2022 11:21:00 +0200 Subject: [PATCH] Set as variable the yaml group that identify the SG distribution --- Jenkinsfile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 442053a..3efb5a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,8 +78,10 @@ pipeline { RELEASE_JOB='gCubeBuilder' //URL to the YAML file. Used alternatively to RELEASE_JOB RELEASE_URL= "${params.RELEASE_URL}" - // username of ReleaseManager - RELEASE_MANAGER_USER='roberto.cirillo' + // username of ReleaseManager. Used for limiting the preproduction deployments + RELEASE_MANAGER_USER='roberto.cirillo' + // name of Smartgears distribution group, defined in the yaml file ( only for release deployments) + DISTRIBUTION_CATEGORY='Distribution' } parameters { @@ -338,7 +340,6 @@ def parseDeployPendingJobs( def deployFolder){ //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) { - println("Processing record: "+record) service=record.split(","); stage(service[0]){ println("Processing deploy: "+service[ 0 ]) @@ -353,7 +354,6 @@ def deployJobs(def serviceList){ //Deploy only release components. All the component are passed as: componentName,componentVersion def deployReleaseJobs(def serviceList, String smartgears){ for (def record : serviceList) { - println("Processing record: "+record) service=record.split(","); stage(service[0]){ println("Processing RELEASE deploy: service "+service[ 0 ]+" with version "+service[ 1 ]+" and SG "+smartgears) @@ -376,7 +376,7 @@ def deployRelease(def categoryList, def yaml){ if (categories.contains(group_name)){ for ( def category : categories){ if("${group_name}" == "$category"){ - if (category == 'Distribution'){ + 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"; }} smartgears=(sg !=null ) ? sg[0] : null @@ -389,7 +389,4 @@ def deployRelease(def categoryList, def yaml){ } } deployReleaseJobs(releaseList, smartgears); -} - - - +} \ No newline at end of file