Recently I wanted to set up a Jenkins job in such a way that,
- It is required to list the current Git branch list in the Job page
- Allow the user to specify a branch from the list
- Capture the selection as an input
- Checkout the code from the selected branch
- Build the code
However the required parameterized build job is pretty straight forward unless the point 3. After quick research, I noticed that there is no proper pre-defined environment variable to be used here, so we have to look for a user defined variable to capture the user input.
Here is the method I used to achieve this,
No comments:
Post a Comment