Jenkins pipeline 09 parallel 阶段并行
如果有一个任务失败,那么整个并行任务都会失败(现在下面两个阶段同时运行)
pipeline {
agent any
stages {
stage('Parallel Stage') {
failFast true
parallel {
stage('windows') {
agent {
label "master"
}
steps {
echo "windows"
}
}
stage('linux') {
agent {
label "build"
}
steps {
echo "linux"
}
}
}
}
}
}
Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on build-01 in /data/cicd/jenkinsagent/workspace/pipeline-test1
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Parallel Stage)
[Pipeline] parallel
[Pipeline] { (Branch: windows)
[Pipeline] { (Branch: linux)
[Pipeline] stage
[Pipeline] { (windows)
[Pipeline] stage
[Pipeline] { (linux)
[Pipeline] node
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/pipeline-test1
[Pipeline] {
Running on build-01 in /data/cicd/jenkinsagent/workspace/pipeline-test1@2
[Pipeline] {
[Pipeline] echo
windows
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] echo
linux
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // parallel
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
目录 返回
首页