Reputation: 4899
I have a couple of CI pipelines that I'm using in Azure DevOps to build some Xamarin apps and I want to create a new one that merges the functionality of the two existing ones. Is there a way to copy or clone an existing pipeline so that I can make changes to the new pipeline without impacting the existing pipelines?
I saw that I can export a pipeline to a JSON file and then import it back in. All of the id values in the JSON file are GUID. Will the import process create new GUIDs or will importing the JSON file overwrite the existing pipeline.
Upvotes: 51
Views: 43555
Reputation: 9850
Update: As per Microsoft 07-05-2022
For YAML:
Go to pipeline details for your pipeline, and choose Edit.
Copy the pipeline YAML from the editor, and paste it into the YAML editor for your new pipeline.
For Classic:
Navigate to the pipeline details page for your pipeline. select Clone.
Upvotes: 4
Reputation: 124
So since Microsoft decided in all its wisdom to remove the "Clone" option from Yaml pipelines (because it would confuse users) I've decided to write a new extension with which you can clone Yaml pipeline definitions again. This might be needed since you can still use variables and triggers in the pipeline definition instead of the yaml file and we're using a lot of those for example. So to save you the hassle of having to rewrite everything manually, here's the Copy Pipeline Azure DevOps extension for Azure DevOps Server 2020+ or Azure DevOps Cloud:
https://marketplace.visualstudio.com/items?itemName=tun.ClonePipeline
have fun...
Upvotes: 2
Reputation: 3840
Click on Pipelines -> Click on your Pipeline -> then click the ellipse in the upper right corner (three vertical dots) then click Clone.
Upvotes: 41
Reputation: 51
If you want to use existing stage in another pipeline, do following.
Upvotes: 0
Reputation: 4500
I know it is too late but easy way around by official document.
Hope that would help some.
Upvotes: 2
Reputation: 1462
UPDATE February 11th, 2020
Not sure if this is a super-recent change, but you can now again easily clone an existing pipeline. From Pipelines, click on the pipeline you want to clone. On the page where the build history is shown, Clone has been moved to the ellipsis menu on this page.
Upvotes: 59
Reputation: 548
UPDATE Feb 2020
Clone is not available anymore. However you can create a new pipeline based on an existing yaml file which is basically cloning.
Pipelines -> New Pipeline -> Configure (3rd page of the wizard) -> Select "Existing Azure Pipelines YAML file"
There you can select the branch and the file you want to use.
Upvotes: 22