1
votes

Scenario

I have two pipelines:

  • Pipeline A builds an artifact called artifact A
  • Pipeline B builds an artifact called artifact B

The following is true about the relationship between these pipelines

  • Both pipelines have independent YAML files which trigger off commits to the master branch that affects one or more files associated with the pipeline
  • Both pipelines share some of the same source files and therefore it's possible that a single commit could trigger both pipelines
  • Pipeline B is dependent on artifact A and therefore should always yield and wait for Pipeline A in cases where both pipelines are triggered

Question

Is it possible to establish a relationship between Pipeline A and Pipeline B such that they can be triggered independently and yet, if they are both triggered at the same time, Pipeline B always waits for Pipeline A to finish?

1

1 Answers

0
votes

You may try to create another two pipelines:

  1. Exclude same source files path in Pipeline A and Pipeline B.

  2. Create Pipeline C and Pipeline D with the same steps as Pipeline A and Pipeline B, you could use Template for the steps.

  3. Set trigger and include same source files path in Pipeline C.

  4. Set Pipeline trigger in Pipeline D. When Pipeline C completes, it will trigger Pipeline D.