From the course: Learning Jenkins: Automating Software Development and System Administration

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Boolean parameters

Boolean parameters

- [Instructor] Let's configure a job that uses a Boolean parameter. In a new project, start by checking the box next to This Job is Parameterized and selecting Boolean Parameter. I'll give it the name RUN_TESTS. This will add a checkbox parameter to the build interface. For Boolean parameters, the default value lets us pick which value is the default. If the box is checked, then the default will be set to true. If it's unchecked, it'll be set to false. I'll leave the box unchecked for now. For the description, I'll add, "Check this box to run tests before deployment." Now, let's add a build step that uses this parameter. I'm running Jenkins on a Docker system, and I'll be using a shell step. If you're running Jenkins on a Windows system, use a batch command step. Let's go to the exercise files to get the script for this example. I'm using the script for Docker. If you're on a Windows system, you'll want to use the script just for Windows. And I'll paste the script into the Execute…

Contents