Parallel nghĩ các stage trong pipeline sẽ chạy đồng thời.
Parallel
if pipeline doesn’t have problem.
pipeline{
agent{
label "k8s-permanent"
}
stages{
stage("Stages Running in Parallel"){
failFast true
parallel{
stage("stage 1"){
steps {
echo "stage1 executing"
sleep 10
}
}
stage("stage 2"){
steps {
echo "stage2 executing"
sleep 10
}
}
stage("stage 3"){
steps {
echo "stage3 executing"
sleep 10
}
}
}
}
}
}
if a stage was error
pipeline{
agent{
label "k8s-permanent"
}
stages{
stage("Stages Running in Parallel"){
failFast true
parallel{
stage("stage 1"){
steps {
echo "stage1 executing"
sleep 10
}
}
stage("stage 2"){
steps {
echo "stage2 executing"
error "simulating error stage2"
sleep 2
}
}
stage("stage 3"){
steps {
echo "stage3 executing"
sleep 10
}
}
}
}
}
}