Add build number to the repo path.
This commit is contained in:
parent
7fbb9ffaa5
commit
08626b8234
|
@ -24,7 +24,7 @@ if (params.Type == 'RELEASE-DRY-RUN') {
|
||||||
maven_local_repo_path = "local-releases"
|
maven_local_repo_path = "local-releases"
|
||||||
maven_settings_file = "jenkins-releases-dry-run-settings.xml"
|
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"
|
echo "Configure Maven for RELEASE-STAGING artifacts"
|
||||||
options = ''
|
options = ''
|
||||||
maven_local_repo_path = "local-staging"
|
maven_local_repo_path = "local-staging"
|
||||||
|
@ -68,14 +68,14 @@ pipeline {
|
||||||
// see https://jenkins.io/doc/book/pipeline/syntax/#environment
|
// see https://jenkins.io/doc/book/pipeline/syntax/#environment
|
||||||
environment {
|
environment {
|
||||||
JOB_OPTIONS = "${options}"
|
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}"
|
GCUBE_RELEASE_NUMBER = "${params.gCube_release_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
// see https://jenkins.io/doc/book/pipeline/syntax/#parameters
|
// see https://jenkins.io/doc/book/pipeline/syntax/#parameters
|
||||||
parameters {
|
parameters {
|
||||||
choice(name: 'Type',
|
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')
|
description: 'The type of artifacts the build is expected to generate')
|
||||||
|
|
||||||
string(name: 'gCube_release_version',
|
string(name: 'gCube_release_version',
|
||||||
|
@ -90,7 +90,7 @@ pipeline {
|
||||||
sh '''
|
sh '''
|
||||||
echo "Create a fresh local repository"
|
echo "Create a fresh local repository"
|
||||||
rm -rf $MAVEN_LOCAL_REPO
|
rm -rf $MAVEN_LOCAL_REPO
|
||||||
mkdir -p $MAVEN_LOCAL_REPO
|
mkdir -p $MAVEN_LOCAL_REPO/${env.BUILD_NUMBER}/
|
||||||
echo "Done with local repository"
|
echo "Done with local repository"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path) {
|
||||||
if (name && !"NONE".equalsIgnoreCase(name))
|
if (name && !"NONE".equalsIgnoreCase(name))
|
||||||
build(job: name,
|
build(job: name,
|
||||||
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"],
|
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']]
|
[$class: 'LabelParameterValue', name: 'exec_label', label: "pipeline-agent-garr", nodeEligibility: [$class: 'AllNodeEligibility']]
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue