本文介绍了检查并联阶段的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的东西:

stages {
    stage('createTemplate') {
        parallel {
            stage('template_a') {
                creating template a
            }
            stage('template_b') {
                creating template b
            }
        }
    }
    stage('deployVm') {
        parallel {
            stage('deploy_a') {
                deploy vm a
            }
            stage('deploy_b') {
                deploy vm b
            }
        }
    }
}

如何确保只有在各自的createTemplate阶段成功时才运行deployVm阶段?

How can I make sure that deployVm stages run when and only when respective createTemplate stages were successful?

推荐答案

您可能希望像这样运行一个parallel:

You may want to run one parallel like this:

parallel {
  stage('a') {
    stages {
      stage ('template_a') { ... }
      stage ('deploy_a') { ... }
    }
  stage('b') {
    stages {
      stage ('template_b') { ... }
      stage ('deploy_b') { ... }
    }
  }
}

这将确保只有deploy的阶段才是成功的template阶段之后的阶段.

This will make sure only stages that deploy are the ones following successful template stages.

这篇关于检查并联阶段的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 23:57