Class: EbDeployer::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/eb_deployer/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, env_name, eb_driver, creation_opts = {}) ⇒ Environment

Returns a new instance of Environment.



4
5
6
7
8
9
10
# File 'lib/eb_deployer/environment.rb', line 4

def initialize(app, env_name, eb_driver, creation_opts={})
  @app = app
  @name = env_name
  @bs = eb_driver
  @creation_opts = creation_opts
  @poller = EventPoller.new(@app, @name, @bs)
end

Instance Attribute Details

#app ⇒ Object (readonly)

Returns the value of attribute app.



3
4
5
# File 'lib/eb_deployer/environment.rb', line 3

def app
  @app
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/eb_deployer/environment.rb', line 3

def name
  @name
end

Instance Method Details

#==(another) ⇒ Object



23
24
25
# File 'lib/eb_deployer/environment.rb', line 23

def ==(another)
  self.app == another.app && self.name == another.name
end

#cname_prefix ⇒ Object



19
20
21
# File 'lib/eb_deployer/environment.rb', line 19

def cname_prefix
  @bs.environment_cname_prefix(@app, @name)
end

#deploy(version_label, settings) ⇒ Object



12
13
14
15
16
17
# File 'lib/eb_deployer/environment.rb', line 12

def deploy(version_label, settings)
  create_or_update_env(version_label, settings)
  poll_events
  smoke_test
  wait_for_env_become_healthy
end

#swap_cname_with(another) ⇒ Object



27
28
29
# File 'lib/eb_deployer/environment.rb', line 27

def swap_cname_with(another)
  @bs.environment_swap_cname(self.app, self.name, another.name)
end