summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-08 08:36:27 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-08 08:36:27 +0000
commita6b9eb5dfcde547a908994211d162ae6bfab921e (patch)
tree7362d7fcb0e74859d4044ead605494592b8157f1
parent7e424eb852716495073881710e8a8851b4a4cd5a (diff)
parentffb1fab40395ead740c1c1282cb7b3f518134c3f (diff)
downloadgitlab-ce-a6b9eb5dfcde547a908994211d162ae6bfab921e.tar.gz
Merge branch '40994-expose-features-as-ci-cd-variable' into 'master'
Resolve "Expose GitLab license/plan as a CI/CD variable" Closes #40994 See merge request gitlab-org/gitlab-ce!16936
-rw-r--r--app/models/ci/build.rb1
-rw-r--r--app/models/namespace.rb4
-rw-r--r--changelogs/unreleased/40994-expose-features-as-ci-cd-variable.yml5
-rw-r--r--spec/models/ci/build_spec.rb1
4 files changed, 11 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 20534b8eed0..ee987949080 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -543,6 +543,7 @@ module Ci
variables = [
{ key: 'CI', value: 'true', public: true },
{ key: 'GITLAB_CI', value: 'true', public: true },
+ { key: 'GITLAB_FEATURES', value: project.namespace.features.join(','), 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/app/models/namespace.rb b/app/models/namespace.rb
index d95489ee9f2..db274ea8172 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -243,6 +243,10 @@ class Namespace < ActiveRecord::Base
all_projects.with_storage_feature(:repository).find_each(&:remove_exports)
end
+ def features
+ []
+ end
+
private
def path_or_parent_changed?
diff --git a/changelogs/unreleased/40994-expose-features-as-ci-cd-variable.yml b/changelogs/unreleased/40994-expose-features-as-ci-cd-variable.yml
new file mode 100644
index 00000000000..1e377094791
--- /dev/null
+++ b/changelogs/unreleased/40994-expose-features-as-ci-cd-variable.yml
@@ -0,0 +1,5 @@
+---
+title: 'Expose GITLAB_FEATURES as 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 0b3d5c6a0bd..9e159c3f1fe 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_FEATURES', value: '', 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 },