Skip to content

Allow predefined environment variables in resource_group

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

Availability and Testing

Related to #218173 (closed)

Edited by Allen Cook

Merge request reports