0

My problem is almost same as this question. However, I don't really get the comments or the solutions proposed there.

Say I have two artifacts: A1 and A2.

A1---> Dev stage
A2---> UAT stage.

What I want is that when A1 is released, only Dev stage is deployed. But at the moment, when A1 is rleased, Dev and UAT are triggered.

looking at the comments from previous question,

  1. how can $(RELEASE.TRIGGERINGARTIFACT.ALIAS) be used as a trigger condition? Looking at filter, I can't see a place to put custom condition

  2. If I create a third artifact as suggested, how can I set different tag base on if A1 or A2 is built?

  3. If there other ways to solve this?

daxu
  • 3,514
  • 5
  • 38
  • 76

2 Answers2

3

Say I have two artifacts: A1 and A2.

Open Dev stage ->click Agent job->expand Additional options and select Custom condition using variable expressions-> add the condition eq(variables['RELEASE.TRIGGERINGARTIFACT.ALIAS'], 'A1'). The Dev stage only runs when the value of RELEASE.TRIGGERINGARTIFACT.ALIAS is A1, otherwise this stage will be skipped.

The same configuration in UAT stage, the condition is eq(variables['RELEASE.TRIGGERINGARTIFACT.ALIAS'], 'A2')

enter image description here

In my release pipeline, I update the Artifact _test to trigger this release pipeline and the variable RELEASE_TRIGGERINGARTIFACT_ALIAS is _test, it runs Stage 1 and skip Stage 2

enter image description here

Vito Liu
  • 7,525
  • 1
  • 8
  • 17
0

This might not be the exact answer, but it still can work as a solution to your problem.

You can tag your builds depending on the produced artifact name. If the build produces artifact A1, add a tag A1 to it. That way you can set up release stage conditions based on artifact filters like this:

enter image description here

For the Dev stage trigger, filter build tags by A1 and for the UAT trigger, filter by A2.

LJ.
  • 620
  • 6
  • 12