1

So I have a application split in 4 different repositories which all have their own Azure Pipeline build. But the artifacts of these 4 builds are deployed in one release (into one application).

On a check-in (pull request merge) on our development branch in one of the repos, a build for that repo is started. When this build completes, a release is triggered with the newly finished build artifact + 3 older artifacts based on the "Latest from the build pipeline default branch with tags" from the other repos. So always the latest builds from the development (dev) branch.

Now we want to also deploy an environment for every pull request that is created in the different repos, so our business can test a pull request.

I have the release pipeline done (the actual deploying of the environment), but not sure how to select the artifacts correctly. After a build on a pull request branch, I need to start a release with the pull request artifacts from that triggering build + the latest dev branch artifacts from the other 3 builds.

Manually I can start a new release, by default it selects all the dev artifacts, but by hand I can select the correct artifacts for the PR branch and start a correct deployment. But I want to automate (trigger) this.

How can I configure this automated trigger? Could I use tags? Or am I thinking about this in a wrong way?

Edit

I ended up setting this up by using 4 different stages which have different artifact filters. A stage for each artifact. For that artifact we allow dev_* and all other artifacts need to be from dev_. That way the correct stage is triggered for each artifact trigger, selecting the feature branch and dev branch for others.

It is not the ideal solution, because it does require some duplication of code, but by using Task Groups I have been able to minimize this. But for now I don't see a better solution. 3 stages in Azure pipelines

Erik Steinebach
  • 367
  • 2
  • 14
  • You can use "Latest from specific branch" and choose the PR branch. – Shayki Abramczyk Apr 21 '19 at 07:18
  • 1
    Exactly, when I do it manually I can. But is there a way to do this automatically? After a build, start a release with the specific branch artifact for that build and the development branch artifacts for the other builds – Erik Steinebach Apr 22 '19 at 11:51
  • @ErikSteinebach. I had this exact problem last week, but couldn't make much headway, even with a #LoWCDA tweet (https://twitter.com/samsmithnz/status/1121388553001492481). I eventually combined my builds into one - not ideal, but worked for me. I'm still interested in a real solution, but thought it was useful to share my workstream. – Sam May 03 '19 at 17:58
  • For this, I will have made two distinct release pipelines. – vernou Aug 09 '22 at 07:39

0 Answers0