docker-rails 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docker/rails/app.rb +7 -5
- data/lib/docker/rails/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: 4bea08b80bfee7c817a0d284f58c74cc0e61638e
|
4
|
+
data.tar.gz: f653e9e076dc95d265cb2c0ad6aefe2735f0bc2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41d7d30694f656d154ab484fea66222188bd564516eb40fddbefc07dde15eed7971a600bdc6e0af5ce549b943cd15860ddef44c810b3c897e11ac7f9da54c595
|
7
|
+
data.tar.gz: 980a7d3cd628c9100ef9fd6b0a65fd834a0a4b1c221a7c40004a42ad233ebcd01870333e54d8e922baa96b1fe8864b8e3cad85733b19e6b7ad03a411d2838d54
|
data/lib/docker/rails/app.rb
CHANGED
@@ -247,8 +247,10 @@ module Docker
|
|
247
247
|
puts '-----------------------------'
|
248
248
|
|
249
249
|
list_images_cmd = 'docker images --filter dangling=true -q'
|
250
|
-
output = exec list_images_cmd, true
|
251
|
-
|
250
|
+
output = exec( list_images_cmd, true)
|
251
|
+
|
252
|
+
# if there are any dangling, let's clean them up.
|
253
|
+
exec("#{list_images_cmd} | xargs docker rmi", false, true) if !output.nil? && output.length > 0
|
252
254
|
puts 'Done.'
|
253
255
|
end
|
254
256
|
|
@@ -284,7 +286,7 @@ module Docker
|
|
284
286
|
|
285
287
|
protected
|
286
288
|
|
287
|
-
def exec(cmd, capture = false)
|
289
|
+
def exec(cmd, capture = false, ignore_errors = false)
|
288
290
|
puts "Running `#{cmd}`" if verbose?
|
289
291
|
if capture
|
290
292
|
output = %x[#{cmd}]
|
@@ -292,13 +294,13 @@ module Docker
|
|
292
294
|
system cmd
|
293
295
|
end
|
294
296
|
|
295
|
-
raise "Failed to execute: `#{cmd}`" unless $?.success?
|
297
|
+
(raise "Failed to execute: `#{cmd}`" unless $?.success?) unless ignore_errors
|
296
298
|
output
|
297
299
|
end
|
298
300
|
|
299
301
|
# convenience to execute docker-compose with file and project params
|
300
302
|
def exec_compose(cmd, capture = false, options = '')
|
301
|
-
exec("docker-compose -f #{@compose_filename} -p #{@
|
303
|
+
exec("docker-compose -f #{@compose_filename} -p #{@project_name} #{cmd} #{options}", capture)
|
302
304
|
end
|
303
305
|
|
304
306
|
def get_container(service_name)
|
data/lib/docker/rails/version.rb
CHANGED