Module: Gitlab::Environment

Extended by:
Utils::StrongMemoize
Defined in:
lib/gitlab/environment.rb

Class Method Summary collapse

Class Method Details

.hostnameObject



7
8
9
10
11
# File 'lib/gitlab/environment.rb', line 7

def self.hostname
  strong_memoize(:hostname) do
    ENV['HOSTNAME'] || Socket.gethostname
  end
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?



17
18
19
20
21
22
23
24
25
# File 'lib/gitlab/environment.rb', line 17

def self.static_verification?
  static_verification = Gitlab::Utils.to_boolean(ENV['STATIC_VERIFICATION'], default: false)

  if static_verification && Rails.env.production?
    warn '[WARNING] Static Verification bypass is enabled in Production.'
  end

  static_verification
end