Thursday, January 4, 2018

How to start Jenkins (windows)

Installation of Jenkins


At first, install Java8 if you haven't installed it yet.

Now download Jenkins from here: https://jenkins-ci.org/
And start the installation of Jenkins.


On CMD, go to the directory where you installed Jenkins and start Jenkins:
cd "C:\Program Files (x86)\Jenkins"
java -jar jenkins.war

Now, on a browser, go to "http://localhost:8080" and write your password. The password should be at:
C:\Program Files (x86)\Jenkins\secrets\initialAdminPassword

The following will be displayed. Click "Install suggested plugins":

Create an account of administrator. Now click "Start using Jenkins".





Create a job


Click on "create new jobs" or "New item".

Any name is ok for the name of job. Enter a name as you like. Click on "Freestyle project" and then "OK".


Then you will see the following.


Scroll down and look for "Build". Then click on "Add build step". Then, if you are using Windows, click on "Execute Windows batch command". If you are using Mac, click on "Execute shell".

And add this in the command:
echo "Hello jenkins!"



Now click on "Save".


Start the job


You will be redirected to the page of the project. Click on the "Build Now" to start the job.



After clicking "Build Now", you will see a result is added. Click the result added just now.

You will see the following. Click "Console Output":



This is the result of console. Blue symbol next to the "Console Output" means execution of the job was success. Red means failure. Yellow means unstable. The symbol is blue, so the job was executed successfully. Yay!! :)