diff --git a/Jenkinsfile b/Jenkinsfile index 7efa55b..2648956 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ import org.yaml.snakeyaml.Yaml def (options, maven_local_repo_path, maven_settings_file) = ['', '', ''] def maven_jdk = 'OpenJDK 8' def agent_root_folder = '/var/lib/jenkins/.m2' +def agent_label = 'pipeline-agent' if (params.Type == 'SNAPSHOT-DRY-RUN') { echo "Configure Maven for SNAPSHOT-DRY-RUN artifacts" @@ -61,7 +62,7 @@ pipeline { // see https://jenkins.io/doc/book/pipeline/syntax/#agent agent { - label 'pipeline-agent' + label agent_label } // see https://jenkins.io/doc/book/pipeline/syntax/#environment @@ -101,7 +102,7 @@ pipeline { echo build(job: 'maven-parent', wait: true, parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"], [$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"], - [$class: 'LabelParameterValue', name: 'exec_label', label: "pipeline-agent", nodeEligibility: [$class: 'AllNodeEligibility']] + [$class: 'LabelParameterValue', name: 'exec_label', label: agent_label, nodeEligibility: [$class: 'AllNodeEligibility']] ]).result echo "Done with maven-parent" } @@ -189,7 +190,7 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path) { build(job: name, parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"], [$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"], - [$class: 'LabelParameterValue', name: 'exec_label', label: "pipeline-agent", nodeEligibility: [$class: 'AllNodeEligibility']] + [$class: 'LabelParameterValue', name: 'exec_label', label: agent_label, nodeEligibility: [$class: 'AllNodeEligibility']] ]) } ]