Reputation: 293
I had around 30 pipelines (each doing its own build, deploy, tests) , all in same project.
Instead of having to manually trigger all 30 pipelines each time, I wanted to create a separate pipeline YAML which on running it can trigger all the 30 individual pipelines.
Is there a way to achieve this?
I understand from documentation there is concept to add the pipeline triggers. However, I was not able to understand if single yaml can trigger individual pipelines - and if so, whether it is getting triggered at the completion of the pipeline or at the start of it.
Flow I was looking for is -
There are 30 individual pipelines each having complete flow for services:
stages:
stageA
stageB
stageC
Now, I was trying to create a pipeline yaml all_apps.yml
which triggers all the 30 individual pipelines at once.
Upvotes: 0
Views: 2344
Reputation: 76910
Configure pipeline to trigger multiple pipelines
There are several ways to accomplish it, you can choose the one that suits you.
First, we could set the Build completion for those 30 pipelines:
Go the edit page of the triggered yaml pipeline(Deploy pipeline), Click the 3dots and choose Triggers :
Go to Triggers--> Build completion and click add--> Select your triggering pipeline(all_apps.yml
pipeline):
Second, there is an extension Trigger Azure DevOps Pipeline, we could use this task to trigger those 30 pipelines.
Third, you could it with both the Runs API and Build Queue API, both work with Personal Access Tokens. You can also use loops to make REST API calls more graceful. Check this thread for some more details.
Upvotes: 1