In this article,we will see How to Create and Troubleshoot Job in Jenkins.
Steps to Follow
- Logging to Jenkins.
- Create a Second Item/Job in Jenkins.
- Verify the job “kt-firstjob” in the jenkins dashboard.
- Build second job “kt-secondjob”.
- Verify console out put of Job “kt-secondjob”.
- Troubleshoot job “kt-secondjob”.
- Build job “kt-secondjob”.
- Verify console out put of Job “kt-secondjob”.
First,we need to go Jenkins Logging page by using below link.
http://localhost:8080/
1. Logging to Jenkins
Provide username and password and click on Sign in.
![This image has an empty alt attribute; its file name is 1-26.png](https://www.ktexperts.com/wp-content/uploads/2020/01/1-26.png)
We can see the Main Dashboard of Jenkins.
![This image has an empty alt attribute; its file name is 2-19.png](https://www.ktexperts.com/wp-content/uploads/2020/01/2-19.png)
2. Create a Second Item/Job in Jenkins
Click on New Item to create a new job.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/1.png)
Enter an Item name “kt-secondjob” and select “Freestyle project” and click on OK.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/2.png)
If you want run windows command we need to select “Execute Windows batch command” from below list.
![This image has an empty alt attribute; its file name is ktexperts-3.png](https://www.ktexperts.com/wp-content/uploads/2020/01/ktexperts-3.png)
Here,I am intentionally giving wrong command,It is not proper window batch command and click on Save.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/3.png)
3. Verify the job “kt-firstjob” in the jenkins dashboard
Click on Jenkins.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/4.png)
We can see the job “kt-firstjob” which was created earlier.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/5.png)
4. Build second job “kt-secondjob”
Go to second job “kt-secondjob” and right click and select build now option from list.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/6.png)
We can see the job is in red color which means the job “kt-firstjob” is failed.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/7.png)
5. Verify console out put of Job “kt-secondjob”
Go inside the job by clicking on job “kt-secondjob”.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/8.png)
Go inside the red ball for seeing the console output.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/9.png)
We can see the console out with failed message.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/10.png)
6. Troubleshoot job “kt-secondjob”
Click on Back to Project.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/11.png)
Click on configure.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/12.png)
Enter proper command (correct command) in the command field and click on save.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/13.png)
7. Build job “kt-secondjob”
Click on Build Now.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/14.png)
We can see the job is in blue color which means the job “kt-secondjob” is build successfully.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/15.png)
8. Verify console out put of Job “kt-secondjob”
click on blue ball to see the console output.
![This image has an empty alt attribute; its file name is 15.png](https://www.ktexperts.com/wp-content/uploads/2020/02/15.png)
We can see the console out with build success message.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/16.png)
Thank you for giving your valuable time to read the above information.
Follow us on
Website : www.ktexperts.com
Facebook Page : KTexperts
Linkedin Page : KT EXPERTS