simplygenius-atmos 0.11.6 → 0.11.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c93be3775fa963635eb0bd321ec575ba1d614443cc748b8e163026bc39e9bb6
4
- data.tar.gz: a2b4c8a63334617cd90c4171895dd983cc369f5ceb4fe87f9b8cff653f66da7f
3
+ metadata.gz: 9d9f77f7e442308682d210706de83bfa685bfb055c5ece17e6f036da45a99583
4
+ data.tar.gz: 764c4b6a7f8536badde7259ed19ebac6b8d7597f67d6d67befc7434ce2849bdf
5
5
  SHA512:
6
- metadata.gz: b99184520a48ed489c1981f19f9e179c62561358e072c56fe4fb2b37ed32cfe97aeb80604b371de0614aacb61b75f0f001d2f35bf538499a496f4b12fefd0592
7
- data.tar.gz: ee9183b0cf0c94aa315aead82412cc5f3c432b9b78ab5e73e610041f4b5ad2bb8d7728e9d67d8df09d7e014bc5e5c8f633f3b0968ba0071372de9db233938261
6
+ metadata.gz: 29df33fc0fcf298cae81cb1c80803ff8d6008e94680dad18a08d5b925d8b1b2b45b238a66f9ec7ed2cfb17adb111592c1ec0db3d3b152d6a0f7b81e87ddefe57
7
+ data.tar.gz: 20bba372d51af430e0e3f830e189466c68302a5b6f498eaf2915e2487e28554270ea88ff208e910799fd9c2ff723af407c9117ebfde7bc8bb6f7863ff6ffecb6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.11.7 (01/30/2020)
2
+ -------------------
3
+
4
+ * add ability to wait for a service to deploy [9448bd1](https://github.com/simplygenius/atmos/commit/9448bd1)
5
+ * force a shorter session duration when bootstrapping since the role to extend session has not been setup yet [c1b5394](https://github.com/simplygenius/atmos/commit/c1b5394)
6
+
1
7
  0.11.6 (01/03/2020)
2
8
  -------------------
3
9
 
@@ -57,6 +57,9 @@ module SimplyGenius
57
57
  option ["-v", "--revision"],
58
58
  "REVISION", "Use the given revision of the pushed image\nto activate\n"
59
59
 
60
+ option ["-w", "--wait"],
61
+ :flag, "Wait for service to become stable after deploy\nnon-zero exit on fail"
62
+
60
63
  option ["-l", "--list"],
61
64
  :flag, "List the most recent pushed images\n"
62
65
 
@@ -106,6 +109,12 @@ module SimplyGenius
106
109
  result[:task_definitions] << resp[:task_definition]
107
110
  end
108
111
 
112
+ if wait?
113
+ name_list.each do |name|
114
+ mgr.wait(cluster, name)
115
+ end
116
+ end
117
+
109
118
  logger.info "Container activated:\n #{display result}"
110
119
  end
111
120
  end
@@ -118,6 +127,9 @@ module SimplyGenius
118
127
  option ["-i", "--image"],
119
128
  "IMAGE", "The local container image to deploy\nDefaults to service/task name"
120
129
 
130
+ option ["-w", "--wait"],
131
+ :flag, "Wait for service to become stable after deploy\nnon-zero exit on fail"
132
+
121
133
  option ["-v", "--revision"],
122
134
  "REVISION", "Use as the remote image revision\n"
123
135
 
@@ -144,6 +156,12 @@ module SimplyGenius
144
156
  result[:task_definitions] << resp[:task_definition]
145
157
  end
146
158
 
159
+ if wait?
160
+ name_list.each do |name|
161
+ mgr.wait(cluster, name)
162
+ end
163
+ end
164
+
147
165
  logger.info "Container deployed:\n #{display result}"
148
166
  end
149
167
  end
@@ -49,6 +49,7 @@ module SimplyGenius
49
49
  if opts[:bootstrap] && Atmos.config.atmos_env != 'ops'
50
50
  # TODO: do this hack better
51
51
  assume_role_name = Atmos.config["auth.bootstrap_assume_role_name"]
52
+ @session_duration = 3600
52
53
  else
53
54
  assume_role_name = opts[:role] || Atmos.config["auth.assume_role_name"]
54
55
  end
@@ -98,6 +98,16 @@ module SimplyGenius
98
98
  return result
99
99
  end
100
100
 
101
+ def wait(cluster, service_name_or_task_arn)
102
+ ecs = ::Aws::ECS::Client.new
103
+ logger.info "Waiting for #{cluster}:#{service_name_or_task_arn} to stabilize"
104
+ if service_name_or_task_arn =~ /arn:aws:ecs:.*:task\/.*/
105
+ ecs.wait_until(:tasks_running, cluster: cluster, tasks: [service_name_or_task_arn])
106
+ else
107
+ ecs.wait_until(:services_stable, cluster: cluster, services: [service_name_or_task_arn])
108
+ end
109
+ end
110
+
101
111
  def remote_image(name, tag)
102
112
  ecr = ::Aws::ECR::Client.new
103
113
 
@@ -1,5 +1,5 @@
1
1
  module SimplyGenius
2
2
  module Atmos
3
- VERSION = "0.11.6"
3
+ VERSION = "0.11.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplygenius-atmos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.6
4
+ version: 0.11.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Conway
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-03 00:00:00.000000000 Z
11
+ date: 2020-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler