Search

29 August, 2018

Setting your first Jenkins project.

Setup Jenkins on your local PC in minutes


Since you are here, I am assuming that you are trying to find out ,  how to start with Jenkins and you have no clue about it . If it's true, then you are in the best place possible .

This is a blog on Jenkins setup for those guys who have absolutely no idea what to do or where to start.

What is Jenkins?

In short, it is a Build Tool. Also called Continuous integration or CI Server. Most common usage is "Build Automation" . Build Automation is the process of creation of a software build. It includes processes in the order like:

Step 1:  Compiling Source code into binary code.
Step 2:  Packaging binary code.
Step 3:  Running automated tests.

What are we going to cover:

1.     Install Jenkins locally.
2.     Create a free run Project.
3.     Configure it to run a windows shell command.
4.     Display Hello World message using shell command on the console window of Jenkins.

STEP1:

Download the Jenkins setup file . It's a zip file . Something like this. jenkins-1.597.zip
Version might change so get the latest from here for windows:


STEP2:

Keep the zip file anywhere in your system and unzip it using any zip tool.
Inside you should find 2 files.
1.     jenkins-1.597
2.     setup.exe

STEP3:

Run the .exe file by double clicking it.Complete the installation. Under program files, Jenkins will be installed by default.
C:\Program Files (x86)\Jenkins

STEP4:

Launch the following URL on your browser:

localhost:8080

It should look like this.




STEP 5:

Click on the Create new jobs link or New Item (left hand side, top option) to create a new project.


Choose Freestyle project to create a simple project right now.

STEP 6:

Next you will be lead to project configuration page. Give a description to your project if you want.
Scroll down until you see a heading called “Build”.

Click on the drop down under it called “Add build setup”.

Select “Execute Shell” . Inside the box, type "echo Hello World" (For windows machine, choose Windows batch command)

 Click on the SAVE button at the bottom of the page.


STEP 7:

Note : Try Step 8 directly if you want...If you get java installation errors, follow step 7...then step 8

  • Now revisit home page of Jenkins i.e  localhost:8000 and select “Manage Jenkins”
  • Click on Configure Systems

Link to System Configuration on the "Manage Jenkins" page

·         Delete all JDK installations by clicking on  “Delete Installer”
       ·         Scroll at the bottom and click “Save” .
       ·         Return to Jenkins Home Page (localhost:8080)

SET UP is DONE :). Now let’s run our Project.


  • ·         Click on your project you just created.
  • ·         Click on “Build Now” link (on the left hand side).
  • ·         Watch the progress bar under “Build history”. When it stops on a constant color, it means, the build is complete.
  • ·         Click on the drop down beside the build number (1) under “Build History” and select “console output”.

Console Output link under the Id of the build number.


  • You will be directed to the Console Output page, which shows the results and details of the build .A SUCCESS means the build was successful and that's denoted by the BLUE ball.
Final Results as seen on the Console Output Page

No comments:

Post a Comment