Class: R10K::Action::Environment::Deploy
- Inherits:
-
Object
- Object
- R10K::Action::Environment::Deploy
- Includes:
- Logging
- Defined in:
- lib/r10k/action/environment.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, root) ⇒ Deploy
constructor
A new instance of Deploy.
Methods included from Logging
formatter, included, level, level=, #logger, outputter
Constructor Details
Instance Method Details
#call(env) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/r10k/action/environment.rb', line 27 def call(env) @env = env logger.info "Deploying environment #{@root.name}" FileUtils.mkdir_p @root.full_path @root.sync! :update_cache => @env[:update_cache] if @env[:recurse] # Build a new middleware chain and run it stack = Middleware::Builder.new @root.modules.each { |mod| stack.use R10K::Action::Module::Deploy, mod } stack.call(@env) end @app.call(@env) rescue R10K::ExecutionFailure => e logger.error "Could not synchronize #{@root.full_path}: #{e}".red $stderr.puts e.backtrace.join("\n").red if @env[:trace] @app.call(@env) end |