generated from gCubeCI/Pipeline-Docker-Template
feature/25131 #6
|
@ -271,8 +271,8 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CHECKUP METHODS */
|
|
||||||
|
|
||||||
|
/* CHECKUP METHODS */
|
||||||
|
|
||||||
//Implement a new method in order to check the input parameters
|
//Implement a new method in order to check the input parameters
|
||||||
def checkup(String service, String version, String host){
|
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
|
//Implement a new method in order to check the input parameters
|
||||||
def checkupRelease(String service, String version){
|
def checkupRelease(String service, String version){
|
||||||
sh("""
|
sh("""
|
||||||
|
@ -320,6 +319,7 @@ def parseDeployPendingJobs( def deployFolder){
|
||||||
deployJobs(serviceList.unique())
|
deployJobs(serviceList.unique())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deploy jobs from an input list with the following elements: serviceName,serviceVersion,targetHost. Create a new stage for any job
|
//Deploy jobs from an input list with the following elements: serviceName,serviceVersion,targetHost. Create a new stage for any job
|
||||||
def deployJobs(def serviceList){
|
def deployJobs(def serviceList){
|
||||||
for (def record : serviceList) {
|
for (def record : serviceList) {
|
||||||
|
@ -349,9 +349,9 @@ def deploy(String service, String version, String host){
|
||||||
|
|
||||||
/* DEPLOY RELEASE METHODS*/
|
/* DEPLOY RELEASE METHODS*/
|
||||||
|
|
||||||
|
|
||||||
// collects all the components defined inside one or more yaml categories matching categoryList and invoke the deploy
|
// collects all the components defined inside one or more yaml categories matching categoryList and invoke the deploy
|
||||||
def deployRelease(def categoryList, def yaml){
|
def deployRelease(def categoryList, def yaml){
|
||||||
|
def isPortlet= false
|
||||||
def releaseList = []
|
def releaseList = []
|
||||||
def portlets = []
|
def portlets = []
|
||||||
String smartgears
|
String smartgears
|
||||||
|
@ -370,7 +370,7 @@ def deployRelease(def categoryList, def yaml){
|
||||||
// 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)
|
||||||
def output = sh(returnStdout: true, returnStdoutTrim: true, script: "mv portlets.json $ANSIBLE_ROOT_FOLDER")
|
def output = sh(returnStdout: true, returnStdoutTrim: true, script: "mv portlets.json $ANSIBLE_ROOT_FOLDER")
|
||||||
echo "Output: '${output}'"
|
isPortlet= true
|
||||||
}else{
|
}else{
|
||||||
releaseList += component_list?.collect {return "$it.name,$it.version" }
|
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
|
//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){
|
if (serviceList){
|
||||||
println("Going to deploy release components");
|
println("Going to deploy release components");
|
||||||
for (def record : serviceList) {
|
for (def record : serviceList) {
|
||||||
|
@ -399,8 +399,9 @@ def deployReleaseJobs(def serviceList, String smartgears){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isPortlet){
|
||||||
|
deployReleaseJob('generic-portlet', '','');
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
println("Release components not found. Skip this stage");
|
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
|
//Run ansible deploy related to a single service
|
||||||
def deployReleaseJob(String service, String version, String smartgears){
|
def deployReleaseJob(String service, String version, String smartgears){
|
||||||
def now = new Date();
|
def now = new Date();
|
||||||
|
|
Loading…
Reference in New Issue