Class: OpsPreflight::OpsWorks::Deploy
- Defined in:
- lib/ops_preflight/ops_works/deploy.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
Attributes inherited from Base
Instance Method Summary collapse
- #call(release_num = nil) ⇒ Object
-
#initialize(region, stack_name, app_name) ⇒ Deploy
constructor
A new instance of Deploy.
Constructor Details
#initialize(region, stack_name, app_name) ⇒ Deploy
Returns a new instance of Deploy.
8 9 10 11 12 |
# File 'lib/ops_preflight/ops_works/deploy.rb', line 8 def initialize(region, stack_name, app_name) super region, stack_name @app_name = app_name end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
6 7 8 |
# File 'lib/ops_preflight/ops_works/deploy.rb', line 6 def app_name @app_name end |
Instance Method Details
#call(release_num = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ops_preflight/ops_works/deploy.rb', line 14 def call(release_num = nil) instances = instance_ids puts "Triggering deploy of v#{release_num} to #{instances.size} instance#{'s' if instances.size != 1}" resp = opsworks.create_deployment({ :stack_id => stack_id, :app_id => app_id, :instance_ids => instances, :command => { :name => 'deploy' }, :comment => release_num.nil? ? 'Preflight Deployment' : "Preflight Release v#{release_num}" }) end |