summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-02-05 10:46:41 +1100
committerDylan Griffith <dyl.griffith@gmail.com>2018-02-05 10:47:29 +1100
commit90414ba7e566b3120270851f1a56e1d3026db03e (patch)
tree877f673d31afecfa6b49fec2c7f23e52837fcf30
parentcf887a8b3108edb715ee5618377f4ffab1824d85 (diff)
downloadgitlab-ce-40994-expose-gitlab-license-plan-as-a-ci-cd-variable.tar.gz
Expose GitLab license plan as a CI/CD variable (fixes #40994)40994-expose-gitlab-license-plan-as-a-ci-cd-variable
-rw-r--r--app/models/ci/build.rb5
-rw-r--r--changelogs/unreleased/40994-expose-gitlab-license-plan-as-a-ci-cd-variable.yml5
-rw-r--r--spec/models/ci/build_spec.rb1
3 files changed, 11 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 78906e7a968..f5cc00d93ce 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -518,6 +518,10 @@ module Ci
super(options).merge(when: read_attribute(:when))
end
+ def gitlab_edition_variable
+ 'libre'
+ end
+
private
def update_artifacts_size
@@ -542,6 +546,7 @@ module Ci
variables = [
{ key: 'CI', value: 'true', public: true },
{ key: 'GITLAB_CI', value: 'true', public: true },
+ { key: 'GITLAB_EDITION', value: gitlab_edition_variable, public: true },
{ key: 'CI_SERVER_NAME', value: 'GitLab', public: true },
{ key: 'CI_SERVER_VERSION', value: Gitlab::VERSION, public: true },
{ key: 'CI_SERVER_REVISION', value: Gitlab::REVISION, public: true },
diff --git a/changelogs/unreleased/40994-expose-gitlab-license-plan-as-a-ci-cd-variable.yml b/changelogs/unreleased/40994-expose-gitlab-license-plan-as-a-ci-cd-variable.yml
new file mode 100644
index 00000000000..265afea564e
--- /dev/null
+++ b/changelogs/unreleased/40994-expose-gitlab-license-plan-as-a-ci-cd-variable.yml
@@ -0,0 +1,5 @@
+---
+title: 'Expose GitLab license plan as a CI/CD variable (fixes #40994)'
+merge_request:
+author:
+type: added
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index f5b3b4a9fc5..1699353ad2e 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -1413,6 +1413,7 @@ describe Ci::Build do
[
{ key: 'CI', value: 'true', public: true },
{ key: 'GITLAB_CI', value: 'true', public: true },
+ { key: 'GITLAB_EDITION', value: build.gitlab_edition_variable, public: true },
{ key: 'CI_SERVER_NAME', value: 'GitLab', public: true },
{ key: 'CI_SERVER_VERSION', value: Gitlab::VERSION, public: true },
{ key: 'CI_SERVER_REVISION', value: Gitlab::REVISION, public: true },