Skip to content

Expose GitLab license/plan as a CI/CD variable

Description

When running a CI/CD pipeline, there is no way to know which is the actual GitLab license (CE/EE(nolic)/EES/EEP/EEU). It is normally not a problem, as .gitlab-ci.yml is user defined, so users are expected to know that value.

With the Auto DevOps template, and with the ability to include external resources (but also now, with templates), this could be more important. For example Auto DevOps can run specific EE jobs (like codequality or sast only on the proper versions, saving runners' resources.

Proposal

Expose the GitLab version and subscription plan in a CI/CD variable named GITLAB_EDITION and GITLAB_PLAN, or other equivalent names.

Links / references

This gets most of its benefits once https://gitlab.com/gitlab-org/gitlab-ce/issues/37397 is implemented.

The GitLab version can also be exposed in the same way: https://gitlab.com/gitlab-org/gitlab-ce/issues/40995.

Edited by Fabio Busatto