O
O
Oleg Aksenov2021-09-01 12:36:40
Continuous Integration
Oleg Aksenov, 2021-09-01 12:36:40

How to run multiple stages at the same time?

Good afternoon, tell me, please, how can I run several stages at the same time / in parallel?
For example, there are the following stages

  • .pre
  • build
  • test

stage .pre does not depend on build in any way in its component, how to run build so that it does not wait for .pre to complete?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
ZIK1337, 2021-09-03
@ZIK1337

Stages seem to be in no way, only jobs,
although it can shaman with needs
https://docs.gitlab.com/ee/ci/yaml/#needs

E
Eugene, 2021-09-05
@yellowmew

There are two options for the development of events: you distribute the execution sequence by stages or draw your own execution graph.
In the first case, the sequence of stages is important - jobs are parallel within one stage and the next stage will not start until all the previous jobs are completed.
.pre is always run before user stages.
In the second, you can schedule your execution graph with needs
I didn't find in the documentation that .pre will still be executed first if its jobs are in your own graph, so this might be a solution. In the case of using needs (and gitlab 14.2+ or gitlab.com 14.1), you can not prescribe stages at all. In the case of gitlab <=14.0, stages are still needed because needs won't work with jobs of the same stage.
Read carefully the requirements https://docs.gitlab.com/ee/ci/yaml/#requirements-a... according to your version of gitlab

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question