How can I use the Jenkins Dynamic Plugin in a Jenkinsfile?
What I am looking for is a Jenkinsfile snippet that:
- Enables the
Build with Parametersoption in the Jenkins job - When selected, a script that populates a list that can be used
Dynamic Choice Parametersis populated and the user will see a drop down list.
When trying:
Pipeline syntaxin the Jenkins editor- Selecting
properties: Set job propertiesasSample step - Selecting
This project is parameterized - Using
Dynamic Choice Parameter - Enter values for
Name,Choice Script,Remote Scriptetc Generate Pipeline Script
I get the following template:
properties([ parameters([ <object of type com.seitenbau.jenkins.plugins.dynamicparameter.ChoiceParameterDefinition> ]), pipelineTriggers([]) ]) i.e. the generated pipeline script does not contain the data that I have entered in step 5. above. How can I modify parameters so that parameter name, choices, etc will be visible to the user?
Jenkins version: 2.19.3 Dynamic Parameter Plugin version: 0.2.0