Class: Hat::Deployment
- Inherits:
-
Object
- Object
- Hat::Deployment
- Defined in:
- lib/hat/deployment.rb
Instance Attribute Summary collapse
-
#cap ⇒ Object
Returns the value of attribute cap.
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#stage_name ⇒ Object
Returns the value of attribute stage_name.
Instance Method Summary collapse
-
#initialize(stage_name, file_name = nil) ⇒ Deployment
constructor
A new instance of Deployment.
- #run ⇒ Object
Constructor Details
#initialize(stage_name, file_name = nil) ⇒ Deployment
Returns a new instance of Deployment.
14 15 16 17 18 |
# File 'lib/hat/deployment.rb', line 14 def initialize stage_name, file_name = nil self.configuration = Konf.new(file_name || 'deploy.yml') self.stage_name = stage_name || "staging" self.cap = Capistrano::Application.new end |
Instance Attribute Details
#cap ⇒ Object
Returns the value of attribute cap.
12 13 14 |
# File 'lib/hat/deployment.rb', line 12 def cap @cap end |
#configuration ⇒ Object
Returns the value of attribute configuration.
12 13 14 |
# File 'lib/hat/deployment.rb', line 12 def configuration @configuration end |
#stage_name ⇒ Object
Returns the value of attribute stage_name.
12 13 14 |
# File 'lib/hat/deployment.rb', line 12 def stage_name @stage_name end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/hat/deployment.rb', line 20 def run recipes.download run_with_bundler(recipes.gemfile) do stage.set_defaults(configuration['defaults']) stage.define_task(recipes) cap.invoke stage.name # http://capistranorb.com/documentation/advanced-features/capistrano-pure-ruby/ cap.invoke 'deploy' end end |