We have a requirement where the deploy job in a pipeline should wait if a previous pipeline has the same deploy job in running state. We are facing a concurrency issue due to this. Example:
We want to wait for the new pipeline specific jobs until the previous pipeline with the same job name is not finished.
DO we have any solution for this in GitLab?
I have a workaround for this to handle using a before_script with pipeline API. Steps which I am performing to handle this:
Any generic solution without handling via the script will be highly appreciated.
We can use resource_group in the yaml to wait for a specific jobs. Example to add resource_group:
DEV Deployment:
stage: deploy
resource_group: my_deploy
script:
- echo "Demo Test" >> README.md
- sleep 200
For details please check https://docs.gitlab.com/ee/ci/resource_groups/
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