Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/environment.rb')
-rw-r--r--lib/gitlab/environment.rb13
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