0

We have the following 3 pipelines:

  • CI
  • CD (Dev/ Qa /Prod)
  • Integration Tests (Dev/ Qa)

When we run the integration tests against an environment, is there any way to ensure the CD pipeline has been ran first for the given environment, and if not, run it?

If 2 people are working on different branches we would need to ensure that their specific branch is the last one deployed before running the integration tests against that branch? Is this possible?

R-nold
  • 242
  • 2
  • 11
  • 1
    These things should not be separate pipelines. They should be stages within a single pipeline. – Daniel Mann Aug 23 '21 at 20:31
  • Even if they were different stages within a single pipeline, how could we ensure that the deploy has ran before the Integration tests? For example, the Int Test stage fails and we choose to re-run that stage, but another developer has already deployed some changes elsewhere and now the integration tests are actually running against a different environment. – R-nold Aug 23 '21 at 20:36
  • Each feature branch should have its own separate temporary integration test environment that's stood up and torn down as necessary. – Daniel Mann Aug 23 '21 at 20:41

1 Answers1

0

Trigger DevOps pipeline before another pipeline

As workaround, we could add a inline powershell task in the Integration Tests pipeline (before the test task) to call the REST API Builds - Queue to trigger the pipeline CD and monitor the states of this pipeline until the status is complete, otherwise, wait for 30 seconds, and then loop again until the status of the pipeline CD is complete.

POST https://dev.azure.com/{organization}/{project}/_apis/build/builds?definitionId=$defId&api-version=6.0

You could check my previous similar thread and this thread for some more details.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135