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 +4 -4
- data/lib/miriamtech/gocd/images.rb +3 -5
- data/lib/miriamtech/gocd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1644089687faade8c3498c5a7a60ccb4e72353bc37982f8c0acbd9271438797
|
4
|
+
data.tar.gz: 1ed5f8d02ae08b4bc3e1ccc03bc1f8794bf5fbede3fb5a2388aabe6211b6bff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
23
|
-
|
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
|