Class: R10K::Action::Deploy::Module
- Includes:
- DeployHelpers, Visitor
- Defined in:
- lib/r10k/action/deploy/module.rb
Constant Summary
Constants included from Logging
Logging::LOG_LEVELS, Logging::SYSLOG_LEVELS_MAP
Instance Attribute Summary collapse
-
#force ⇒ Object
readonly
Deprecated.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(opts, argv, settings = {}) ⇒ Module
constructor
A new instance of Module.
Methods included from Visitor
Methods included from Logging
add_outputters, debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level
Methods included from DeployHelpers
#check_write_lock!, #expect_config!
Constructor Details
#initialize(opts, argv, settings = {}) ⇒ Module
Note:
All arguments will be required in the next major version
Returns a new instance of Module.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/r10k/action/deploy/module.rb', line 29 def initialize(opts, argv, settings = {}) super requested_env = @opts[:environment] ? [@opts[:environment].gsub(/\W/, '_')] : [] @modified_envs = [] @settings = @settings.merge({ overrides: { environments: { requested_environments: requested_env, generate_types: @generate_types }, modules: { default_ref: settings.dig(:git, :default_ref), exclude_spec: settings.dig(:deploy, :exclude_spec), pool_size: @settings[:pool_size] || 4, requested_modules: @argv.map.to_a, # force here is used to make it easier to reason about force: !@no_force }, forge: { allow_puppetfile_override: settings.dig(:forge, :allow_puppetfile_override) || false }, purging: {}, output: {} } }) end |
Instance Attribute Details
#force ⇒ Object (readonly)
Deprecated
15 16 17 |
# File 'lib/r10k/action/deploy/module.rb', line 15 def force @force end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
17 18 19 |
# File 'lib/r10k/action/deploy/module.rb', line 17 def settings @settings end |
Instance Method Details
#call ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/r10k/action/deploy/module.rb', line 58 def call @visit_ok = true begin expect_config! deployment = R10K::Deployment.new(@settings) check_write_lock!(@settings) deployment.accept(self) rescue => e @visit_ok = false logger.error R10K::Errors::Formatting.format_exception(e, @trace) end @visit_ok end |