Kart
Kart

Reputation: 83

How to create a single yaml release pipeline for multiple build artifacts

We have seperate build definitions for each module which generates artifacts. Could someone help me how to create a common yaml release pipeline for all the build definitions

Thanks!

Upvotes: 0

Views: 1033

Answers (1)

WaitingForGuacamole
WaitingForGuacamole

Reputation: 4301

There's not a lot of detail to the request, but in very general terms, if I were building a multi-artifact release, I would take this approach:

  1. Choose (or create) a repo that you will use for release pipelines (I have a repo for common Azure DevOps pipelines work, I might create a folder under than, or you could create your own repo).
  2. Within the repo you've chosen, create a YAML file to hold your release definition.
  3. Declare pipeline artifacts as resources to the new pipeline using the following syntax (from learn.microsoft.com) - use one - pipeline reference for each build artifact contributing to the release:
resources:        # types: pipelines | builds | repositories | containers | packages
  pipelines:
  - pipeline: string  # identifier for the resource used in pipeline resource variables
    project: string # project for the source; optional for current project
    source: string  # name of the pipeline that produces an artifact
    version: string  # the pipeline run number to pick the artifact, defaults to latest pipeline successful across all stages; Used only for manual or scheduled triggers
    branch: string  # branch to pick the artifact, optional; defaults to all branches; Used only for manual or scheduled triggers
    tags: [ string ] # list of tags required on the pipeline to pickup default artifacts, optional; Used only for manual or scheduled triggers
    trigger:     # triggers aren't enabled by default unless you add trigger section to the resource
      branches:  # branch conditions to filter the events, optional; Defaults to all branches.
        include: [ string ]  # branches to consider the trigger events, optional; Defaults to all branches.
        exclude: [ string ]  # branches to discard the trigger events, optional; Defaults to none.
      tags: [ string ]  # list of tags to evaluate for trigger event, optional
      stages: [ string ] # list of stages to evaluate for trigger event, optional
  1. Build out the rest of your deployment pipeline
  2. In the Azure Pipelines portal, create a new pipeline, and choose your pipeline YAML file from the repo in which you placed it.

Upvotes: 1

Related Questions