How to Create Job From Existing Job

Share via:

In this article,we will see How to Create Job From Existing Job.

Steps to Follow

  1. Logging to Jenkins.
  2. Create a Item/Job in Jenkins.
  3. Build job “kt-thirdjob”.
  4. Verify console output of job “kt-thirdjob”.
  5. Verify job “kt-thirdjob” in backend (Jenkins software location).
  6. 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

We can see the Main Dashboard of Jenkins.

This image has an empty alt attribute; its file name is 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.

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

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Add Comment