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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8bb03ecaa4b2e1e89ee181b4ce253cdd8195a1cf74d0f3dca2210a836054084
4
- data.tar.gz: dc22fb87a15d211095c310b7da626357112e547d3f8a736a12f0188f9c9d41e7
3
+ metadata.gz: d05ce978784d1c02d0f7efe1cc4ab9391e966cced3173da83d493c302986fd50
4
+ data.tar.gz: ce2fad2f9f61369ce063826779f11bb8c65396876ed1f90d7c6bf643fb135253
5
5
  SHA512:
6
- metadata.gz: 2629aac57e9f59ad727ec38121a5a1893041e93941642fa198d764ff53503a9ff3cb76ae3e0f2973f9c67f5676c014c48ba37ecadb8215228fe1515a90cf3a80
7
- data.tar.gz: b65082412c27def32ad767f1cb315e5f0f95306f4bc7a4d2f0f021d18776dc7abadbf74f413c0ed6cd8013b0b1f196f4297554fc556a29eceeca085b3949a272
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: task_definition_arn)
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
@@ -1,6 +1,7 @@
1
1
  BRANCH_TO_ENV_MAPPING = {
2
2
  master: 'production',
3
3
  qa: 'qa',
4
+ uat: 'uat',
4
5
  staging: 'staging',
5
6
  demo: 'demo',
6
7
  }
@@ -8,9 +8,9 @@ module ECSHelper::Logging
8
8
  end
9
9
  end
10
10
 
11
- def error(message)
11
+ def error(message, code = 1)
12
12
  puts "Error".red
13
13
  puts message
14
- exit
14
+ exit code
15
15
  end
16
16
  end
@@ -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.name)
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 container_definition_to_ecr(cd)
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
- uri = r.repository_uri
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.16
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-06-22 00:00:00.000000000 Z
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