Let's say I have these stages defined in .gitlab-ci.yml:
stages:
- build
- analysis
- tests
- deploy
- post-deploy
Since analysis takes a lot of time and I don't really care about the result (I also have allow_failure: true set) - is it possible to somehow define to start analysis and then immediately launch the next stage tests?
I didn't find any reference to similar topic on official docs.
EDIT:
The main idea is that all other stages can be run as if the analysis didn't even exist. If i put analysis to same stage as tests, then both analysis and tests will run at the same time, however deploy won't be launched until both of them finish. This is no good. I want tests to finish and then launch deploy, after deploy finishes I want to launch post-deploy. I really don't care about analysis result, I simply want to trigger it and continue with the deployment.
Since v12.8, you can use needs: [] to start jobs start immediately. Docs: https://docs.gitlab.com/ee/ci/yaml/#needs
There's a workaround available in newer GitLab versions: Trigger a child-pipeline for the jobs you don't want to wait for. By default a child-pipeline will return "success" as soon after it got started, you need to explicitly set the strategy if you'd like to wait for the jobs in the child-pipeline. So by accident this is exactly the behaviour you'd like to have.
The UI is not the best right now, but I'm positive it'll improve in future versions of GitLab. It's a workaround after all, but it should do the job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With