diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-26 12:10:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-26 12:10:42 +0300 |
commit | db950c5706cdf47f7ccc2e02a4ffd691432ac5dc (patch) | |
tree | fdceeac88d490aae384eecc636964d7f03be9c24 /lib/gitlab/environment.rb | |
parent | 7cd527ffd9cfef1c872faa5377eaccc3df6ef067 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/environment.rb')
-rw-r--r-- | lib/gitlab/environment.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/environment.rb b/lib/gitlab/environment.rb index b1a9603d3a5..86094727df5 100644 --- a/lib/gitlab/environment.rb +++ b/lib/gitlab/environment.rb @@ -5,5 +5,18 @@ module Gitlab def self.hostname @hostname ||= ENV['HOSTNAME'] || Socket.gethostname end + + # Check whether codebase is going through static verification + # in order to skip executing parts of the codebase + # + # @return [Boolean] Is the code going through static verification? + def self.static_verification? + static_verification = Gitlab::Utils.to_boolean(ENV['STATIC_VERIFICATION'], default: false) + env_production = ENV['RAILS_ENV'] == 'production' + + warn '[WARNING] Static Verification bypass is enabled in Production.' if static_verification && env_production + + static_verification + end end end |