Search code examples
gitlab

GitLab CI/CD variables: How to add environments on the group level?


I have a GitLab group with some projects in it that have environments configured. I want to add a GitLab group variable that is scoped to the test environment (GitLab Documentation).

In the GitLab project I have added a test environment:

GitLab Project Environments

In the GitLab project I can select the test environment:

enter image description here

However in the GitLab group there is no test environment to select:

enter image description here

How can I add my test environment to the group variables? This is a GitLab with Premium Subscription. I am Owner of the group.


Solution

  • Per https://gitlab.com/gitlab-org/gitlab/-/issues/330974, group level environment variables seem to be a "premium" feature, maybe the feature is intentionally disabled?

    However, it is not quite intuitive that to match multiple environments (of multiple projects) you need to create an "environment wildcard" matching the desired environment name(s) by typing the name, possible with an asterisk somewhere, and select the then-appearing "create wildcard" entry, see https://gitlab.com/gitlab-org/gitlab/-/issues/2874#note_585473711

    enter image description here