Parameterized Builds
Sometimes, it is useful/necessary to have your builds take several "parameters." Consider the following use case:
- You set up a test job on Jenkins, and it accepts a distribution bundle as a parameter and perform tests against it. You want to have developers do local builds and let them submit builds for test execution on Jenkins. In such a case, your parameter is a zip file that contains a distribution.
- Your test suite takes so much time to run that in normal execution you can't afford to run the entire test cycle. So you want to control the portion of the test to be executed. In such a case, your parameter is perhaps a string token that indicates that test suite to be run.
These parameters are available as environment parameters. For example like we use the variables in a Shell script. Here we will have two parameters to be specified which are
1. Name
2. Default Value
If we are using any Shell script for our build and we have some variables need to be specified as arguments for the script then we need to keep the calling name of the variable as "Name" for the build and if we need to use default values for that we can specify those in the "Default Value" column. Or else we need to provide the value while running a build. Those values will be directly assigned to the variable parameters which will be used in the script.
For having our project to use parameters we need to do the following.
After the Project name and Description we'll have a check box "This build is parameterized". We need to check that box enabled to run parameterized builds. Now we need to provide the name and default value to be used within the project.
No comments :
Post a Comment