Find a way to not use AUTHOR to name environments in GitLab
alrocar opened this issue · comments
Right now the environment name on each MR in GitLab is done like this:
ENVIRONMENT_NAME="tmp_ci_${_NORMALIZED_ENV_NAME}_${AUTHOR}"
That means each user can only have one working environment. I tried with CI_MERGE_REQUEST_IID
but it's only available on MR open.
Apart from that I haven't found a way to clean up the environment on close a MR.
Another issue is AUTHOR
might change in CI vs in CD, even for the same GitLab user so an Environment created in CI may not be deleted on merge.
Since we force exit(1) in the CLI, all cleanup jobs are now failing.
Envs are created in the MR as tmp_ci_alrocaralrocartinybirdco
and when the MR is merged it tries to delete tmp_ci_AlbertoRomeualrocartinybirdco