summaryrefslogtreecommitdiff
path: root/lib/gitlab.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-02-21 15:19:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-02-21 15:19:50 +0000
commit871e82b7c73283c2c71355e3258a6c9d3b8c0eda (patch)
treee895b27d313e8df94a160e4820093d0bc25d5a4c /lib/gitlab.rb
parentda9274a8f1939c135f3427947407680faa290052 (diff)
downloadgitlab-ce-871e82b7c73283c2c71355e3258a6c9d3b8c0eda.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r--lib/gitlab.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb
index 2449554d3c0..ad1a1611309 100644
--- a/lib/gitlab.rb
+++ b/lib/gitlab.rb
@@ -49,9 +49,15 @@ module Gitlab
INSTALLATION_TYPE = File.read(root.join("INSTALLATION_TYPE")).strip.freeze
HTTP_PROXY_ENV_VARS = %w(http_proxy https_proxy HTTP_PROXY HTTPS_PROXY).freeze
+ def self.simulate_com?
+ return false unless Rails.env.test? || Rails.env.development?
+
+ Gitlab::Utils.to_boolean(ENV['GITLAB_SIMULATE_SAAS'])
+ end
+
def self.com?
# Check `gl_subdomain?` as well to keep parity with gitlab.com
- Gitlab.config.gitlab.url == Gitlab::Saas.com_url || gl_subdomain?
+ simulate_com? || Gitlab.config.gitlab.url == Gitlab::Saas.com_url || gl_subdomain?
end
def self.com
@@ -87,7 +93,7 @@ module Gitlab
end
def self.dev_env_or_com?
- Rails.env.development? || com?
+ com?
end
def self.dev_or_test_env?