generated from gCubeCI/Pipeline-Docker-Template
add deploy from release stage
This commit is contained in:
parent
bcff06a388
commit
0667282ccd
|
@ -134,21 +134,9 @@ pipeline {
|
|||
echo 'Cron build enabled. Deploy from system ongoing'
|
||||
script {
|
||||
echo "pipeline was triggered by ${params.TRIGGER_JOB}"
|
||||
if("${params.TRIGGER_JOB}" == "${RELEASE_JOB}"){
|
||||
println("Going to deploy the Release components")
|
||||
def releaseList = []
|
||||
jsonConfig.gCube_release.Components.each { group_name, component_list ->
|
||||
if("${group_name}" == "${DEPLOY_CATEGORY}"){
|
||||
println("found ${it.name} with version: ${it.version}");
|
||||
releaseList += "${it.name},${it.version}"
|
||||
}
|
||||
}
|
||||
deployJobs(releaseList);
|
||||
}else{
|
||||
println("Going to deploy all the pending deployments")
|
||||
def deployFolder="CD-${env.BUILD_NUMBER}";
|
||||
parseDeployPendingJobs(deployFolder);
|
||||
}
|
||||
println("Going to deploy all the pending deployments")
|
||||
def deployFolder="CD-${env.BUILD_NUMBER}";
|
||||
parseDeployPendingJobs(deployFolder);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -217,6 +205,31 @@ pipeline {
|
|||
|
||||
}
|
||||
}
|
||||
stage('Deploy from gCubeRelease ') {
|
||||
when{
|
||||
anyOf{
|
||||
triggeredBy 'BuildUpstreamCause'
|
||||
triggeredBy 'UpstreamCause'
|
||||
}
|
||||
// we should improve this conditional check
|
||||
equals(actual: "${params.TRIGGER_JOB}", expected: 'gCubeBuilder')
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
println("Going to deploy the Release components")
|
||||
def releaseList = []
|
||||
jsonConfig.gCube_release.Components.each { group_name, component_list ->
|
||||
if("${group_name}" == "${DEPLOY_CATEGORY}"){
|
||||
println("found ${it.name} with version: ${it.version}");
|
||||
releaseList += "${it.name},${it.version}"
|
||||
}
|
||||
}
|
||||
deployJobs(releaseList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
stage('Deploy manually ') {
|
||||
when{
|
||||
allOf{
|
||||
|
@ -379,7 +392,7 @@ def deployJobs(def serviceList){
|
|||
}else{
|
||||
//this is a release build
|
||||
stage(service[0]){
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
checkupRelease(service[0], service[ 1 ], service[2]);
|
||||
deployRelease(service[0], service[ 1 ], service[2]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue