Use a fixed root folder for the local maven repo.
This commit is contained in:
parent
acb2f7067d
commit
cc07b2eb5a
|
@ -2,32 +2,33 @@
|
||||||
// set the build options according to the Type of build
|
// set the build options according to the Type of build
|
||||||
def (options,maven_local_repo_path,maven_settings_file) = ['','','']
|
def (options,maven_local_repo_path,maven_settings_file) = ['','','']
|
||||||
def maven_jdk = 'OpenJDK 8'
|
def maven_jdk = 'OpenJDK 8'
|
||||||
|
def agent_root_folder = '/var/lib/jenkins'
|
||||||
|
|
||||||
if (params.Type == 'SNAPSHOT-DRY-RUN') {
|
if (params.Type == 'SNAPSHOT-DRY-RUN') {
|
||||||
echo "Configure Maven for SNAPSHOT-DRY-RUN artifacts"
|
echo "Configure Maven for SNAPSHOT-DRY-RUN artifacts"
|
||||||
options = ''
|
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/jenkins-shapshots-dry-run-settings.xml"
|
||||||
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
|
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
|
||||||
}
|
}
|
||||||
if (params.Type == 'SNAPSHOT') {
|
if (params.Type == 'SNAPSHOT') {
|
||||||
echo "Configure Maven for SNAPSHOT artifacts"
|
echo "Configure Maven for SNAPSHOT artifacts"
|
||||||
options = ''
|
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/jenkins-shapshots-settings.xml"
|
||||||
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
|
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
|
||||||
}
|
}
|
||||||
if (params.Type == 'RELEASE-DRY-RUN') {
|
if (params.Type == 'RELEASE-DRY-RUN') {
|
||||||
echo "Configure Maven for RELEASE-DRY-RUN artifacts"
|
echo "Configure Maven for RELEASE-DRY-RUN artifacts"
|
||||||
options = ''
|
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/jenkins-releases-dry-run-settings.xml"
|
||||||
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
|
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
|
||||||
}
|
}
|
||||||
if (params.Type == 'RELEASE') {
|
if (params.Type == 'RELEASE') {
|
||||||
echo "Configure Maven for RELEASE artifacts"
|
echo "Configure Maven for RELEASE artifacts"
|
||||||
options = ''
|
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/jenkins-releases-settings.xml"
|
||||||
maven_settings_file = "${env.HOME}/.m2/settings.xml" //TODO: to remove, just for testing
|
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',
|
description: 'The type of artifacts the build is expected to generate',
|
||||||
name: 'Type')
|
name: 'Type')
|
||||||
}
|
}
|
||||||
|
|
||||||
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
|
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
|
||||||
stages {
|
stages {
|
||||||
stage('clean up before starting') {
|
stage('clean up before starting') {
|
||||||
|
|
Loading…
Reference in New Issue