Jenkins:如何根据复选框参数条件跳过 Jenkins 管道中的一个阶段?

问题描述

我有应用程序列表作为复选框(使用带有“,”的扩展选择参数作为 multiSelectDelimiter)。 如果选中匹配的复选框,我想执行一个阶段,否则跳过它。

例如:apps: app1,app3 [checkboxes selected] checkboxes selected image

stages{
  paralle{
    stage('First'){
       when {
        // execute this when app1 is selected 
       }
       steps {
       }
    }
    stage('Second'){
       when {
        // execute this when app2 is selected,should skip this as 'app2' is not checked
       }
       steps {
       }
    }
    stage('Third'){
       when {
        // execute this when app3 is selected 
       }
       steps {
       }
    }
    stage('Fourth'){
       when {
        // execute this when app4 is selected,else skip it 
       }
       steps {
       }
    }
  }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)