add check on release components

This commit is contained in:
Roberto Cirillo 2023-06-14 14:59:34 +02:00
parent 195ad81f65
commit 7f786fbbe7
1 changed files with 23 additions and 14 deletions

37
Jenkinsfile vendored
View File

@ -349,24 +349,33 @@ def deployJobs(def serviceList){
} }
//Deploy only release components. All the component are passed as: componentName,componentVersion //Deploy only release components. All the component are passed as: componentName,componentVersion
def deployReleaseJobs(def serviceList, String smartgears){ def deployReleaseJobs(def serviceList, String smartgears){
println("Going to deploy release components"); if (serviceList){
for (def record : serviceList) { println("Going to deploy release components");
service=record.split(","); for (def record : serviceList) {
stage(service[0]){ service=record.split(",");
println("Processing RELEASE deploy: service "+service[ 0 ]+" with version "+service[ 1 ]+" and SG "+smartgears) stage(service[0]){
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { println("Processing RELEASE deploy: service "+service[ 0 ]+" with version "+service[ 1 ]+" and SG "+smartgears)
checkupRelease(service[0], service[ 1 ]); catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
if (smartgears) checkupRelease(service[0], service[ 1 ]);
deployRelease(service[0], service[ 1 ], smartgears); if (smartgears)
else deployRelease(service[0], service[ 1 ], smartgears);
deployRelease(service[0], service[ 1 ], ''); 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 // collects all the components defined inside one or more yaml categories matching categoryList
def deployRelease(def categoryList, def yaml){ def deployRelease(def categoryList, def yaml){
def releaseList = [] def releaseList = []
def portlets
String smartgears String smartgears
def categories=categoryList.split(',') def categories=categoryList.split(',')
yaml.gCube_release.Components.each { group_name, component_list -> 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"; }} def sg= component_list?.collect{ if ("$it.name" == 'smartgears-distribution'){ return "$it.version"; }}
smartgears=(sg !=null ) ? sg[0] : '' smartgears=(sg !=null ) ? sg[0] : ''
}else if (category =="${PORTLET_CATEGORY}"){ }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 writeJSON file: 'portlets.json', json: portlets
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)