class Admiral::Tasks::OpsWorks
Constants
- DESCRIPTION
- NAME
- USAGE
Public Instance Methods
deploy(app_name)
click to toggle source
# File lib/admiral-opsworks/tasks.rb, line 53 def deploy(app_name) puts "[admiral] Deploying to opsworks" stack = client.stacks[stack_name(options[:environment])] stack_id = cf_query_output stack, 'StackId' app_id = cf_query_output stack, app_name raise "#{app_name} did not match any existing applications." unless app_id puts "[admiral] Deploying app #{app_id}." opsworks.create_deployment( stack_id: stack_id, app_id: app_id, command: { name: "deploy", } ) end
provision()
click to toggle source
# File lib/admiral-opsworks/tasks.rb, line 26 def provision stack = client.stacks[stack_name(options[:environment])] stack_id = cf_query_output(stack, "StackId") layer_id = cf_query_output(stack, "LayerId") update_instances stack_id, layer_id, options[:count] end
ssh()
click to toggle source
# File lib/admiral-opsworks/tasks.rb, line 42 def ssh stack = client.stacks[stack_name(options[:environment])] stack_id = cf_query_output(stack, "StackId") layer_id = cf_query_output(stack, "LayerId") instances = get_all_instances(layer_id) ssh_to_instance instances[0], params(options[:environment])['SshKeyName'], options[:username] end