dg 0.5.1 → 0.5.2
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/dg/docker.rb +25 -34
- data/lib/dg/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f2697a1942c1cec67fa2f558092e415ab6f258e
|
4
|
+
data.tar.gz: d024cc464d6141114383cc7ecc26707d167bfc1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0f8de197ce927c3ed31cf783f4636b63e514d194133f4bbe0c2ad2382f8ecc7dc23ca51e7231a9e372d0538609fd110390d66419c71203e5e68d89d85872089
|
7
|
+
data.tar.gz: aee5dfefd7f72ad46b6a677a22329a3fe4af32c0593e01adbcfa3b5754373c8819977241489f4c7d1944b1456e54f08fb6fa05e1940ef90db1a7ab85e4a32140
|
data/lib/dg/docker.rb
CHANGED
@@ -45,30 +45,13 @@ module DG
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def deploy_stages
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
else
|
56
|
-
error!(
|
57
|
-
RuntimeError.new(
|
58
|
-
%(Deploy-to script: "#{script}" must be executable! (e.g. chmod +x #{script}))
|
59
|
-
),
|
60
|
-
"determining stage to deploy to"
|
61
|
-
)
|
62
|
-
end
|
63
|
-
else
|
64
|
-
error!(
|
65
|
-
RuntimeError.new(
|
66
|
-
"There must be a deploy-to* script " +
|
67
|
-
"(e.g. deploy-to.{rb|sh|js}): #{candidates.size} found"
|
68
|
-
),
|
69
|
-
"determining stage to deploy to"
|
70
|
-
)
|
71
|
-
end
|
48
|
+
generate_fig_yaml
|
49
|
+
branch = ENV['GIT_BRANCH'] ||
|
50
|
+
`git symbolic-ref --short -q HEAD`.strip
|
51
|
+
|
52
|
+
run_with_output(
|
53
|
+
"fig -f #{FIG_GEN_PATH} run deployto", capture = true
|
54
|
+
).strip.split(',')
|
72
55
|
end
|
73
56
|
|
74
57
|
def run
|
@@ -93,18 +76,26 @@ module DG
|
|
93
76
|
exit 1
|
94
77
|
end
|
95
78
|
|
96
|
-
def run_with_output(command)
|
79
|
+
def run_with_output(command, capture = false)
|
97
80
|
sudo_command = SUDO ? "sudo -E bash -c '#{command}'" : command
|
98
81
|
puts "Running `#{sudo_command}` in #{Dir.pwd}"
|
99
|
-
|
100
|
-
|
101
|
-
|
82
|
+
if capture
|
83
|
+
return `#{command}`
|
84
|
+
else
|
85
|
+
begin
|
86
|
+
PTY.spawn(sudo_command) do |stdin, stdout, pid|
|
87
|
+
stdin.each { |line| print line } rescue Errno::EIO
|
88
|
+
Process.wait(pid)
|
89
|
+
end
|
90
|
+
status_code = $?.exitstatus
|
91
|
+
|
92
|
+
error!(RuntimeError.new("exit code was #{status_code}"), "executing #{command}") if status_code != 0
|
93
|
+
|
94
|
+
return status_code
|
95
|
+
rescue PTY::ChildExited
|
96
|
+
puts "The child process exited!"
|
97
|
+
end
|
102
98
|
end
|
103
|
-
status_code = $?.exitstatus
|
104
|
-
|
105
|
-
error!(RuntimeError.new("exit code was #{status_code}"), "executing #{command}") if status_code != 0
|
106
|
-
rescue PTY::ChildExited
|
107
|
-
puts "The child process exited!"
|
108
99
|
end
|
109
100
|
|
110
101
|
def fig_yml
|
@@ -125,7 +116,7 @@ module DG
|
|
125
116
|
# Add the git commit hash to the image name
|
126
117
|
def git_image_name
|
127
118
|
@@git_image_name ||=
|
128
|
-
"#{image_name}:#{ENV['
|
119
|
+
"#{image_name}:#{ENV['GO_REVISION_#{MATERIAL_NAME}'] ||
|
129
120
|
`git rev-parse HEAD`.strip}"
|
130
121
|
end
|
131
122
|
|
data/lib/dg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Malet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
DockerGo (DG)
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.
|
59
|
+
rubygems_version: 2.4.3
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: Provides integration between Docker and GoCD.
|