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 - Jenkins Tutorial
From the course: Learning Jenkins: Automating Software Development and System Administration
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
-
-
-
-
-
(Locked)
Using a global build tool4m 23s
-
(Locked)
Browse a job's workspace1m 45s
-
(Locked)
Manage artifacts2m 19s
-
Parameters and environment variables1m 51s
-
(Locked)
String parameters1m 30s
-
(Locked)
Choice parameters1m 22s
-
(Locked)
Boolean parameters1m 57s
-
(Locked)
Schedule jobs4m 30s
-
(Locked)
Solution: Use a build tool and parameters4m 4s
-
(Locked)
-
-