-
Type:
New Feature
-
Resolution: Duplicate
-
Priority:
Minor
-
Component/s: pipeline-model-definition-plugin
-
None
I would like to be able to easily run the same steps across multiple nodes using the declarative pipeline and a shared library. This does not currently seem to be possible since only custom steps can be created in shared libraries.
Â
Example jenkinsfile:
pipeline {
agent any
stages {
stage('Build everywhere') {
runOnAllPlatforms {
sh 'doing build things'
}
}
}
}
Example shared library vars/runOnAllPlatforms.groovy:
def call(Closure body) {
parallel {
stage('RHEL') {
agent {
node { label 'rhel7' }
}
steps {
body()
}
stage('Apple') {
agent {
node { label 'apple' }
}
steps {
body()
}
steps {
body()
}
}
}
- duplicates
-
JENKINS-40986 Matrix structure for Declarative Pipeline
-
- Resolved
-
- is duplicated by
-
JENKINS-49984 Ability to factor out multiple stages into shared libraries
-
- Closed
-