In this blog post, we’ll learn how to create a very basic job in the Jenkins. First, login to jenkins with your credentials. From left pane, select new item.
If you are unable to see this icon, it means that you don’t have sufficient privileges. In the next window, type the name of the job such as first job and select job type as free style job and then click ok:
In the next window, we’ll leave default options unchanged. Move to build tab and select add build step:
This list may vary a lot depending upon the plugins installed for Jenkins environment. For now, since this is a very basic job, we’ll just select ‘Execute shell’ and enter following command:
If you have installed jenkins on a window machine, select ‘Execute windows batch command’ from the list, and then enter this command in the build step:
and click save. Once it’s done, click build now from left pane of the job:
Once you click, in the left pane only, under build history, you would notice that a new line with a number pops up along with a progress bar on it like this:
This means that, we have started first build for our job. Once the job is completed successfully, the icon ball color will turn from grey to blue and progress bar will go away. This build number keeps increment every time with the project build. Again, it can be customized to your choice. Once the build is complete, you would notice the time of build completion in front of build no. Along with it, there is a small black triangle which can be used to see various details with the build:
For now, we’ll click on the console output so that we can see logs generated for this build. It should be something like below:
In the ouput, we can see various useful details such as who started the build, what is the workspace for the build, what was the command executed by hudson for the build along with the project name, and offcourse, output related to our commands. In the last, we would also see the overall status of job as successfully completed or not.