In a declarative Jenkins pipeline, I need to introduce a stage X
as another downstream for multiple upstream stages (B1, B2) which already have their corresponding downstream stages (C1,C2).
The visual representation of existing pipeline is as follows.
This is described using below declarative pipeline syntax.
pipeline {
agent any
stages {
stage('A'){
...
}
stage('BC'){
paralle {
stage('1'){
stages {
stage('B1'){
...
}
stage('C1'){
...
}
}
}
stage('2'){
stages {
stage('B2'){
...
}
stage('C2'){
...
}
}
}
}
}
stage('D') {
...
}
}
}
I need to perform certain steps when stages B1 and B2 are complete. This I am planning to achieve by introducing a stage X
as illustrated below.
How to add stage X
in existing pipeline? Is there any other mechanism to execute certain steps after B1 and B2 both are complete and without waiting for stages C1,C2 and D?