ecs_helper 0.0.16 → 0.0.20
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/lib/ecs_helper/command/build_and_push.rb +0 -6
- data/lib/ecs_helper/command/deploy.rb +3 -3
- data/lib/ecs_helper/command/ecr_login.rb +0 -6
- data/lib/ecs_helper/common_helper.rb +1 -0
- data/lib/ecs_helper/logging.rb +2 -2
- data/lib/ecs_helper/task_definition_helper.rb +3 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d05ce978784d1c02d0f7efe1cc4ab9391e966cced3173da83d493c302986fd50
|
4
|
+
data.tar.gz: ce2fad2f9f61369ce063826779f11bb8c65396876ed1f90d7c6bf643fb135253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6fed82da13e7462d2064620936d511005888393a66481f694523b841a02a90af566a83946366c4df5bddbc4e4107543bfaa5b442237a2bf923c67750643513c
|
7
|
+
data.tar.gz: e3d0eef470cc0fcf49ed895e53df0d692506c4f7178e8ab1225b1d239ddf21f987229a295cc5192a340d3b974c1fb3418c9bd8de1235845b9d13736e0b53479f
|
@@ -24,17 +24,11 @@ class ECSHelper::Command::BuildAndPush < ECSHelper::Command::Base
|
|
24
24
|
log("Options", options)
|
25
25
|
log("Repository", repository)
|
26
26
|
log("Auth Private", auth_private)
|
27
|
-
log("Auth Public", auth_public)
|
28
27
|
should_cache? && log("Pull", pull)
|
29
28
|
log("Build", build)
|
30
29
|
log("Push", push)
|
31
30
|
end
|
32
31
|
|
33
|
-
def auth_public
|
34
|
-
auth_cmd = Terrapin::CommandLine.new("aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws")
|
35
|
-
auth_cmd.run
|
36
|
-
end
|
37
|
-
|
38
32
|
def auth_private
|
39
33
|
auth_cmd = Terrapin::CommandLine.new("aws ecr get-login --no-include-email | sh")
|
40
34
|
auth_cmd.run
|
@@ -34,14 +34,14 @@ class ECSHelper::Command::Deploy < ECSHelper::Command::Base
|
|
34
34
|
log("Service task definition", service_task_definition.task_definition_arn)
|
35
35
|
log("Containers", task_definition_helper.pretty_container_definitions)
|
36
36
|
log("New task definition", new_task_definition.task_definition_arn)
|
37
|
-
update_service(new_task_definition.task_definition_arn) && log("Update service", "Service task definition was updated")
|
37
|
+
update_service(new_task_definition.task_definition_arn, service_task_definition.task_definition_arn) && log("Update service", "Service task definition was updated")
|
38
38
|
log("Waiting for deployment...")
|
39
39
|
wait_for_deployment && log("Success", "Application was succesfully deployed", :cyan)
|
40
40
|
end
|
41
41
|
|
42
|
-
def update_service(task_definition_arn)
|
42
|
+
def update_service(task_definition_arn, old_task_definition_arn)
|
43
43
|
helper.update_service(cluster_arn, service_arn, task_definition_arn)
|
44
|
-
helper.client.deregister_task_definition(task_definition:
|
44
|
+
helper.client.deregister_task_definition(task_definition: old_task_definition_arn)
|
45
45
|
end
|
46
46
|
|
47
47
|
def wait_for_deployment(time = 0)
|
@@ -17,12 +17,6 @@ class ECSHelper::Command::ECRLogin < ECSHelper::Command::Base
|
|
17
17
|
def run
|
18
18
|
log("Command", type)
|
19
19
|
log("Auth Private", auth_private)
|
20
|
-
log("Auth Public", auth_public)
|
21
|
-
end
|
22
|
-
|
23
|
-
def auth_public
|
24
|
-
auth_cmd = Terrapin::CommandLine.new("aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws")
|
25
|
-
auth_cmd.run
|
26
20
|
end
|
27
21
|
|
28
22
|
def auth_private
|
data/lib/ecs_helper/logging.rb
CHANGED
@@ -41,7 +41,7 @@ class ECSHelper::TaskDefinitionHelper
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def container_definition_to_ecr(cd)
|
44
|
-
repo = repo_for(cd
|
44
|
+
repo = repo_for(cd)
|
45
45
|
is_ecr = cd.image.include?(ecr_base)
|
46
46
|
image = repo && version_image(repo)
|
47
47
|
should_update = is_ecr && repo && image
|
@@ -58,18 +58,9 @@ class ECSHelper::TaskDefinitionHelper
|
|
58
58
|
|
59
59
|
private
|
60
60
|
|
61
|
-
def
|
62
|
-
repo = repo_for(cd.name)
|
63
|
-
is_ecr = cd.image.include?(ecr_base)
|
64
|
-
image = repo && version_image(repo)
|
65
|
-
should_update = is_ecr && repo && image
|
66
|
-
[repo, is_ecr, image, should_update]
|
67
|
-
end
|
68
|
-
|
69
|
-
def repo_for(name)
|
61
|
+
def repo_for(cd)
|
70
62
|
repositories.find do |r|
|
71
|
-
|
72
|
-
uri.include?(helper.application) && uri.include?(helper.project) && uri.include?(name)
|
63
|
+
cd.image.include?(r.repository_uri)
|
73
64
|
end
|
74
65
|
end
|
75
66
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecs_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Petrov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-ecs
|