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 +4 -4
- data/bin/cfn_manage +5 -1
- data/bin/usage.txt +7 -3
- data/lib/cfn_manage/ecs_cluster_start_stop_handler.rb +14 -3
- data/lib/cfn_manage/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aeef944e140719abc696e29afb06aa3ea2677ab6504e688e987040c56a95771
|
4
|
+
data.tar.gz: 1fcc7ec53f48c15336699b01f5acc239089c1f2479571413c0bab30abd0559e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '085fbba038d07fcc2eb4287dd5ed851bf22aafc8a34a682e6e0ea53ad7a9b6d67ac209bf59a3126e1b2df85831fc25d8eea20ca9316eb8406bf35b8f8e4431af'
|
7
|
+
data.tar.gz: 925b3a97c776fabbc455069b68537c594e99bccd48025f4fddaa09920118114eb92acdfca64159abe4616c199d809718010131f7ebd16ce829554e14a7337aea
|
data/bin/cfn_manage
CHANGED
@@ -91,10 +91,14 @@ OptionParser.new do |opts|
|
|
91
91
|
ENV['SKIP_WAIT'] = '1'
|
92
92
|
end
|
93
93
|
|
94
|
-
opts.on('--
|
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]
|
data/bin/usage.txt
CHANGED
@@ -77,6 +77,10 @@ General options:
|
|
77
77
|
|
78
78
|
--wait-async
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
|
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
|
-
|
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:
|
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)
|
data/lib/cfn_manage/version.rb
CHANGED
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.
|
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-
|
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.
|
336
|
+
rubygems_version: 2.7.8
|
337
337
|
signing_key:
|
338
338
|
specification_version: 4
|
339
339
|
summary: Manage AWS Cloud Formation stacks
|