Allow predefined environment variables in resource_group
requested to merge 218173-ci-resource_group-not-working-when-using-ci_environment_name-directly into master
What does this MR do?
Uses predefined environment variables to parse the resource group key
Screenshots or Screencasts (strongly suggested)
How to setup and validate locally (strongly suggested)
Use the following .gitlab-ci.yml to replicate locally
deploy1:
resource_group: $CI_ENVIRONMENT_NAME
script:
- echo deploying $CI_ENVIRONMENT_NAME
- sleep 60s
- echo done $CI_ENVIRONMENT_NAME
environment:
name: staging
url: https://staging.example.com
deploy2:
resource_group: $CI_ENVIRONMENT_NAME
script:
- echo deploying $CI_ENVIRONMENT_NAME
- sleep 60s
- echo done $CI_ENVIRONMENT_NAME
environment:
name: staging
url: https://staging.example.com
When run on a Gitlab instance with at least two active runners, deploy2
will still wait on deploy1
to be finished. Without this fix it does not wait, as the resource_group
value is effectively blank
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
Feature flag rollout issue
env_var_resource_group
- issue -
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
Related to #218173 (closed)
Edited by Allen Cook