shiprails 0.1.16 → 0.1.18
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/shiprails/ship/deploy.rb +10 -4
- data/lib/shiprails/ship/exec.rb +9 -1
- data/lib/shiprails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a24cbe59501f02ce1177daad4400093997b3acd
|
4
|
+
data.tar.gz: 23ff9d829b9205196b746ff89e10d7d0bb3bacac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5608078535b5c5af45622e052690b73fe25b6aab9fe518060e499b1d5a57f2c7c911704c672c9025b80b39763cf9eba0e851f9e7896f2802d0b08cc380dc9be
|
7
|
+
data.tar.gz: 137894c44aa41c42063f1e1d0dd7354021ad79eb6d4255fe9c7439f60f051361da6e644fe7603a935a4a6610d1c4b625c9ff9ea604fe0a4e5bf46550471d2ba4
|
@@ -108,6 +108,7 @@ module Shiprails
|
|
108
108
|
|
109
109
|
def update_ecs_tasks
|
110
110
|
perform_callbacks :before_update_ecs_tasks
|
111
|
+
task_arn = nil
|
111
112
|
say "Updating ECS tasks..."
|
112
113
|
configuration[:services].each do |service_name, service|
|
113
114
|
image_name = "#{project_name}_#{service_name}"
|
@@ -146,12 +147,15 @@ module Shiprails
|
|
146
147
|
say "Updated #{service_name} container (#{image_name})."
|
147
148
|
end
|
148
149
|
task_definition_response = ecs.register_task_definition(task_definition)
|
150
|
+
if service_name == :app
|
151
|
+
task_arn = task_definition_response.task_definition.task_definition_arn
|
152
|
+
end
|
149
153
|
say "Updated #{task_name}.", :green
|
150
154
|
end
|
151
155
|
end
|
152
156
|
end
|
153
157
|
say "ECS tasks updated.", :green
|
154
|
-
perform_callbacks :after_update_ecs_tasks
|
158
|
+
perform_callbacks :after_update_ecs_tasks, task_arn
|
155
159
|
end
|
156
160
|
|
157
161
|
def update_ecs_services
|
@@ -237,11 +241,13 @@ module Shiprails
|
|
237
241
|
configuration[:config_s3_bucket]
|
238
242
|
end
|
239
243
|
|
240
|
-
def perform_callbacks(stage_name)
|
244
|
+
def perform_callbacks(stage_name, task_arn=nil)
|
241
245
|
@_callbacks ||= configuration[:callbacks] || {}
|
242
246
|
if @_callbacks.key?(stage_name)
|
243
|
-
command =
|
244
|
-
|
247
|
+
command = ["ship exec -e #{environment}"]
|
248
|
+
command << "--task-arn #{task_arn}" unless task_arn.nil?
|
249
|
+
command << @_callbacks[stage_name]
|
250
|
+
wrapped_command = command.join ' '
|
245
251
|
say "#{stage_name.to_s}: #{wrapped_command}"
|
246
252
|
result = run(wrapped_command)
|
247
253
|
exit(1) unless result
|
data/lib/shiprails/ship/exec.rb
CHANGED
@@ -24,6 +24,8 @@ module Shiprails
|
|
24
24
|
class_option "private-key",
|
25
25
|
aliases: ["-pk"],
|
26
26
|
desc: "Specify the AWS SSH private key path"
|
27
|
+
class_option "task-arn",
|
28
|
+
desc: "Specify the ECS task ARN"
|
27
29
|
|
28
30
|
def run_command
|
29
31
|
cluster_name = "#{project_name}_#{environment}"
|
@@ -92,7 +94,13 @@ module Shiprails
|
|
92
94
|
task_definition_arn = task_descriptions.tasks.first.task_definition_arn
|
93
95
|
task_definition_name = task_definition_arn.split('/').last
|
94
96
|
container_instance_arn = task_descriptions.tasks.first.container_instance_arn
|
95
|
-
|
97
|
+
|
98
|
+
task_arn = options['task-arn']
|
99
|
+
if task_arn.nil?
|
100
|
+
task_definition_description = ecs.describe_task_definition({task_definition: task_definition_name})
|
101
|
+
else
|
102
|
+
task_definition_description = ecs.describe_task_definition({task_definition: task_arn})
|
103
|
+
end
|
96
104
|
|
97
105
|
say "Setting up EC2 instance for SSH..."
|
98
106
|
# with the instance ARN let's grab the intance id
|
data/lib/shiprails/version.rb
CHANGED