diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2019-06-13 15:18:01 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-06-20 15:51:49 +0300 |
commit | 0e41564762cd74c6cbf938dcc319c3b77a891dc7 (patch) | |
tree | 1a1a67a7eb29e4e42de345fbd70a86c6dcd35477 /config/initializers/1_settings.rb | |
parent | 3cd038e3046a18e38e25d7904cca9e38ea6565dd (diff) |
Backport gitlab.yml.example from EE
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/initializers/1_settings.rb')
-rw-r--r-- | config/initializers/1_settings.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 0c8d94ccaed..6cca7a3b75f 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -117,6 +117,15 @@ if github_settings end end +# SAML should be enabled for the tests automatically, but only for EE. +saml_provider_enabled = Settings.omniauth.providers.any? do |provider| + provider['name'] == 'group_saml' +end + +if Gitlab.ee? && Rails.env.test? && !saml_provider_enabled + Settings.omniauth.providers << Settingslogic.new({ 'name' => 'group_saml' }) +end + Settings['shared'] ||= Settingslogic.new({}) Settings.shared['path'] = Settings.absolute(Settings.shared['path'] || "shared") @@ -291,6 +300,11 @@ Settings.gravatar['host'] = Settings.host_without_www(Settings.gravatar[ # Cron Jobs # Settings['cron_jobs'] ||= Settingslogic.new({}) + +if Gitlab.ee? && Settings['ee_cron_jobs'] + Settings.cron_jobs.merge!(Settings.ee_cron_jobs) +end + Settings.cron_jobs['stuck_ci_jobs_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_ci_jobs_worker']['cron'] ||= '0 * * * *' Settings.cron_jobs['stuck_ci_jobs_worker']['job_class'] = 'StuckCiJobsWorker' |