Jenkins Beginner Tutorial | How to Parameterize job in Jenkins

Pradeep Gopalgowda
3 min readSep 24, 2018

--

In this tutorial you will learn on how to achieve build with parameters in Jenkins job.

Lets get started!

First step is to download the Jenkins Generic Java Package (.war)

Download Jenkins

Navigate to downloaded path and execute the below command to start Jenkins.

java -jar jenkins.war — httpPort=9191

As I have defined the httpPort as 9191 so the Jenkins will start on port number 9191 else it will start on default port. During Jenkins initial setup password will be displayed and it is required during Jenkins installation.

************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

32bc5ce36144******************

This may also be found at: /Users/pradeepgopalgowda/.jenkins/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

Getting Started

As there is no plugin required you can skip the pugin setup and login as admin to create a new job

Jenkins Home Page

Click on create new jobs and create the freestyle project

Check the box “This project is parameterized” in configure page.

Configure

Click on Add Parameter drop-down and select String Parameter

Add Parameter

Fill in the name, default value and description

String Parameter

Click on Add Parameter drop-down and select Choice Parameter. Fill in name, default value and description

Choice Parameter

Click on add build step under Build tab and select “Execute Shell” and print the parameterize name to verify

Print Parameterize Name

Click on save and click on Build with Parameters. Select env to initiate the build

Build with Parameters

Check out the Console output to verify the values we are printing.

Yahooo! You have completed the tutorial. Check out my published articles in Medium to know more about Jenkins and Devops :)

--

--

No responses yet