We have several projects in our self-managed GitLab (13.6.3-ee) that all contribute toward our product, and I’m trying to create a pipeline that will avoid duplicate builds and deploys when changes are pushed to several projects within the same time frame. Each project’s gitlab-ci.yaml file triggers a pipeline in a single project that has an action similar to the following:
My expectation was that the first time the pipeline was triggered, it would execute the “checkwait” job and then delay the “postwait” job for the specified 5 minutes. Because Auto-cancel redundant, pending pipelines is true, subsequent times the pipeline is triggered, I expected either the first job would be cancelled or the second one would when it was created.
The way it actually behaves is to execute the “checkwait” job and put the “postwait” job into delayed status in both cases.
Am I misunderstanding how this is supposed to work? Is there another way I can get the results I’m looking for? Any help would be appreciated.
I started three pipelines in a row and they just ran sequentially:
Pipeline 1: “checkwait” started and went immediately to “wait” running
Pipeline 2: “checkwait” was pending until Pipeline 1 finished
Pipeline 3: same as above.
Thanks for the reply though, it’s given me some ideas about how to use stages, which I will try out tomorrow. Will post if I find a solution.
So you need to do some commits to test the cancellation.
I also ran into this and when I then made a commit, the previous pipeline was cancelled also while it was delayed.