简体   繁体   English

并行运行Jenkins作业

[英]Run Jenkins jobs in parallel

I have 3 different jobs (Build, Undeploy and Deploy), which want to execute Build and Undeploy in parallel and after that Deploy. 我有3个不同的工作(构建,取消部署和部署),它们希望并行执行构建和取消部署,然后执行部署。

From search got to know that Build Flow Plugin got deprecated. 从搜索开始知道Build Flow Plugin已被弃用。

Please suggest a plugin. 请建议一个插件。

You can write Jenkins file with the below format:- 您可以使用以下格式编写Jenkins文件: -

pipeline {
    stages {
    agent  { node { label 'master' } }
    stage('Build/Undeploy') {
            parallel {

                 stage('Build') {

                    agent { node { label 'Build' } }

                    steps {
                        script {
                            //Call your build script
                        }
                    }
                }

                stage('Undeploy') {

                    agent { node { label 'Undeploy' } }

                    steps {
                        script {
                            //Call your undeploy script
                        }
                    }
                }
            }
         }
    stage('Deploy'){

            agent { node { label 'Deploy' } }

            steps {
                script {
                    //Call your deploy script
                }
            }
        }
     }
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM