summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-02-06 16:56:04 +1100
committerDylan Griffith <dyl.griffith@gmail.com>2018-02-07 12:08:48 +1100
commitffb1fab40395ead740c1c1282cb7b3f518134c3f (patch)
treef00bdd26712e9aada98ec99f6fbc0705e565a538
parent4457cf9d178dc9912fd9c16427ad81b389179d00 (diff)
downloadgitlab-ce-40994-expose-features-as-ci-cd-variable.tar.gz
Expose GITLAB_FEATURES as CI/CD variable (fixes #40994)40994-expose-features-as-ci-cd-variable
-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 },