Reputation: 548
I know that I can execute steps in parallel using the following Syntax.
pipeline {
agent any
stages {
stage('Build') {
steps {
checkout scm
echo 'Building'
}
}
stage('Some Testing') {
steps {
parallel(
"Step 1": {
echo 'Step 1'
},
"Step 2": {
echo 'Step 2'
}
)
}
}
stage('Send Mail') {
steps {
echo "sending mail"
}
}
}
}
I would like to display the steps allone in the Build Overview and move them to their own stages, like this.
pipeline{
agent any
stages {
stage('Build'){
steps {
checkout scm
echo 'Building'
}
}
parallel(
stage('Step 1'){
steps{
echo 'Step 1'
}
}
stage('Step 2'){
steps{
echo 'Step 2'
}
}
)
stage('Send Mail'){
steps {
echo "sending mail"
}
}
}
}
How can this be achieved, there is no good hint in the Jenkins Documentation regarding pipelines. Or is this just not possible?
Thanks in advance =)
Upvotes: 3
Views: 7471
Reputation: 37630
EDIT: This answer is outdated as of October 2017, see @r4d1um's answer.
As of now, declarative pipelines don't support the parallel
step directly. This is (according to the roadmap) currently under development:
You have to fall back to scripted pipelines here, either by putting the parallel
step into a script { }
block, or by wrapping it in a function.
Upvotes: 2
Reputation: 548
The described behavior is now available as of https://issues.jenkins-ci.org/browse/JENKINS-41334 in Pipeline Model Definition Plugin >= 1.2
Upvotes: 4