In this article,we will see How to Create Job From Existing Job.
Steps to Follow
- Logging to Jenkins.
- Create a Item/Job in Jenkins.
- Build job “kt-thirdjob”.
- Verify console output of job “kt-thirdjob”.
- Verify job “kt-thirdjob” in backend (Jenkins software location).
- Verify job “kt-thirdjob” in workspace.
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 Item/Job in Jenkins
Click on New Item to create a new job.
Enter an Item name “kt-secondjob” and select “Freestyle project” and click on OK.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/1-1.png)
Provide Item name “kt-secondjob” and existing job (firstjob) “kt-first” and click on OK.
Note
It will copied all setting which are there in existing job to new job.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/2-1.png)
We can see windows batch command (It was coped from existing job “kt-firstjob”) and click on save.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/3-1.png)
3. Build job “kt-thirdjob”
Click on Build Now.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/4-1.png)
We can see blue color which means the job is build successfully.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/5-1.png)
4. Verify console output of job “kt-thirdjob”
Go inside the red ball for seeing the console output.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/5-1.png)
We can see the console out with build success message.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/6-1.png)
We can see the third job “kt-thirdjob” in the ,main dash board of Jenkins page.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/9-1.png)
5. Verify job “kt-thirdjob” in backend (Jenkins software location)
Go inside “C:\Program Files (x86)\Jenkins\jobs”.
Here,we can see the first job “kt-thirdjob”.
The actual process happens here only.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/8-1.png)
6. Verify job “kt-thirdjob” in workspace
The command is executed inside the first job(C:\Program Files (x86)\Jenkins\workspace\kt-thirdjob)
we can see “kt-thirdjob” is the workspace for the job.
The work is being carried out in that folder.
![](https://www.ktexperts.com/wp-content/uploads/2020/02/8-2.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