Use the NodeLabelParameter plugin to set the pipeline-agent on the downstream jobs.

This commit is contained in:
Manuele Simi 2019-09-30 10:55:59 -04:00
parent 6fa0647d39
commit 28d9446d6a
2 changed files with 10 additions and 4 deletions

13
Jenkinsfile vendored
View File

@ -103,7 +103,10 @@ pipeline {
steps {
build(job: 'maven-parent',
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"],
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"]]) echo "Done with maven-parent"
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
[$class: 'LabelParameterValue', name: 'exec_label', label: "pipeline-agent", nodeEligibility: [$class: 'AllNodeEligibility']]
])
echo "Done with maven-parent"
}
}
stage('build Core components') {
@ -169,8 +172,10 @@ def buildComponents(args) {
if (args.items) {
parallel args.items?.collectEntries { name -> [ "${name}": {
if (name && !"NONE".equalsIgnoreCase(name))
build(job: name,
build(job: 'maven-parent',
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"],
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"]]) }]}
}
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
[$class: 'LabelParameterValue', name: 'exec_label', label: "pipeline-agent", nodeEligibility: [$class: 'AllNodeEligibility']]
])
}
}

View File

@ -8,6 +8,7 @@ Jenkins Pipeline script to manage a complete gCube release.
* [Pipeline: Maven](https://plugins.jenkins.io/pipeline-maven)
* [Pipeline: Basic Steps](https://plugins.jenkins.io/workflow-basic-steps)
* [Kubernetes](https://plugins.jenkins.io/kubernetes) (for the YAML parser)
* [NodeLabelParameter](https://plugins.jenkins.io/nodelabelparameter) (The node and label parameter plugin allows to dynamically select the node on which a job should be executed.)
* Jenkins configured with a JDK global tool named 'OpenJDK 8'
* Jenkins configured with a Maven global tool named 'Maven 3.6.2'