Class: KumoDockerCloud::Deployment
- Inherits:
-
Object
- Object
- KumoDockerCloud::Deployment
- Defined in:
- lib/kumo_dockercloud/deployment.rb
Defined Under Namespace
Classes: DeploymentError
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#contactable ⇒ Object
Returns the value of attribute contactable.
-
#health_check_path ⇒ Object
readonly
Returns the value of attribute health_check_path.
-
#stack_name ⇒ Object
readonly
Returns the value of attribute stack_name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
-
#version_check_path ⇒ Object
readonly
Returns the value of attribute version_check_path.
Instance Method Summary collapse
-
#initialize(stack_name, version, _ = nil) ⇒ Deployment
constructor
A new instance of Deployment.
- #validate ⇒ Object
- #wait_for_exit_state ⇒ Object
- #wait_for_running_state ⇒ Object
Constructor Details
#initialize(stack_name, version, _ = nil) ⇒ Deployment
Returns a new instance of Deployment.
15 16 17 18 19 20 21 22 |
# File 'lib/kumo_dockercloud/deployment.rb', line 15 def initialize(stack_name, version, _ = nil) @stack_name = stack_name @version = version @contactable = true @health_check_path = 'site_status' @version_check_path = "#{health_check_path}/version" end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
12 13 14 |
# File 'lib/kumo_dockercloud/deployment.rb', line 12 def app_name @app_name end |
#contactable ⇒ Object
Returns the value of attribute contactable.
12 13 14 |
# File 'lib/kumo_dockercloud/deployment.rb', line 12 def contactable @contactable end |
#health_check_path ⇒ Object (readonly)
Returns the value of attribute health_check_path.
13 14 15 |
# File 'lib/kumo_dockercloud/deployment.rb', line 13 def health_check_path @health_check_path end |
#stack_name ⇒ Object (readonly)
Returns the value of attribute stack_name.
13 14 15 |
# File 'lib/kumo_dockercloud/deployment.rb', line 13 def stack_name @stack_name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
13 14 15 |
# File 'lib/kumo_dockercloud/deployment.rb', line 13 def version @version end |
#version_check_path ⇒ Object (readonly)
Returns the value of attribute version_check_path.
13 14 15 |
# File 'lib/kumo_dockercloud/deployment.rb', line 13 def version_check_path @version_check_path end |
Instance Method Details
#validate ⇒ Object
24 25 26 27 |
# File 'lib/kumo_dockercloud/deployment.rb', line 24 def validate wait_for_running_state validate_containers end |
#wait_for_exit_state ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/kumo_dockercloud/deployment.rb', line 38 def wait_for_exit_state exit_state_provider = lambda { service = docker_cloud_api.services.get(service_uuid) { name: service.name, exit_code: service.containers.first.exit_code } } StateValidator.new(exit_state_provider).wait_for_exit_state(240) end |
#wait_for_running_state ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/kumo_dockercloud/deployment.rb', line 29 def wait_for_running_state service_state_provider = lambda { service = docker_cloud_api.services.get(service_uuid) { name: service.name, state: service.state } } StateValidator.new(service_state_provider).wait_for_state('Running', 240) end |