虚拟化容器,大数据,DBA,中间件,监控。

Jenkins pipeline 09 parallel 阶段并行

21 12月
作者:admin|分类:系统运维

如果有一个任务失败,那么整个并行任务都会失败(现在下面两个阶段同时运行)

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

image.png

浏览528 评论0
返回
目录
返回
首页
Jenkins Pipeline 10 环境变量使用指南 Jenkins pipeline 07 input 流水线交互