简体   繁体   English

如何在 Jenkins 中使用选择参数触发构建

[英]How to trigger build using choice parameters in Jenkins

I have a job which has multiple choice parameters which includes some testng.xmls of my project.我有一份有多个选择参数的工作,其中包括我的项目的一些 testng.xmls。 I want to build those xmls in a specific order using choice parameters.我想使用选择参数以特定顺序构建这些 xml。 Will there be a way to achieve my requirement using Jenkins without Build the xmls one by one.有没有一种方法可以使用Jenkins来实现我的要求,而无需逐个构建xml。

在此处输入图片说明

Instead of using Choice Parameters, you can use Active Choice Parameter to select the multiple xmls of your choice.您可以使用Active Choice Parameter来选择您选择的多个 xml,而不是使用选择参数。

Example Jenkins Job Configuration: Jenkins 作业配置示例:

在此处输入图片说明

在此处输入图片说明

Simple pipeline script:简单的管道脚本:

pipeline {
   agent any

   stages {
      stage('Checkout SCM ') {
         steps {
             echo "${params.TestSuite}"
            
         }
      }
   }
}

Output:输出:

在此处输入图片说明

在此处输入图片说明

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

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