Jenkins
has the Gerrit
Plugin in place so that when we do check-ins to Gerrit
, Jenkins
performs a build and if it succeed
Create a new Item and go to the last you'll find option to copy from existing, just write your current job name and you will have clone of that project to work with.
All above answers are good. But if you have created "folders" for your jobs, things are slightly different.
Click on the folder under which you want to create a new job. Then click "New Item" on the left menu. Now your "new job" URL will look like this (assuming you are creating the new job under "my-folder"):
http://my-jenkins:8080/job/my-folder/newJob
Under Enter an item name
, enter your desired new job name.
Then use the Copy from
text box at the bottom. Enter job path of he source job.
E.g. If your source job is under folder src-folder
and name of the job is src-job
, you will have to enter src-folder/src-job
in "Copy from" box.
Hope it helps.
You can also use the Copy project link plugin.
This will add a link on the left side panel of your project:
Following screen will ask for the new Job name:
I was not able to copy Jenkins job from subfolder. copy from
option did not show the suggestion which i was looking for.Without using suggestion copying the job name didn't work.
So if you want to create a job from outer folder, you need to first create the job in subfolder and then move it in different folder where you need to place it.
You can clone a job:
Finally, you have your new job, which reflects all features of your cloned one.
Jenkins > New Item
Enter an item name - E.g. "MY_CLONE"
Specify the source (Copy from) job > OK
When you start typing the name, the existing values will be found. Notice that this is case sensitive.
Click on Save if you want to keep the default values.
Now both jobs are available in the same location: