How to use multiple build definitions in single yaml pipeline

535 views Asked by At

We are planning to implement yaml pipelines in our environment. I can manage adding jobs and tasks by doing some research. But dont know the better way to design according to my environment.

We are now maintaining classic pipelines for 8 to 10 modules. For each module we have one build pipeline. And for releases we have release pipelines based on environment like one pipeline for both dev and qa environment, one for both staging and preprod, and one for prod.

Can someone help me how to prepare yaml pipelines for this requirement?

Thanks!

1

There are 1 answers

0
PatrickLu-MSFT On

You can create as many build configurations using different yaml files and also with continuous integration

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.

Details please refer answer in this link: Multiple YAML build pipelines in Azure DevOps


If your multiple definitions are similar, you could use Template types & usage in YAML pipeline.

  • Templates let you define reusable content, logic, and parameters. Templates function in two ways. You can insert reusable content with a template or you can use a template to control what is allowed in a pipeline.
  • If a template is used to include content, it functions like an include directive in many programming languages. Content from one file is inserted into another file. When a template controls what is allowed in a pipeline, the template defines logic that another file must follow.