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
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)