Jenkins Beginner Tutorial | How to Parameterize job in Jenkins
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)
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
*************************************************************
*************************************************************
*************************************************************
As there is no plugin required you can skip the pugin setup and login as admin to create a new job
Click on create new jobs and create the freestyle project
Check the box “This project is parameterized” in configure page.
Click on Add Parameter drop-down and select String Parameter
Fill in the name, default value and description
Click on Add Parameter drop-down and select Choice Parameter. Fill in name, default value and description
Click on add build step under Build tab and select “Execute Shell” and print the parameterize name to verify
Click on save and click on Build with Parameters. Select env to initiate the build
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 :)