3

We have Pipelines which usually have the following stages:

  • Build (+ UnitTests)
  • Deploy to Dev
  • Deploy to Test
  • Deploy to Production

Additionally - on Test and Prod environments - the approvals are defined - so if PR is merged, it's being deployed to Dev only, and then manual approval is required to deploy to Test and so on.

We've many components (API A, API B, some background worker, and so on) and because we want to manage and deploy those components independently - all of them have their own pipeline defined (they all look very similar - as mentioned above).

It happens sometimes that one PR is affecting more than one component and then 2 or 3 or more pipelines are triggered in parallel.

We also have a set of E2E tests - which are validating if all components can work fine together.

When a single PR is merged and is affecting more than one component - we really don't want to trigger those E2E tests more than once. We just want to trigger it when all pipelines for all affected components deployed to specific environments. Because of that - we have separated Pipeline for those E2E tests.

The flow we'd like to achieve is:

  • PR is merged
  • Pipelines for components A, B, and C are triggered.
  • Pipelines for components A, B, and C had completed stage: "Deploy to DEV" and the next stage: "Deploy to TEST" is in state "Waiting"
  • Pipeline for E2E tests has started
  • Pipelines for components A, B, and C will run stage "Deploy to TEST" only if someone manually approves that (we have this right now) and Pipeline for E2E tests had finished successfully

Do you know how we can achieve the last condition?

JeloneK
  • 249
  • 2
  • 11

1 Answers1

3

You'll need to write a custom Powershell/Shell task into your pipeline that essentially polls for updates to check if your external E2E Testing pipeline is complete and completes the process when the E2E Tests are complete.

Here's a link to another answer that has an example of how to accomplish this:

However, with this method, you may run into issues with the job timing out if your E2E tests take a few hours to run. The default timeouts are:

  • 360 Minutes for self-hosted jobs
  • 60 Minutes for Microsoft-hosted jobs

Here is the documentation on the timeouts:

Max Morrow
  • 1,206
  • 4
  • 13