From 08626b823433c8b5c8aabcecce6994a162dabc6e Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Wed, 9 Oct 2019 16:06:19 -0400 Subject: [PATCH] Add build number to the repo path. --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 995d8df..37578d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ if (params.Type == 'RELEASE-DRY-RUN') { maven_local_repo_path = "local-releases" maven_settings_file = "jenkins-releases-dry-run-settings.xml" } -if (params.Type == 'RELEASE-STAGING') { +if (params.Type == 'STAGING') { echo "Configure Maven for RELEASE-STAGING artifacts" options = '' maven_local_repo_path = "local-staging" @@ -68,14 +68,14 @@ pipeline { // see https://jenkins.io/doc/book/pipeline/syntax/#environment environment { JOB_OPTIONS = "${options}" - MAVEN_LOCAL_REPO = "${agent_root_folder}/${BUILD_NUMBER}/${maven_local_repo_path}" + MAVEN_LOCAL_REPO = "${agent_root_folder}/${maven_local_repo_path}" GCUBE_RELEASE_NUMBER = "${params.gCube_release_version}" } // see https://jenkins.io/doc/book/pipeline/syntax/#parameters parameters { choice(name: 'Type', - choices: ['SNAPSHOT-DRY-RUN', 'SNAPSHOT', 'RELEASE-DRY-RUN', 'RELEASE-STAGING', 'RELEASE'], + choices: ['SNAPSHOT-DRY-RUN', 'SNAPSHOT', 'STAGING', 'RELEASE'], description: 'The type of artifacts the build is expected to generate') string(name: 'gCube_release_version', @@ -90,7 +90,7 @@ pipeline { sh ''' echo "Create a fresh local repository" rm -rf $MAVEN_LOCAL_REPO - mkdir -p $MAVEN_LOCAL_REPO + mkdir -p $MAVEN_LOCAL_REPO/${env.BUILD_NUMBER}/ echo "Done with local repository" ''' @@ -196,7 +196,7 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path) { if (name && !"NONE".equalsIgnoreCase(name)) build(job: name, parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"], - [$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}/${name}"], + [$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}/${env.BUILD_NUMBER}/${name}"], [$class: 'LabelParameterValue', name: 'exec_label', label: "pipeline-agent-garr", nodeEligibility: [$class: 'AllNodeEligibility']] ]) }