capdocker 1.0.26 → 1.0.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/capdocker.gemspec +1 -1
- data/lib/docker_deploy.rb +21 -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: f10c7841c5970dd9d3b604d76c6c3547cf6ef564
|
4
|
+
data.tar.gz: 96b7ce804ef885a370952c040909bba8db9744aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2136f09ad94c151de39dc46e0e40b94dd0c46f63a84447463554c81a33d05d45d4cbede78ab6eaef3c269709724ee9f36bebc7f3193eb785c2782d83d2d17814
|
7
|
+
data.tar.gz: 55f2c9a3c629172aa524635de220037caf82b862afcff24ff909eacada43f98a573eeb14c9aaa3e745bf95db5a46b96c62d08b28f1951b39bbf333f95cced1ef
|
data/capdocker.gemspec
CHANGED
data/lib/docker_deploy.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'capistrano/recipes/deploy'
|
2
|
-
|
3
1
|
Capistrano::Configuration.instance(:must_exist).load do
|
4
2
|
|
5
3
|
# Default Variables and Role
|
@@ -21,7 +19,28 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
21
19
|
after "deploy:update_code", "deploy:mount_shares"
|
22
20
|
after "deploy:update_code", "docker:build"
|
23
21
|
|
22
|
+
# logs the command then executes it locally.
|
23
|
+
# returns the command output as a string
|
24
|
+
def run_locally(cmd)
|
25
|
+
if dry_run
|
26
|
+
return logger.debug "executing locally: #{cmd.inspect}"
|
27
|
+
end
|
28
|
+
logger.trace "executing locally: #{cmd.inspect}" if logger
|
29
|
+
output_on_stdout = nil
|
30
|
+
elapsed = Benchmark.realtime do
|
31
|
+
output_on_stdout = `#{cmd}`
|
32
|
+
end
|
33
|
+
if $?.to_i > 0 # $? is command exit code (posix style)
|
34
|
+
raise Capistrano::LocalArgumentError, "Command #{cmd} returned status code #{$?}"
|
35
|
+
end
|
36
|
+
logger.trace "command finished in #{(elapsed * 1000).round}ms" if logger
|
37
|
+
output_on_stdout
|
38
|
+
end
|
39
|
+
|
40
|
+
|
24
41
|
|
42
|
+
# This is the manin deployment namespace
|
43
|
+
# default command gets run if invoked via `cap deploy`
|
25
44
|
namespace :deploy do
|
26
45
|
|
27
46
|
desc "Deploys the project to docker server."
|