Module: R10K::Action::Deploy::DeployHelpers

Includes:
Logging
Included in:
Display, Environment, Module
Defined in:
lib/r10k/action/deploy/deploy_helpers.rb

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS, Logging::SYSLOG_LEVELS_MAP

Instance Method Summary collapse

Methods included from Logging

add_outputters, debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level

Instance Method Details

#check_write_lock!(config) ⇒ Object

Check to see if the deploy write_lock setting has been set, and log the lock message and exit if it has been set.

Parameters:

  • config (Hash)

    The r10k config hash

Raises:

  • (SystemExit)

    if the deploy write_lock setting has been set



27
28
29
30
31
32
33
34
# File 'lib/r10k/action/deploy/deploy_helpers.rb', line 27

def check_write_lock!(config)
  write_lock = config.fetch(:deploy, {})[:write_lock]
  if write_lock
    logger.fatal(_("Making changes to deployed environments has been administratively disabled."))
    logger.fatal(_("Reason: %{write_lock}") % {write_lock: write_lock})
    exit(16)
  end
end

#expect_config!Object

Ensure that a config file has been found (and presumably loaded) and exit with a helpful error if it hasn’t.

Raises:

  • (SystemExit)

    If no config file was loaded



14
15
16
17
18
19
# File 'lib/r10k/action/deploy/deploy_helpers.rb', line 14

def expect_config!
  if @config.nil?
    logger.fatal(_("No configuration file given, no config file found in current directory, and no global config present"))
    exit(8)
  end
end