Add build number to the repo path.

This commit is contained in:
Manuele Simi 2019-10-09 16:06:19 -04:00
parent 7fbb9ffaa5
commit 08626b8234
1 changed files with 5 additions and 5 deletions

10
Jenkinsfile vendored
View File

@ -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']]
])
}