rory-deploy 1.8.4.2 → 1.8.4.3
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/CONTRIBUTORS.md +1 -0
- data/lib/centurion/deploy.rb +10 -0
- data/lib/centurion/deploy_dsl.rb +4 -0
- data/lib/centurion/docker_server.rb +1 -1
- data/lib/centurion/docker_via_cli.rb +8 -0
- data/lib/centurion/version.rb +1 -1
- data/lib/tasks/deploy.rake +10 -2
- 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: 2ae900af42a7bac7015b1afe468e9a4592f85766
|
4
|
+
data.tar.gz: e2a9c1e2e1397bc1a20b86854f0166f7070c4421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6926cecb3da929ee042dbf3d0e70aacb440f34207b5ddda4ebfaccccc62a11ba27d994eaf6944d489e1b76a04d2322b866765171c0a78f6c026c3900a4530b7
|
7
|
+
data.tar.gz: f6e6a5e4e7be674597b91c9360eb3e4dd4a75c40828df237d3b17a4637c2ca73c682e6ba0fe07b44c0e3bb6173518558066b9b3cd9829894168f1392e2a04fb2
|
data/CONTRIBUTORS.md
CHANGED
data/lib/centurion/deploy.rb
CHANGED
@@ -126,4 +126,14 @@ module Centurion::Deploy
|
|
126
126
|
|
127
127
|
server.attach(container['Id'])
|
128
128
|
end
|
129
|
+
|
130
|
+
def enter_container(server, service)
|
131
|
+
container = if service.public_ports.nil? || service.public_ports.empty?
|
132
|
+
server.find_containers_by_name(service.name).first
|
133
|
+
else
|
134
|
+
server.find_containers_by_public_port(service.public_ports.first).first
|
135
|
+
end
|
136
|
+
|
137
|
+
server.exec_it(container["Id"], "/bin/bash")
|
138
|
+
end
|
129
139
|
end
|
data/lib/centurion/deploy_dsl.rb
CHANGED
@@ -8,6 +8,10 @@ module Centurion::DeployDSL
|
|
8
8
|
build_server_group.tap { |hosts| hosts.each { |host| block.call(host) } }
|
9
9
|
end
|
10
10
|
|
11
|
+
def on_first_docker_host(&block)
|
12
|
+
build_server_group.tap { |hosts| block.call(hosts.first) }
|
13
|
+
end
|
14
|
+
|
11
15
|
def env_vars(new_vars)
|
12
16
|
current = fetch(:env_vars, {})
|
13
17
|
new_vars.each_pair do |new_key, new_value|
|
@@ -16,7 +16,7 @@ class Centurion::DockerServer
|
|
16
16
|
def_delegators :docker_via_api, :create_container, :inspect_container,
|
17
17
|
:inspect_image, :ps, :start_container, :stop_container,
|
18
18
|
:remove_container, :restart_container
|
19
|
-
def_delegators :docker_via_cli, :pull, :tail, :attach, :exec
|
19
|
+
def_delegators :docker_via_cli, :pull, :tail, :attach, :exec, :exec_it
|
20
20
|
|
21
21
|
def initialize(host, docker_path, tls_params = {})
|
22
22
|
@docker_path = docker_path
|
@@ -31,6 +31,14 @@ class Centurion::DockerViaCli
|
|
31
31
|
Centurion::Shell.echo(build_command(:exec, "#{container_id} #{commandline}"))
|
32
32
|
end
|
33
33
|
|
34
|
+
def exec_it(container_id, commandline)
|
35
|
+
# the "or true" on the command is to prevent an exception from Shell.validate_status
|
36
|
+
# because docker exec returns the same exit code as the latest command executed on
|
37
|
+
# the shell, which causes an exception to be raised if the latest comand executed
|
38
|
+
# was unsuccessful when you exit the shell.
|
39
|
+
Centurion::Shell.echo(build_command(:exec, "-it #{container_id} #{commandline} || true"))
|
40
|
+
end
|
41
|
+
|
34
42
|
private
|
35
43
|
|
36
44
|
def self.tls_keys
|
data/lib/centurion/version.rb
CHANGED
data/lib/tasks/deploy.rake
CHANGED
@@ -12,7 +12,7 @@ end
|
|
12
12
|
|
13
13
|
task :deploy_console do
|
14
14
|
invoke 'deploy:get_image'
|
15
|
-
invoke 'deploy:stop'
|
15
|
+
#invoke 'deploy:stop'
|
16
16
|
invoke 'deploy:launch_console'
|
17
17
|
invoke 'deploy:cleanup'
|
18
18
|
end
|
@@ -24,6 +24,7 @@ task :rolling_deploy do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
task :stop => ['deploy:stop']
|
27
|
+
task :enter_container => ['deploy:enter_container']
|
27
28
|
|
28
29
|
namespace :dev do
|
29
30
|
task :export_only do
|
@@ -106,11 +107,18 @@ namespace :deploy do
|
|
106
107
|
end
|
107
108
|
|
108
109
|
task :launch_console do
|
109
|
-
|
110
|
+
on_first_docker_host do |server|
|
111
|
+
defined_service.port_bindings.clear
|
110
112
|
launch_console(server, defined_service)
|
111
113
|
end
|
112
114
|
end
|
113
115
|
|
116
|
+
task :enter_container do
|
117
|
+
on_first_docker_host do |server|
|
118
|
+
enter_container(server, defined_service)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
114
122
|
task :rolling_deploy do
|
115
123
|
on_each_docker_host do |server|
|
116
124
|
service = defined_service
|