Set a dry-run profile for the first stage (maven-parent).

This commit is contained in:
Manuele Simi 2019-11-22 21:53:24 -05:00
parent 13a3d407d9
commit a5030995f6
1 changed files with 8 additions and 4 deletions

12
Jenkinsfile vendored
View File

@ -2,8 +2,7 @@
import org.yaml.snakeyaml.Yaml
// 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 (options, maven_local_repo_path, maven_settings_file, maven_parent_file) = ['', '', '', '']
def agent_root_folder = '/var/lib/jenkins/.m2'
if (params.Type == 'SNAPSHOT-DRY-RUN') {
@ -11,30 +10,35 @@ if (params.Type == 'SNAPSHOT-DRY-RUN') {
options = ''
maven_local_repo_path = "local-snapshots"
maven_settings_file = "jenkins-snapshots-dry-run-settings.xml"
maven_parent_file = "jenkins-snapshots-dry-run-settings.xml"
}
if (params.Type == 'SNAPSHOT') {
echo "Configure Maven for SNAPSHOT artifacts"
options = ''
maven_local_repo_path = "local-snapshots"
maven_settings_file = "jenkins-snapshots-settings.xml"
maven_parent_file = "jenkins-snapshots-dry-run-settings.xml"
}
if (params.Type == 'RELEASE-DRY-RUN') {
echo "Configure Maven for RELEASE-DRY-RUN artifacts"
options = ''
maven_local_repo_path = "local-releases"
maven_settings_file = "jenkins-releases-dry-run-settings.xml"
maven_parent_file = "jenkins-releases-dry-run-settings.xml"
}
if (params.Type == 'STAGING') {
echo "Configure Maven for STAGING artifacts"
options = ''
maven_local_repo_path = "local-staging"
maven_settings_file = "jenkins-staging-settings.xml"
maven_parent_file = "jenkins-staging-dry-run-settings.xml"
}
if (params.Type == 'RELEASE') {
echo "Configure Maven for RELEASE artifacts"
options = ''
maven_local_repo_path = "local-releases"
maven_settings_file = "jenkins-releases-settings.xml"
maven_parent_file = "jenkins-releases-dry-run-settings.xml"
}
echo "Use settings file at ${maven_settings_file}"
@ -69,12 +73,12 @@ pipeline {
// see https://jenkins.io/doc/book/pipeline/syntax/#environment
environment {
JOB_OPTIONS = "${options}"
//make the JVM start a bit faster with basic just-in-time compilation of the code only (-XX:*)
//make maven running in a multi-thread fashion (16 threads, 2 threads on each Core)
MAVEN_OPTS="-Dmaven.artifact.threads=16 -T 2C -XX:+TieredCompilation -XX:TieredStopAtLevel=1 "
AGENT_ROOT_FOLDER = "${agent_root_folder}"
MAVEN_SETTINGS_FILE = "${maven_settings_file}"
MAVEN_PARENT_FILE = "${maven_parent_file}"
MAVEN_LOCAL_REPO = "${agent_root_folder}/${maven_local_repo_path}"
CLEANUP_GCUBE_REPO = "${params.cleanup_gcube_artifacts}"
REMOVE_LOCAL_REPO = "${params.cleanup_local_repo}"
@ -133,7 +137,7 @@ pipeline {
stage('build maven-parent') {
steps {
echo build(job: 'maven-parent', wait: true,
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"],
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_parent_file}"],
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
[$class: 'LabelParameterValue', name: 'exec_label', label: "CD", nodeEligibility: [$class: 'AllNodeEligibility']]
]).result