Creating and Configuring the builds in Jenkins

Now let us understand how to create and configure a typical build in Jenkins.

To create new build (also called as job), click on New Item link on Jenkins Home page. It will open below page.

New Jenkins Build project

New Jenkins Build project

Then enter name of project, select freestyle project option and click on OK. It will open Build configuration page as shown below. Enter project description and add parameter if you want pass any parameter to the build.

Build configuration in Jenkins - Build name, decription, parameters

Build configuration in Jenkins – Build name, description, parameters

Next you need to configure the SCM like git as shown in below image. In this example, we are using repository on GITHUB. But you can use any other version control software.

git - Source code management in Jenkins build

git – Source code management in Jenkins build

Next – you have to specify the build triggers. You can specify the trigger in the form of Cron expressions. You can also poll SCM at regular intervals and if changes are detected, build will be run.

Build triggers in Jenkins

Build triggers in Jenkins

Your job/project is made up of multiple build steps. So you can add build steps as shown in below image. Note that you will not see all build steps as shown in below image unless you have installed proper plugins. For examples – MSBuild step will not be available unless you install MSBuild plugin in Jenkins.

Build steps in Jenkins

Build steps in Jenkins

maven build step in Jenkins

maven build step in Jenkins

Last thing you need to do is configure post-build actions. Below image shows possible post-build actions that you can do.

post-build actions in Jenkins

post-build actions in Jenkins

Above step is optional. So just go ahead and click on Save button. Well done! You have just created a sample build in Jenkins. To view your build project, just go to homepage. You will see your build(Highlighted in yellow color) as shown in below image.

Jenkins build on Dashboard

Jenkins build on Dashboard

 

You may also like...