2

Is it possible to have a single release pipeline with multiple artifacts that will trigger separate stages conditionally.

Example:

BuildPipelineA builds /PathA from AppRepo, Dev branch and publishes the artifact ArtifactA. ArtifactA should be deployed to stage A.

BuildPipelineB builds /PathB from AppRepo, Dev branch and publishes the artifact ArtifactB. ArtifactB should be deployed to stage B.

Both the artifacts are in one release pipeline and the problem I have is when I queue the build for BuildPipelineA, after the successful build, the release pipeline is created and ArtifactA is deployed to Stage A, Artifact B (last successful build artifact) is deployed to stage B.

Example Pipeline Image

What I am trying to achieve is, since BuildPipelineB is not triggered and no latest Artifact B is published, it should not be deployed to stage B when ArtifactA triggered the release and vice versa

torek
  • 448,244
  • 59
  • 642
  • 775
shasi
  • 21
  • 2

2 Answers2

1

What I am trying to achieve is, since BuildPipelineB is not triggered and no latest Artifact B is published, it should not be deployed to stage B when ArtifactA triggered the release and vice versa

Based on your description about the situation(same repo, same branch), I am afraid that there is no such built-in feature can directly meet your requirements.

For a workaround, you can set the condition in Stage -> Jobs.

You can use this variable to make judgments : RELEASE.TRIGGERINGARTIFACT.ALIAS.

It represents the artifact name that triggered the release.

Here is an example:

Release Stages:

enter image description here

Condition: eq(variables['RELEASE.TRIGGERINGARTIFACT.ALIAS'], '_PipelineA')

enter image description here

When the Pipeline A, trigger the Pipeline, it will run the agent job in Stage1 and it will skip the agent job in Stage2.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28
  • Thank you for your response Kevin. The above condition skips the deployment but displays the stage status as succeeded and executes the next sequence stage. – shasi Sep 10 '21 at 20:34
1

It is supported to have multiple artifacts in one CD and have only a specific artifact been deployed to one stage.

Azure Dev Ops

Here is photo, select from multiple artifacts which one you want to be included in deployment to azure resource.

chris_r
  • 2,039
  • 1
  • 22
  • 22