Use a fixed root folder for the local maven repo.

This commit is contained in:
Manuele Simi 2019-05-29 23:24:09 -04:00
parent acb2f7067d
commit cc07b2eb5a
1 changed files with 6 additions and 5 deletions

11
Jenkinsfile vendored
View File

@ -2,32 +2,33 @@
// set the build options according to the Type of build
def (options,maven_local_repo_path,maven_settings_file) = ['','','']
def maven_jdk = 'OpenJDK 8'
def agent_root_folder = '/var/lib/jenkins'
if (params.Type == 'SNAPSHOT-DRY-RUN') {
echo "Configure Maven for SNAPSHOT-DRY-RUN artifacts"
options = ''
maven_local_repo_path = "${env.HOME}/local-snapshots"
maven_local_repo_path = "${agent_root_folder}/local-snapshots"
maven_settings_file = "${env.HOME}/.m2/jenkins-shapshots-dry-run-settings.xml"
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
}
if (params.Type == 'SNAPSHOT') {
echo "Configure Maven for SNAPSHOT artifacts"
options = ''
maven_local_repo_path = "${env.HOME}/local-snapshots"
maven_local_repo_path = "${agent_root_folder}/local-snapshots"
maven_settings_file = "${env.HOME}/.m2/jenkins-shapshots-settings.xml"
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
}
if (params.Type == 'RELEASE-DRY-RUN') {
echo "Configure Maven for RELEASE-DRY-RUN artifacts"
options = ''
maven_local_repo_path = "${env.HOME}/local-releases"
maven_local_repo_path = "${agent_root_folder}/local-releases"
maven_settings_file = "${env.HOME}/.m2/jenkins-releases-dry-run-settings.xml"
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
}
if (params.Type == 'RELEASE') {
echo "Configure Maven for RELEASE artifacts"
options = ''
maven_local_repo_path = "${env.HOME}/local-releases"
maven_local_repo_path = "${agent_root_folder}/local-releases"
maven_settings_file = "${env.HOME}/.m2/jenkins-releases-settings.xml"
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
}
@ -52,7 +53,7 @@ pipeline {
description: 'The type of artifacts the build is expected to generate',
name: 'Type')
}
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
stages {
stage('clean up before starting') {