cfn_manage 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 069e9448ce6f6efafd546df321dd4dbb52503f73586d23f718dc10c211e0de36
4
- data.tar.gz: 9cb836b6ea9b0071743386dd7fe030c6c3f013b1be2270671b1df31722b0a2ea
3
+ metadata.gz: 7aeef944e140719abc696e29afb06aa3ea2677ab6504e688e987040c56a95771
4
+ data.tar.gz: 1fcc7ec53f48c15336699b01f5acc239089c1f2479571413c0bab30abd0559e9
5
5
  SHA512:
6
- metadata.gz: a8e2ae95ea5bb3600a46cc637a32f969831190ea2b3cf3d8553a7ee9e4f726ad6aab360f7cc389f08e2fd1df7a1c507cde5e7a9142b79179359590c908048424
7
- data.tar.gz: 7d2dcc801ce2c239519fcc8f410b4f2395f56963c8b89e8b2d169131b00f588126b1aa65ccb5a1bff91d6f4434f562ee535b3609e4f6c2585fed195f4ff338c2
6
+ metadata.gz: '085fbba038d07fcc2eb4287dd5ed851bf22aafc8a34a682e6e0ea53ad7a9b6d67ac209bf59a3126e1b2df85831fc25d8eea20ca9316eb8406bf35b8f8e4431af'
7
+ data.tar.gz: 925b3a97c776fabbc455069b68537c594e99bccd48025f4fddaa09920118114eb92acdfca64159abe4616c199d809718010131f7ebd16ce829554e14a7337aea
@@ -91,10 +91,14 @@ OptionParser.new do |opts|
91
91
  ENV['SKIP_WAIT'] = '1'
92
92
  end
93
93
 
94
- opts.on('--skip_wait') do
94
+ opts.on('--skip-wait') do
95
95
  ENV['SKIP_WAIT'] = '1'
96
96
  end
97
97
 
98
+ opts.on('--ignore-missing-ecs-config') do
99
+ ENV['IGNORE_MISSING_ECS_CONFIG'] = '1'
100
+ end
101
+
98
102
  end.parse!
99
103
 
100
104
  command = ARGV[0]
@@ -77,6 +77,10 @@ General options:
77
77
 
78
78
  --wait-async
79
79
 
80
- Default wait action is to wait for each individual resource to be stopped and started before continuing.
81
- This will enabled waiting for resources in groups based on priority. Option only useful when used with
82
- start-environment and stop-environment commands.
80
+ Default wait action is to wait for each individual resource to be stopped and started before continuing.
81
+ This will enabled waiting for resources in groups based on priority. Option only useful when used with
82
+ start-environment and stop-environment commands.
83
+
84
+ --ignore-missing-ecs-config
85
+
86
+ This option is required for starting a ecs service that was stopped outside of cfn_manage.
@@ -10,6 +10,7 @@ module CfnManage
10
10
  $log.info("Found #{@services.count} services in ECS cluster #{cluster_id}")
11
11
  @cluster = cluster_id
12
12
  @skip_wait = skip_wait
13
+ @ignore_missing_ecs_config = (ENV.key? 'IGNORE_MISSING_ECS_CONFIG' and ENV['IGNORE_MISSING_ECS_CONFIG'] == '1')
13
14
  end
14
15
 
15
16
  def start(configuration)
@@ -23,9 +24,19 @@ module CfnManage
23
24
  next
24
25
  end
25
26
 
26
- $log.info("Starting ECS service #{service.service_name} with desired count of #{configuration[service.service_name]['desired_count']}")
27
+ if configuration.has_key?(service.service_name)
28
+ desired_count = configuration[service.service_name]['desired_count']
29
+ elsif @ignore_missing_ecs_config
30
+ $log.info("ECS service #{service.service_name} wasn't previosly stopped by cfn_manage. Option --ignore-missing-ecs-config set and setting desired count to 1")
31
+ desired_count = 1
32
+ else
33
+ $log.warn("ECS service #{service.service_name} wasn't previosly stopped by cfn_manage. Skipping ...")
34
+ next
35
+ end
36
+
37
+ $log.info("Starting ECS service #{service.service_name} with desired count of #{desired_count}")
27
38
  @ecs_client.update_service({
28
- desired_count: configuration[service.service_name]['desired_count'],
39
+ desired_count: desired_count,
29
40
  service: service_arn,
30
41
  cluster: @cluster
31
42
  })
@@ -55,7 +66,7 @@ module CfnManage
55
66
 
56
67
  end
57
68
 
58
- return configuration
69
+ return configuration.empty? ? nil : configuration
59
70
  end
60
71
 
61
72
  def wait(completed_status)
@@ -1,3 +1,3 @@
1
1
  module CfnManage
2
- VERSION="0.5.0".freeze
2
+ VERSION="0.5.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn_manage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Base2Services
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-10-26 00:00:00.000000000 Z
13
+ date: 2018-11-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aws-sdk-core
@@ -333,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
333
333
  version: '0'
334
334
  requirements: []
335
335
  rubyforge_project:
336
- rubygems_version: 2.7.7
336
+ rubygems_version: 2.7.8
337
337
  signing_key:
338
338
  specification_version: 4
339
339
  summary: Manage AWS Cloud Formation stacks