a blog for those who code

Tuesday 23 December 2014

Create your first job in Jenkins - Part 1

In our previous post Getting started with Jenkins for .Net developers we have gone through the introduction of Jenkins. In this post we will show you how to create your first job in jenkins for .Net developers.
After installing, Jenkins can be started in your system from http://localhost:8080/. Jobs are created using the main menu on the Jenkins home page.

When you click on New Item you will get a number of option to start with like freestyle project, build a maven project, build multi-configuration project, monitor an external job and copy existing item. We will start with Freestyle project (This is the central feature of Jenkins. Jenkins will build your project, combining any SCM with any build system, and this can be even used for something other than software build).

As you can see in the above diagram you have a number of Option. We will go through some of the option which are important for us in day to day life when using Jenkins as CI.

1. Discard Old Builds

Jenkins give you an option to delete record automatically if it reaches a certain age or if your build number exceeds a N records. Jenkins also allows you to mark an individual build as "Keep this log foreever", to exclude certain important builds from being discarded automatically.

2. This build is parameterized

Sometimes its always better to parametrize a build, which will only build if it met certain condition. Suppose you have builded a TEST SERVER job and now you want to build a RELEASE job, so you can specify the promotion level of Test SERVER as it is Approved or not.

3. Permission to Copy Artifact

It allows a list of project to copy artifacts of this project. Artifact in the Jenkins means the result of a build - i.e. the intended output of the build process.

4. Promote build when...

It allows you differentiate good builds from bad builds. It consists of three things and that are Name, Criteria and Actions.

5. Disable Build

If you want to temporarily stop building a project then you can check this option. When this option is set, no new build is performed on this project.

6. Execute concurrent builds if necessary

This is useful on builds which takes long time, as using this option each build will only contain smaller number of changes thus decreases time taken to build the solution.

In our next post we will continue our discussion and see some advanced option on Creating your first job in Jenkins. Please Like and Share the Blog, if you find it interesting and helpful.

No comments:

Post a Comment