fidoci 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c7383d0a36cc9491caea846a4a1554a692e866c
4
- data.tar.gz: 57517f8b162f38ed5a7947219637ae85a2705d33
3
+ metadata.gz: 3c0a4c8ac5bb0ee9815e811ee7ac2008b5151522
4
+ data.tar.gz: 3e5346e307739072c6d5033637486a36e30bc035
5
5
  SHA512:
6
- metadata.gz: b69803fc8a02b3e5a5934686c54ab289268994e82f6cf3d2b1d134d020f9c1ea26786238a74687f5132fe6a8321e9c19c67daf18c854b770e0310bb88fa960a5
7
- data.tar.gz: 3f7e1720a5f2d0f6c4578cfb9c0fd7a70f1894f8d33628675824f9d79f74af6002c3d811f4c76667b9fc1baa8d6d5ae935834eac2f9a5489366422c70b4b7147
6
+ metadata.gz: 049af0b54f5a8103fd900643ad3a2a0e34be8ea587ac6bc464dc1370b18e04939acb77deef10e515a46323ce9d41e562921d92157c9ad8a46fa38224bacd0199
7
+ data.tar.gz: 1d26968117084c495dc55b1c2613a5397812c9ec4100e4f5b3a5e1f66f6949a8555eff0bebc59226cbf30d846c13d1a79272e38f607e0332d0d6b90a6c522892
data/lib/fidoci/env.rb CHANGED
@@ -32,6 +32,10 @@ module Fidoci
32
32
  "%s:%s" % [@image, @name]
33
33
  end
34
34
 
35
+ def clean_image!
36
+ system "docker rmi -f #{image_name}"
37
+ end
38
+
35
39
  def image_exists?
36
40
  images = `docker images`
37
41
  images_names = images.split("\n").drop(1).map{|line|
data/lib/fidoci/main.rb CHANGED
@@ -42,7 +42,7 @@ module Fidoci
42
42
 
43
43
  (config.keys - ['image']).each { |name|
44
44
  env = env(name)
45
- system "docker rmi -f #{env.image_name}"
45
+ env.clean_image!
46
46
  }
47
47
  end
48
48
 
@@ -51,14 +51,16 @@ module Fidoci
51
51
  # do_clean - if true, will do clean after build (whether successful or not)
52
52
  def build(tag, do_clean = false)
53
53
  test_env = env(:test)
54
+ test_env.clean_image!
54
55
  success = test_env.commands
55
56
 
56
57
  if success
57
58
  system "docker tag #{test_env.image_name} #{repository_name}:#{tag}"
58
59
  end
59
60
 
60
- clean if do_clean
61
61
  success
62
+ ensure
63
+ clean if do_clean
62
64
  end
63
65
  end
64
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fidoci
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Dolezal