Class: RubyDeployer::Instance

Inherits:
Object
  • Object
show all
Includes:
GeneralDSL
Defined in:
lib/ruby_deployer/instance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GeneralDSL

#log, #rake, #sh

Constructor Details

#initialize(name, options) ⇒ Instance

Returns a new instance of Instance.



10
11
12
13
# File 'lib/ruby_deployer/instance.rb', line 10

def initialize name, options
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/ruby_deployer/instance.rb', line 8

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/ruby_deployer/instance.rb', line 8

def options
  @options
end

Instance Method Details

#build(connection, environment) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/ruby_deployer/instance.rb', line 15

def build connection, environment
  connection.servers.bootstrap(
    private_key_path: File.join('config', 'aws_key'),
    public_key_path: File.join('config', 'aws_key.pub'),
    username: 'ubuntu',
    tags: ["#{environment}_#{name}"]
  )
end