Propagate resume option.
This commit is contained in:
parent
4326d6613d
commit
05df0c77f3
|
@ -5,7 +5,7 @@ import org.yaml.snakeyaml.Yaml
|
||||||
def (options, maven_local_repo_path, maven_settings_file, maven_parent_file) = ['', '', '', '']
|
def (options, maven_local_repo_path, maven_settings_file, maven_parent_file) = ['', '', '', '']
|
||||||
def agent_root_folder = '/var/lib/jenkins/.m2'
|
def agent_root_folder = '/var/lib/jenkins/.m2'
|
||||||
def verbose = true
|
def verbose = true
|
||||||
|
def resume = ${params.resume}
|
||||||
if (params.Type == 'SNAPSHOT-DRY-RUN') {
|
if (params.Type == 'SNAPSHOT-DRY-RUN') {
|
||||||
echo "Configure Maven for SNAPSHOT-DRY-RUN artifacts"
|
echo "Configure Maven for SNAPSHOT-DRY-RUN artifacts"
|
||||||
options = ''
|
options = ''
|
||||||
|
@ -47,6 +47,7 @@ echo "Use local repo at ${maven_local_repo_path}"
|
||||||
echo "Release number: ${params.gCube_release_version}"
|
echo "Release number: ${params.gCube_release_version}"
|
||||||
echo "Clean up gcube local artifacts? ${params.cleanup_gcube_artifacts}"
|
echo "Clean up gcube local artifacts? ${params.cleanup_gcube_artifacts}"
|
||||||
echo "Clean up all local artifacts? ${params.cleanup_local_repo}"
|
echo "Clean up all local artifacts? ${params.cleanup_local_repo}"
|
||||||
|
echo "Resume from previous build? ${params.resume}"
|
||||||
|
|
||||||
|
|
||||||
//locate the release file
|
//locate the release file
|
||||||
|
@ -90,6 +91,7 @@ pipeline {
|
||||||
GCUBE_RELEASE_NUMBER = "${params.gCube_release_version}"
|
GCUBE_RELEASE_NUMBER = "${params.gCube_release_version}"
|
||||||
PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}"
|
PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}"
|
||||||
TYPE = "${params.Type}"
|
TYPE = "${params.Type}"
|
||||||
|
RESUME = "${params.resume}"
|
||||||
JOB_REPORT = "${AGENT_ROOT_FOLDER}/build_jobs.${PIPELINE_BUILD_NUMBER}.csv"
|
JOB_REPORT = "${AGENT_ROOT_FOLDER}/build_jobs.${PIPELINE_BUILD_NUMBER}.csv"
|
||||||
PREVIOUS_JOB_REPORT = "${AGENT_ROOT_FOLDER}/build_jobs.${PIPELINE_BUILD_NUMBER -1}.csv"
|
PREVIOUS_JOB_REPORT = "${AGENT_ROOT_FOLDER}/build_jobs.${PIPELINE_BUILD_NUMBER -1}.csv"
|
||||||
|
|
||||||
|
@ -155,11 +157,12 @@ pipeline {
|
||||||
// the maven-parent needs to be built (once) at each execution
|
// the maven-parent needs to be built (once) at each execution
|
||||||
stage('build maven-parent') {
|
stage('build maven-parent') {
|
||||||
steps {
|
steps {
|
||||||
echo build(job: 'maven-parent', wait: true,
|
def gjob = build(job: 'maven-parent', wait: true, propagate: true,
|
||||||
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_parent_file}"],
|
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_parent_file}"],
|
||||||
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
|
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
|
||||||
[$class: 'LabelParameterValue', name: 'exec_label', label: "CD", nodeEligibility: [$class: 'AllNodeEligibility']]
|
[$class: 'LabelParameterValue', name: 'exec_label', label: "CD", nodeEligibility: [$class: 'AllNodeEligibility']]
|
||||||
]).result
|
])
|
||||||
|
sh "echo -e \\\"${name},${gjob.getResult()}\\\">> $JOB_REPORT"
|
||||||
echo "Done with maven-parent"
|
echo "Done with maven-parent"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,7 +172,7 @@ pipeline {
|
||||||
jsonConfig.gCube_release.Components.each { group_name, component_list ->
|
jsonConfig.gCube_release.Components.each { group_name, component_list ->
|
||||||
stage("build ${group_name} components") {
|
stage("build ${group_name} components") {
|
||||||
buildComponents items: component_list?.collect { "${it.name}" },
|
buildComponents items: component_list?.collect { "${it.name}" },
|
||||||
"${maven_settings_file}", "${maven_local_repo_path}"
|
"${maven_settings_file}", "${maven_local_repo_path}", "${resume}"
|
||||||
echo "Done with ${group_name} components"
|
echo "Done with ${group_name} components"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,12 +215,12 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def buildComponents(args, maven_settings_file, maven_local_repo_path) {
|
def buildComponents(args, maven_settings_file, maven_local_repo_path, resume) {
|
||||||
if (args.items) {
|
if (args.items) {
|
||||||
parallel args.items?.collectEntries { name ->
|
parallel args.items?.collectEntries { name ->
|
||||||
["${name}": {
|
["${name}": {
|
||||||
if (name && !"NONE".equalsIgnoreCase(name)) {
|
if (name && !"NONE".equalsIgnoreCase(name)) {
|
||||||
if ( (${params.resume}) && (wasSuccess(name)) ) {
|
if ( ('true'.equals(${resume})) && (wasSuccess(name)) ) {
|
||||||
// propagate success
|
// propagate success
|
||||||
sh "echo -e \\\"${name},SUCCESS\\\">> $JOB_REPORT"
|
sh "echo -e \\\"${name},SUCCESS\\\">> $JOB_REPORT"
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue