Pipeline 定义 Parameter 显示在Jenkins 构建中

Pipeline 定义 Parameter 显示在Jenkins 构建中

Pipeline 中通过 parameters 定义参数,代码如下

pipeline {
   
    
    
    agent any
	
    // 自定义参数,在Jenkins 中显示
	parameters {
   
    
    
	    // 定义 string 类型参数
		string(name: 'PARAM_NAME', defaultValue: 'default_value', description: 'This is a string parameter')
		
		// 定义 boolean 类型参数
		booleanParam(name: 'ENABLE_FEATURE', defaultValue: false, description: 'Enable the feature')

        // 定义选择类型参数		
		choice

猜你喜欢

转载自blog.csdn.net/LIQIANGEASTSUN/article/details/145683548
今日推荐