deployme 0.1.7.1 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/core_ext/aws_ecs_client.rb +6 -4
- data/lib/deployme/providers/ecs.rb +14 -2
- data/lib/deployme/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88a687ff8a42bb4bf51888ea7a1c06a71fcc1ab1e643e27a37e4428fa6b1f8e
|
4
|
+
data.tar.gz: cb118e9220e28dc1bf457f589d1d7cd8db6b2b3f0f4633beddf56a20ced5f722
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e0aaa3ddf5da73656bdfce837c08816739fa987c9149178adebf7078958ce59240d37749e3db05fa0f756ed9bbe6693a572f538eca1bfb19d9ca8f396e55d97
|
7
|
+
data.tar.gz: 5f04ced6a281f9520ef1ffefb50ef6556ff8f582adf3f36dccd8bd86b3956bddc68dcc741c8083d0eb1c700e1daca9601b76634b2bee8336dd0679ac6ce9a5fe
|
@@ -2,9 +2,11 @@ require 'aws-sdk-ecs'
|
|
2
2
|
|
3
3
|
class Aws::ECS::Client # rubocop:disable Style/ClassAndModuleChildren
|
4
4
|
def upsert_service(options)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
if describe_services(cluster: options[:cluster], services: [options[:service]]).services.count.zero?
|
6
|
+
options[:service_name] = options.delete(:service)
|
7
|
+
send(:create_service, options)
|
8
|
+
else
|
9
|
+
send(:update_service, options)
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
@@ -5,7 +5,7 @@ module Deployme
|
|
5
5
|
class Ecs < Provider
|
6
6
|
def self.options(parser)
|
7
7
|
parser.on('--ecs-image=IMAGE_TAG', String, 'Image tag to use for deployment') { |options, value| options.ecs_image = value }
|
8
|
-
parser.on('--ecs-cluster=NAME', String, 'ECS Cluster name to deploy to')
|
8
|
+
parser.on('--ecs-cluster=NAME', String, 'ECS Cluster name to deploy to') { |options, value| options.ecs_cluster = value }
|
9
9
|
end
|
10
10
|
|
11
11
|
def execute
|
@@ -30,7 +30,7 @@ module Deployme
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def register_services
|
33
|
-
config[:services].
|
33
|
+
services = config[:services].map do |service|
|
34
34
|
logger.info "Registering Service #{service[:name]}"
|
35
35
|
task_definition = task_definitions[service[:task_family].to_sym]
|
36
36
|
|
@@ -43,6 +43,18 @@ module Deployme
|
|
43
43
|
)
|
44
44
|
|
45
45
|
logger.info "Success: #{response.service.status}"
|
46
|
+
response.service.service_arn
|
47
|
+
end
|
48
|
+
|
49
|
+
begin
|
50
|
+
client.wait_until(:services_stable, cluster: options.ecs_cluster, services: services) do |w|
|
51
|
+
w.before_wait do
|
52
|
+
logger.info 'Waiting for services to stable...'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
rescue Aws::Waiters::Errors::WaiterFailed => error
|
56
|
+
logger.error "failed waiting for service: #{error.message}"
|
57
|
+
exit(1)
|
46
58
|
end
|
47
59
|
end
|
48
60
|
|
data/lib/deployme/version.rb
CHANGED