debian-mirror-gitlab/lib/gitlab/environment.rb

23 lines
703 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
module Gitlab
module Environment
def self.hostname
@hostname ||= ENV['HOSTNAME'] || Socket.gethostname
end
2023-04-23 21:23:45 +05:30
# 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
2017-09-10 17:25:29 +05:30
end
end