2
votes

I have a task which I would like to run after the completion of any of my release pipelines. The release pipelines need to complete their run and finish completely. Then this final pipeline should run and be passed the artefact from the build and release pipeline.

Is there a way to run a task or pipeline after a release pipeline has completed?

I need to run this task after the release pipeline has completed because the task I've written needs to request information from the DevOps REST API which will not return anything until the release pipeline has finished.

1
Have you tried setting up another job, does the rest api return values after job is completed? You could also implement azure function and add one step to invoke that function when release is completed. Then wait(?) in azure function and do your magic.Panu Oksala
Oh, ok. You are right that one place would be nice, but I have found that often it's not possible if you are doing anything bit more complex. In my blog is a short tutorial how to create custom integration with Azure DevOps (oksala.net). Check it out and hopefully it helps ya.Panu Oksala
at the end of the first pipeline, you can add a task that kicks off a new release pipeline, until the new pipeline will start the first will be finished.Shayki Abramczyk
You can also do it with Service Hook, do you know what is it?Shayki Abramczyk
There is already one answer, but if anyone has code to post in answers it would help anyone coming along here in the future.Matt W

1 Answers

2
votes

There is an extension in the Marketplace called "Trigger Build Task" (https://marketplace.visualstudio.com/items?itemName=benjhuser.tfs-extensions-build-tasks) that enables the chaining builds.

It allows your Release pipeline to complete and a separate Build pipeline is started on a different thread/process, so you should be able to query the information you need from that triggered Build.

enter image description here