Module: Gitlab::Environment

Defined in:
lib/gitlab/environment.rb

Class Method Summary collapse

Class Method Details

.hostnameObject



5
6
7
# File 'lib/gitlab/environment.rb', line 5

def self.hostname
  @hostname ||= ENV['HOSTNAME'] || Socket.gethostname
end

.static_verification?Boolean

Check whether codebase is going through static verification in order to skip executing parts of the codebase

Returns:

  • (Boolean)

    Is the code going through static verification?



13
14
15
16
17
18
19
20
# File 'lib/gitlab/environment.rb', line 13

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