class Dpl::Providers::Opsworks
Public Instance Methods
Source
# File lib/dpl/providers/opsworks.rb, line 118 def build_number super || sha end
Calls superclass method
Source
# File lib/dpl/providers/opsworks.rb, line 114 def comment interpolate(msg(:comment)) end
Source
# File lib/dpl/providers/opsworks.rb, line 55 def create_deployment print :create_deploy id = opsworks.create_deployment(deploy_config)[:deployment_id] info :done, id wait_until_deployed(id) if wait_until_deployed? end
Source
# File lib/dpl/providers/opsworks.rb, line 136 def credentials Aws::Credentials.new(access_key_id, secret_access_key) end
Source
# File lib/dpl/providers/opsworks.rb, line 102 def custom_json super || { deploy: { app[:shortname] => { migrate: migrate?, scm: { revision: git_sha } } } }.to_json end
Calls superclass method
Source
# File lib/dpl/providers/opsworks.rb, line 49 def deploy timeout(600) { create_deployment } rescue Aws::Errors::ServiceError => e error :service_error, e.message end
Source
# File lib/dpl/providers/opsworks.rb, line 62 def deploy_config compact( stack_id:, app_id:, command: { name: 'deploy' }, comment:, custom_json:, instance_ids:, layer_ids: ) end
Source
# File lib/dpl/providers/opsworks.rb, line 122 def describe_app data = opsworks.describe_apps(app_ids: [app_id]) error :app_not_found, app_id unless data[:apps]&.any? data[:apps].first end
Source
# File lib/dpl/providers/opsworks.rb, line 128 def describe_deployments(id) opsworks.describe_deployments(deployment_ids: [id]) end
Source
# File lib/dpl/providers/opsworks.rb, line 132 def opsworks @opsworks ||= Aws::OpsWorks::Client.new(region:, credentials:) end
Source
# File lib/dpl/providers/opsworks.rb, line 82 def poll_deployment(id) print '.' sleep 5 describe_deployments(id)[:deployments].first end
Source
# File lib/dpl/providers/opsworks.rb, line 140 def timeout(sec, &block) Timeout.timeout(sec, &block) rescue Timeout::Error error :timeout end
Source
# File lib/dpl/providers/opsworks.rb, line 88 def update_app info :update_app opsworks.update_app(update_config) end
Source
# File lib/dpl/providers/opsworks.rb, line 93 def update_config { app_id:, app_source: { revision: git_sha } } end
Source
# File lib/dpl/providers/opsworks.rb, line 74 def wait_until_deployed(id) print :waiting depl = poll_deployment(id) while depl.nil? || depl[:status] == 'running' error :failed if depl[:status] != 'successful' info :success update_app if update_on_success? end