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.
We can see the Main Dashboard of Jenkins.
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.
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.
We can see windows batch command (It was coped from existing job “kt-firstjob”) and click on save.
3. Build job “kt-thirdjob”
Click on Build Now.
We can see blue color which means the job is build successfully.
4. Verify console output of job “kt-thirdjob”
Go inside the red ball for seeing the console output.
We can see the console out with build success message.
We can see the third job “kt-thirdjob” in the ,main dash board of Jenkins page.
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.
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.
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