One active pipeline per branch?

Hi guys,

I’ve come across an issue I cannot find a solution for.

  1. Commit your change on a suitable branch
  2. Let a few seconds pass, you figure out you made a tiny error and make another commit on the same branch
  3. Now we have two instances of the same pipeline running in parallell.

Depending on timing either one of these pipelines could complete first! This is OK for the CI part but not for the CD part of the pipeline

Here comes the problem. Which of the two commits will be deployed last and by so doing, win the race? I’ve concluded that the result must be random unless there is considerable time between the commits. As the last step in the pipeline, we have a deploy step. We want to deploy to different environments depending on branch.

What we’re after is a completely automated CI/CD pipeline. Given the above, I cannot see that this is something that Gitlab can provide. Is there a way in which I can control the running pipelines so that at least the deploy step will be performed in “commit order” without involving manual steps?

Your input in this matter would be very appreciated.

// Patrik

1 Like

Any ideas on this?
// Patrik