Jenkins Build with Parameters Examples-DecodingDevOps

Jenkins Build with Parameters Examples-DecodingDevOps

Parameterized Build:

Sometimes, it is required and useful to build the project with several parameters. In order to pass the parameters before build starts, we have a pipeline in jenkins where parameters can be passed to meet the requirements. To make a parameterized pipeline, we can select first the freestyle project and name the pipeline of our choice. Here we have mentioned parameterized-build-example.

 

Then, in the 2nd step we can select the option Add parameters, which enable us to input the parameters we wanted to add during the pipeline.
There are different kinds of build with parameters as we can see in the image below.

  • Boolean parameter
  • Choice parameter
  • File parameter
  • multiline string parameter
  • Password parameter
  • Run parameter
  • string parameter and many more parameters.

 

 

According to the requirements we can select parameters and enter the values we required to make the successful builds of the project.

 

 

After successfully entering the parameter, we can go onto the CONSOLE and make the build of the project as shown in the image below. We need to right click on the project name and select the option build with parameters.

 

If the parameters and correctly passed and code gets build without any error then we can see the output successfully build in the output console of the jenkins pipeline. As shown in the images below.

 

 

 

That’s how parameterized build works.

  • jenkins build with parameters examples
  • jenkins parameters with build
  • build with parameters in jenkins job example
  • build with parameters job in jenkins example.

Leave a Reply

Your email address will not be published. Required fields are marked *