Reputation: 7943
I want to take a build from one #DevOps project and put it on another project. I see how to export the build to JSON, but don't see a way to import it.
I have seen another SO question on how to do this for releases, but that didn't seem to help.
Upvotes: 1
Views: 1122
Reputation: 51173
This is impossible.
It's easy to get a build through API to a json file.
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}?api-version=5.0
However, it's not able to import this build back or to another pipeline. This is also not make sense.
As a workaround, suggest you directly clone the build pipeline and queue it again. Which may do the trick.
Upvotes: 0
Reputation: 419
Go to your build pipeline and edit the build. Then you can display the complete list of tasks for your agent jobs as YAML file.
Now save the YAML file as document of the type .yaml in your Code repo.
Then you can create a new build pipeline in DevOps and include your previously exported YAML file.
Upvotes: 1
Reputation: 8152
I had a very similar problem, i needed to export builds from TFS 2015 to TFS 2017. In order to achieve that i used this extension :
https://marketplace.visualstudio.com/items?itemName=onlyutkarsh.ExportImportBuildDefinition
I also wrote a script who export build from one project and import to other project automatically . Let me know if you want me to add this script as well.
Upvotes: 0
Reputation: 72191
Go to builds and select "+ New" and select "Import a pipeline" there:
Upvotes: 2