deployme 0.2.0 → 0.2.1
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/deployme/providers/ecs.rb +22 -22
- data/lib/deployme/version.rb +1 -1
- 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: 2092ec13e1c2ec3da76e08c519ac38f4bfce73dad9533ff693057c41251a5fe0
|
4
|
+
data.tar.gz: 72b15d3d59fc554bb2dc5ae6189911f10fc9f7b3b2487f67bb7ad35875006cdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825126a97858836951c81b1f3dcece404d55b3fc857d9be292ef840f6f308a5663d53d16e9567dfb0a4e2cf7b3b549fe836010f0165c1c2d2c8da2393c04407d
|
7
|
+
data.tar.gz: 5ecd9848f6a8163e95dae1fb9b1f00292f468d4d6957769609ede0b1588d2e48d67c87d31c1cd3547067a3cd705d7fec2061feefbd8e462cc43c9546be5497ff
|
@@ -55,7 +55,7 @@ module Deployme
|
|
55
55
|
end
|
56
56
|
rescue Aws::Waiters::Errors::WaiterFailed => error
|
57
57
|
logger.error "failed waiting for service: #{error.message}"
|
58
|
-
|
58
|
+
raise('Failed to deploy')
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -64,7 +64,7 @@ module Deployme
|
|
64
64
|
failures.each do |failure|
|
65
65
|
STDERR.puts "Error: run task failure '#{failure.reason}'"
|
66
66
|
end
|
67
|
-
|
67
|
+
raise('Failed to deploy')
|
68
68
|
end
|
69
69
|
|
70
70
|
# handle one off tasks
|
@@ -72,11 +72,12 @@ module Deployme
|
|
72
72
|
config.fetch(:one_off_commands, []).each do |one_off_command|
|
73
73
|
task_definition = task_definitions[one_off_command[:task_family].to_sym]
|
74
74
|
logger.info "Running '#{one_off_command[:command]}'"
|
75
|
+
|
75
76
|
response = client.run_task(
|
76
77
|
cluster: options.ecs_cluster,
|
77
78
|
task_definition: task_definition[:arn],
|
78
79
|
count: 1,
|
79
|
-
started_by:
|
80
|
+
started_by: 'ecs-deploy: one_off_commands',
|
80
81
|
overrides: {
|
81
82
|
container_overrides: [
|
82
83
|
{
|
@@ -90,28 +91,27 @@ module Deployme
|
|
90
91
|
report_run_task_failures(response.failures)
|
91
92
|
|
92
93
|
task_arn = response.tasks.first.task_arn
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
last_now = now
|
104
|
-
sleep 5
|
105
|
-
end
|
106
|
-
if waiting > 1800
|
107
|
-
STDERR.puts "Error: wait time exceeded"
|
108
|
-
exit 1
|
94
|
+
logger.info "Task: #{task_arn}"
|
95
|
+
begin
|
96
|
+
client.wait_until(:tasks_stopped, cluster: options.ecs_cluster, tasks: [task_arn]) do |w|
|
97
|
+
w.before_wait do
|
98
|
+
logger.info 'Waiting for task to finish...'
|
99
|
+
end
|
100
|
+
end
|
101
|
+
rescue Aws::Waiters::Errors::WaiterFailed => error
|
102
|
+
logger.error "failed waiting for task: #{error.message}"
|
103
|
+
raise('Failed to deploy')
|
109
104
|
end
|
110
|
-
|
105
|
+
|
106
|
+
task = client.describe_tasks(tasks: [task_arn], cluster: options.ecs_cluster).tasks.first
|
107
|
+
container = task.containers.find { |c| c.name == task_definition[:container_definitions].first[:name] }
|
108
|
+
if container.exit_code != 0
|
111
109
|
STDERR.puts "Error: '#{one_off_command[:command]}' finished with a non-zero exit code! Aborting."
|
112
|
-
|
110
|
+
STDERR.puts "Exit code: #{task.containers.first.exit_code}"
|
111
|
+
STDERR.puts " #{task.containers.first.reason}"
|
112
|
+
raise('Failed to deploy')
|
113
113
|
end
|
114
|
-
puts
|
114
|
+
puts ' done!'
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
data/lib/deployme/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deployme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikko Kokkonen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-ecs
|