Is it possible to make a parameterized scripted pipeline in Jenkins by listing the parameters in actual script, not in job config

后端 未结 4 634
情深已故
情深已故 2021-02-12 14:49

In a declarative pipeline, I can specify the parameter that the pipeline expects right in the pipeline script like so:

pipeline {
   parameters([
    string(name         


        
4条回答
  •  悲哀的现实
    2021-02-12 14:59

    I did create it outside and it worked! Also, I'm using the boolean value and it's working like a charm on a scripted version

    // Parameters for the build
    properties([
      parameters([
         booleanParam(name: 'DEPLOY_SHA', defaultValue: false),
      ])
    ])
    
    podTemplate(name: ptNameVersion, label: ptNameVersion, containers: [
    ...
    ...
    ] 
    

    It shows the parameter

    Screen Shot 2019-03-29 at 4 37 29 PM

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题