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

后端 未结 4 2106
再見小時候
再見小時候 2021-02-12 14:51

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 15:14

    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

提交回复
热议问题