From cc07b2eb5abc781c1c1f233ce305559d6e8f77cd Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Wed, 29 May 2019 23:24:09 -0400 Subject: [PATCH] Use a fixed root folder for the local maven repo. --- Jenkinsfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 683a926..61ea0ca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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') {