Can GitLab Pipelines Wait for Each Other to Finish?

0
22
Asked By CuriousCoder99 On

Hey everyone, I have a question about GitLab pipelines. Is it possible for one pipeline to wait for another pipeline to finish? We have several repositories (three in this case) and their pipelines tend to interfere with one another, especially during deployment to a server. The aim is for the pipeline to be aware if a specific other pipeline is running. Is there a way to achieve this in GitLab? Also, we would prefer to keep using concurrent runners, so just tagging a single runner isn't really an option we want to pursue.

5 Answers

Answered By CodeMaster42 On

You could definitely use the GitLab API with an access token to check if a specific pipeline is finished. You'd loop through this check until the pipeline in your targeted project completes. Alternatively, consider running multi-project pipelines, which could simplify the process without too much hassle.

Answered By BuildWizard88 On

Why not just combine everything into a single pipeline if you need them to run sequentially? Does it take a long time to execute? It might save you some trouble!

Answered By DeployNinja76 On

Have you considered using resource groups? If you assign the same resource group to the deploy stage across your pipelines, only one deployment job will run at a time across them. This could help manage concurrency effectively.

Answered By SkepticalDev99 On

As far as I know, it’s not straightforward. I recall reading an article where someone managed to control pipelines through scripts. You might want to check that out. Just remember that each pipeline runs in its own environment, so you might have to rethink your approach if they are merely building libraries or static assets.

Answered By TechGuru21 On

GitLab has a cool feature for this called downstream pipelines. You can trigger other repositories' pipelines from the first one, making the second dependent on the first to finish. This feature not only keeps your pipelines organized but also lets you see the entire process in one go, which is super helpful.

DevOpsDude15 -

That's really nice to know! I wish GitHub had something similar for visualizing downstream pipelines.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.