Goal
Run multiple stages of a declarative Jenkins pipeline on the same node.
Setup
This is just a minimal example to show the p
Since version 1.3 of Declarative Pipeline plugin, this is officially supported. It's officially called "Sequential Stages".
pipeline {
agent none
stages {
stage("check code style") {
agent {
docker "code-style-check-image"
}
steps {
sh "./check-code-style.sh"
}
}
stage("build and test the project") {
agent {
docker "build-tools-image"
}
stages {
stage("build") {
steps {
sh "./build.sh"
}
}
stage("test") {
steps {
sh "./test.sh"
}
}
}
}
}
}
Official announcement here: https://jenkins.io/blog/2018/07/02/whats-new-declarative-piepline-13x-sequential-stages/