Class: Capistrano::OpsWorks::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/ops_works/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aws = {}) ⇒ Connection

Returns a new instance of Connection.



9
10
11
12
13
14
15
16
17
18
# File 'lib/capistrano/ops_works/connection.rb', line 9

def initialize aws={}
  access_key_id = aws.fetch(:access_key_id)
  secret_access_key = aws.fetch(:secret_access_key)

  @client = AWS::OpsWorks.new(\
    :access_key_id => access_key_id,
    :secret_access_key => secret_access_key).client

  self
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/capistrano/ops_works/connection.rb', line 7

def client
  @client
end

Instance Method Details

#check(args = {}) ⇒ Object



24
25
26
27
28
29
# File 'lib/capistrano/ops_works/connection.rb', line 24

def check args={}
  stack_apps = describe args
  app_id = args.fetch(:app_id)

  stack_apps.data[:apps].collect { |a| a[:app_id] }.include? app_id
end

#deploy(args = {}) ⇒ Object



20
21
22
# File 'lib/capistrano/ops_works/connection.rb', line 20

def deploy args={}
  create_deployment args
end

#history(args = {}) ⇒ Object



31
32
33
# File 'lib/capistrano/ops_works/connection.rb', line 31

def history args={}
  describe_deployments args
end