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

后端 未结 4 2123
再見小時候
再見小時候 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条回答
  •  猫巷女王i
    2021-02-12 15:09

    I found a solution by experimentation so want to share it:

    node {
      properties(
        [
            parameters(
                [string(defaultValue: '/data', name: 'Directory'),
                 string(defaultValue: 'Dev', name: 'DEPLOY_ENV')]
                )
    
        ]
        )    
    
      ....
    }
    

提交回复
热议问题