0

I have created a GitLab automated CI/CD build process that looks something like this:

CI/CD Build

And the .gitlab-ci.yml file looks like this (removed actual commands since they're not important to this question):

stages:
  - build
  - test
  - deploy

build-windows: stage: build before_script: - ... script: - ... artifacts: paths: - ... expire_in: 3 month tags: - windows

build-linux-ubuntu: stage: build before_script: - ... script: - ... artifacts: paths: - ... expire_in: 3 month tags: - linux - ubuntu

test-windows: stage: test before_script: - ... script: - ... after_script: - ... tags:

  • windows

test-linux-ubuntu: stage: test before_script: - ... after_script: - ... tags: - linux - ubuntu

deploy-windows: stage: deploy before_script: - ... script: - ... artifacts: paths: - ... after_script: tags: - windows

deploy-linux-ubuntu: stage: deploy before_script: - ... script: - ... artifacts: paths: - ... expire_in: 3 month after_script: - ... tags: - linux - ubuntu

Now this has the downside of Linux taking longer to build/test/deploy than Windows, so the Windows job finishes much quicker and just sits waiting for the Linux job to complete. Then once both have completed, it moves on to the next step. However, the Windows and Linux jobs are completely independent of one another.

How can I get GitLab to build both Windows and Linux in parallel, without the cross-dependency? Something like this:

CI/CD with dependency removed

Alex
  • 235
  • 1
    I think DAGs are supposed to solve exactly this problem – gronostaj Dec 14 '20 at 20:29
  • @gronostaj That looks like exactly what I'm looking for! Though unfortunately when I add the needs keyword in, GitLab doesn't seem to change anything. When I use the GitLab CI Lint, it also doesn't say anything about the added needs keyword. I'm thinking that our GitLab installation may not support DAGs unfortunately. – Alex Dec 14 '20 at 22:35

0 Answers0