Deployment should fail immediately when the environment is locked but no ongoing deployment
Currently, we lock an environment during a deployment using the job <env>-prepare-disable-env
(example) (which calls the script https://ops.gitlab.net/gitlab-com/gl-infra/deploy-tooling/-/blob/master/bin/set-omnibus-updates?ref_type=heads). This script has a logic to wait if the env is currently locked. The idea behind is good, so that if a deployment is happening on the same env, the deployment waits and then continues when the env is unlocked, instead of failing immediately. However, if a previous deployment fails, the env is never gonna be unlocked, thus the next deployment waits for nothing.
In this issue, I propose to add another logic to this script, so that it checks if the pipeline mentioned in the field __CI_PIPELINE_URL
of the env role is still running and wait. If that pipeline succeeded/failed already, the script can fail immediately (and ask for human intervention), instead of waiting 30min like now.