Class: KumoDockerCloud::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/kumo_dockercloud/stack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_name, env_name, options = { contactable: true }) ⇒ Stack

Returns a new instance of Stack.



5
6
7
8
9
# File 'lib/kumo_dockercloud/stack.rb', line 5

def initialize(app_name, env_name, options = { contactable: true })
  @app_name = app_name
  @stack_name = "#{app_name}-#{env_name}"
  @options = options
end

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name.



3
4
5
# File 'lib/kumo_dockercloud/stack.rb', line 3

def app_name
  @app_name
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/kumo_dockercloud/stack.rb', line 3

def options
  @options
end

#stack_nameObject (readonly)

Returns the value of attribute stack_name.



3
4
5
# File 'lib/kumo_dockercloud/stack.rb', line 3

def stack_name
  @stack_name
end

Instance Method Details

#deploy(service_name, version, checks = nil, check_timeout = 300) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/kumo_dockercloud/stack.rb', line 11

def deploy(service_name, version, checks = nil, check_timeout = 300)
  validate_params(service_name, 'Service name')
  validate_params(version, 'Version')

  service = Service.new(stack_name, service_name)
  service.deploy(version)
  service.check(checks, check_timeout) if checks
end