miriamtech-gocd 0.3.0 → 0.3.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
  SHA256:
3
- metadata.gz: 9f793b1d04ccfb06de74c6ce2cb193465fceab73cea6eec430fdba9fdc70914b
4
- data.tar.gz: d2cbd3b72c3eeef2dd71fa92cf5972cc585e9e68d86d9fd0475678324b500e84
3
+ metadata.gz: f1644089687faade8c3498c5a7a60ccb4e72353bc37982f8c0acbd9271438797
4
+ data.tar.gz: 1ed5f8d02ae08b4bc3e1ccc03bc1f8794bf5fbede3fb5a2388aabe6211b6bff4
5
5
  SHA512:
6
- metadata.gz: a6c30bad571ed57e23fe61a300c8994d19fa40edd697f33dc449a5669b97a2213f0d14db3cd9896b8bd36cc89728ae02bdfd0f27ab8c4e5d6d45b78bb4427597
7
- data.tar.gz: ab5fa74f84b309d6f5daabfaf5a157f54f0245c7e62284157a98c40d285bb8b88acab36c796b0d76e66d910307ef781771a834c27657225395cd93186bf6da85
6
+ metadata.gz: 3df65e863b02a9c02453f0f78f1ca58ff71cb7c462390c505d01b44461a2ce2a2f811fcf6ac186f5ecffeb8b6ae32a05c8371d397b149a08abbc496bccdf0e5e
7
+ data.tar.gz: 4f92f4a00e1a52c588107b9b0c88ce2f116c94b589b6f29f536a3061aaff2138ff8766871b2850f1935c6c1a13572d170320a64cd1331d4f46edbc954c52008d
@@ -18,11 +18,9 @@ module MiriamTech
18
18
 
19
19
  def cleanup_old_images(image_name, number_to_keep)
20
20
  images = `docker images --format '"{{.CreatedAt}}" id:{{.ID}}' #{image_name} | sort -r`.split("\n")
21
- images.each_with_index do |image, index|
22
- next if index >= number_to_keep
23
- match = image.match(/id:(.*)\z/)
24
- next unless match
25
- docker "image rm --force #{match[1]}"
21
+ images.collect { |each| each.split(':').last }.uniq.each_with_index do |image, index|
22
+ next if index <= number_to_keep
23
+ puts "docker image rm --force #{image}"
26
24
  end
27
25
  end
28
26
  end
@@ -1,5 +1,5 @@
1
1
  module MiriamTech
2
2
  module GoCD
3
- VERSION = '0.3.0'.freeze
3
+ VERSION = '0.3.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miriamtech-gocd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Treis