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

后端 未结 4 623
情深已故
情深已故 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 15:07

    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')]
                )
    
        ]
        )    
    
      ....
    }
    

提交回复
热议问题