Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple YAML build pipelines in Azure DevOps

I'm currently trying to create multiple build pipelines for my Angular app in Azure DevOps using the new YAML way. I used to create a new build pipeline for the different environments I've set up (dev, staging, prod) when I was using the "legacy" visual builder.

But since I've switched to YAML-style build definitions everytime I try to create a new pipeline I get redirected to the existing azure-pipelines.yml. As far as I can tell from the docs it is not possible to define multiple pipelines in a single .yml file either.

Is this scenario currently not supported in Azure DevOps?

like image 511
Thomas Avatar asked Dec 13 '18 17:12

Thomas


People also ask

How do I create multiple pipelines in Azure?

Create the pipelineSign in to your Azure DevOps organization and navigate to your project. In your project, go to the Pipelines page, and then select New pipeline. Select GitHub as the location of your source code. For Repository, select Authorize and then Authorize with OAuth.

Can we have multiple YAML files?

Multiple YAML documents in a single file So in YAML, you can actually write multiple documents in a single file and the YAML compiler interprets them as multiple files. Here's how this works. In the above example, the three dashes --- mark the separation between two YAML documents.


1 Answers

@4c74356b41's answer was correct, but now you can create as many build configurations using different yaml files and also with continuous integration without creating manual builds.

On the new pipeline flow follow these steps:

1. Choose where is your code:

step1

2. Select the repository of your code (the one which has the yml file):

step2

3. On the configure pipeline, choose Existing Azure Pipelines YAML file:

step3

4. Select the branch and the path where the yaml file is, then continue: Note: If it's not shown make sure your file has .yml extension

step4

5. Finally click RUN.

Note: After creating the pipeline this way, it will have continuous integration activated, but if you still want to have manual building follow the next:

Select your build and then Triggers:

step5

And then disable continuous integration:

step6

Or even easier, just add triger: none to your yaml file.

like image 157
David Noreña Avatar answered Oct 03 '22 20:10

David Noreña