Job dependencies¶
Goal
Learn how to...
- ignore stages
- start jobs as soon as dependencies are met
Task: Start a job early¶
Start the job build
as soon as the job audit
completes without waiting for other job of the stage check
to finish. Check out the official documentation of needs
.
Afterwards check the pipeline in the GitLab UI. You should see a successful pipeline run.
Solution (Click if you are stuck)
.gitlab-ci.yml
:
This was just a demonstration. The changes will not be preserved in the following chapters.
Bonus: Start a job late¶
If two jobs in the same stage should not be executed at the same time, the needs
keyword can also delay a job until the dependencies are met. Modify the job lint
so that it waits for the job audit
to finish.
Afterwards check the pipeline in the GitLab UI. You should see a successful pipeline run.
Solution (Click if you are stuck)
.gitlab-ci.yml
:
This was just a demonstration. The changes will not be preserved in the following chapters.