Uncodemy Logo ← Back to Course
Jenkins · Topic 6 of 15

Jenkins Build Parameters

Managing Build History

Under Discard old builds, we can control how many builds Jenkins keeps:

To view build history directly on the server: cd /var/lib/jenkins → jobs → select job → builds. Logs live inside builds → 1 → log.

Parameter Types in Jenkins

TypeDescription
StringAny combination of characters & numbers
ChoiceA pre-defined set of values a user can pick from
CredentialsA pre-defined Jenkins credential
FileThe full path to a file on the file system
Multi-line stringSame as String but allows newline characters
PasswordSimilar to Credentials, but passes a plain text value
RunAn absolute URL to a single run of another job

To enable parameters on a job: go to Configure → check "This project is parameterized" and add the required parameter block.

1. Boolean Parameter

Used for true/false conditions. "Set by Default" checked = true, unchecked = false.

2. Choice Parameter

Used when there are multiple options (branches, files, folders, etc.) and only one needs to be picked per build.

Example: Job → Configure → Build Steps → Execute shell → touch $file, then define the choices (e.g. sandy, devops, aws) in the Choice Parameter block. On Build with Parameters, you select one value and it gets used in the shell command.

3. File Parameter

Used to build a local/computer file. You browse and select a single file at build time and Jenkins uses it in the job.

4. String Parameter

Used to pass a single-line input value that the build step consumes, e.g. echo "hi my name is $person".

5. Multi-line String Parameter

Works exactly like a String parameter, but allows multiple lines of text instead of a single line — useful in pipeline syntax.

Master Jenkins & DevOps with Uncodemy

Hands-on live training, real projects, and placement support — become job-ready in DevOps.

Enroll in DevOps Training →