Thomas
Thomas

Reputation: 4297

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?

Upvotes: 80

Views: 63021

Answers (3)

David Noreña
David Noreña

Reputation: 4230

@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 the line trigger: none to your yaml file.

Upvotes: 65

james.garriss
james.garriss

Reputation: 13406

The process has changed. As of June 2020, the steps are:

Step 1 - From Pipelines, click New Pipeline:

enter image description here

Step 2 - After selecting your source, your repo, and the default pipeline type, rename the pipeline YAML file by clicking here:

enter image description here

Step 3 - Rename the pipeline by clicking rename/move:

enter image description here

Upvotes: 15

4c74356b41
4c74356b41

Reputation: 72191

It is supported. azure-pipelines.yml is being auto-picked up by VSTS, you can create as many yaml files and create builds manually for those. that's the only difference.

so you need to manually create builds for different envs using different yaml files.

enter image description here

on the build steps selection pick this:

enter image description here

Upvotes: 44

Related Questions