Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining parallel sequences of jobs in GitLab CI

In my gitlab-ci.yml file, I have defined 3 stages, and the 2nd and 3rd stages have 3 jobs each, resulting in the following structure:

My current setup in GitLab

The 1st and 2nd stage works as I intended, however, for the 3rd stage what I'd actually like to have is something like this (the image is a mockup of course), i.e. "parallel sequences" of jobs if you will:

Mockup of the setup I'd like to achieve

That is, I want "deploy-b" to start if "build-b" is done, and not waiting for the other build tasks to complete.

Is that possible with GitLab pipelines? (Apart from the obvious solution of defining just 2 stages, the second being "Build-and-Deploy", where I just "merge" the script steps of the current build-* and deploy-* jobs.)

like image 931
Dániel Kis-Nagy Avatar asked Sep 18 '18 08:09

Dániel Kis-Nagy


People also ask

Do GitLab jobs run in parallel?

GitLab provides a method to make clones of a job and run them in parallel for faster execution using the parallel: keyword. While parallel jobs may not help in reducing the consumption of CI minutes, they definitely help increase work productivity.

Can GitLab runner run multiple jobs?

One way to allow more jobs to run simultaneously is to simply register more runners. Each installation of GitLab Runner can register multiple distinct runner instances. They operate independently of each other and don't all need to refer to the same coordinating server.

Which file is used to specify the jobs within the GitLab CI pipeline?

yml` file | GitLab.

Can you have multiple pipelines in GitLab?

You can set up GitLab CI/CD across multiple projects, so that a pipeline in one project can trigger a pipeline in another project. You can visualize the entire pipeline in one place, including all cross-project interdependencies.


2 Answers

This feature was added in the new GitLab release (v12.2)

like image 77
Nikita Merkel Avatar answered Oct 22 '22 16:10

Nikita Merkel


No, this is not possible by design, a next stage only start if the previous one is done for GitLab version<12.2.

like image 36
Danny Avatar answered Oct 22 '22 18:10

Danny