Class: R10K::Action::Module::Deploy
- Inherits:
-
Object
- Object
- R10K::Action::Module::Deploy
- Includes:
- Logging
- Defined in:
- lib/r10k/action/module.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, mod) ⇒ Deploy
constructor
A new instance of Deploy.
Methods included from Logging
formatter, included, level, level=, #logger, outputter
Constructor Details
#initialize(app, mod) ⇒ Deploy
Returns a new instance of Deploy.
16 17 18 |
# File 'lib/r10k/action/module.rb', line 16 def initialize(app, mod) @app, @mod = app, mod end |
Instance Method Details
#call(env) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/r10k/action/module.rb', line 23 def call(env) @env = env logger.info "Deploying module #{@mod.name}" @mod.sync! :update_cache => @env[:update_cache] @app.call(@env) rescue R10K::ExecutionFailure => e logger.error "Could not synchronize #{@mod.full_path}: #{e}".red $stderr.puts e.backtrace.join("\n").red if @env[:trace] @app.call(@env) end |