summaryrefslogtreecommitdiff
path: root/config/settings.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2019-06-13 14:18:01 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2019-06-20 14:51:49 +0200
commit0e41564762cd74c6cbf938dcc319c3b77a891dc7 (patch)
tree1a1a67a7eb29e4e42de345fbd70a86c6dcd35477 /config/settings.rb
parent3cd038e3046a18e38e25d7904cca9e38ea6565dd (diff)
downloadgitlab-ce-0e41564762cd74c6cbf938dcc319c3b77a891dc7.tar.gz
Backport gitlab.yml.example from EEconfig-yaml-differences
To make this happen, we need to conditionally add the group_saml strategy when running tests, but only on EE. This requires some changes to Gitlab.ee? so that it can be used before/without loading the Rails environment. We also have to change how we require a few files, so this can run outside of Rails.
Diffstat (limited to 'config/settings.rb')
-rw-r--r--config/settings.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/config/settings.rb b/config/settings.rb
index 1b94df785a7..6df2132332c 100644
--- a/config/settings.rb
+++ b/config/settings.rb
@@ -1,5 +1,11 @@
require 'settingslogic'
+# We can not use `Rails.root` here, as this file might be loaded without the
+# full Rails environment being loaded. We can not use `require_relative` either,
+# as Rails uses `load` for `require_dependency` (used when loading the Rails
+# environment). This could then lead to this file being loaded twice.
+require_dependency File.expand_path('../lib/gitlab', __dir__)
+
class Settings < Settingslogic
source ENV.fetch('GITLAB_CONFIG') { Pathname.new(File.expand_path('..', __dir__)).join('config/gitlab.yml') }
namespace ENV.fetch('GITLAB_ENV') { Rails.env }