nutkins 0.8.0 → 0.8.1
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/nutkins/docker_builder.rb +5 -4
- data/lib/nutkins/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: 9f6f7c532a577c1197ee2c0a70e473768b6a62de
|
|
4
|
+
data.tar.gz: 5bc0353b28487ecbb350b018b1366f9e2e32cccf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df4a28b2f1e73a0002925ba716cf07f3123dfe2b8e73ae395869efc5fcb7f47efcb1d908f8370380058b6137a71491c83eca7bacd7f12db1e7104bb0346bb505
|
|
7
|
+
data.tar.gz: eee76a3dbf64326de23f47eb0056261d32eaabd908faa00b9538178d31de321e5ed61d70260fe45a13638de15fed6eb109188cf9a7114d47f494d0b58bd304e2
|
|
@@ -16,7 +16,7 @@ module Nutkins::DockerBuilder
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
# the base image to start rebuilding from
|
|
19
|
-
parent_img_id = base
|
|
19
|
+
parent_img_id = Nutkins::Docker.get_short_commit Nutkins::Docker.container_id_for_name(base)
|
|
20
20
|
pwd = Dir.pwd
|
|
21
21
|
begin
|
|
22
22
|
Dir.chdir cfg["directory"]
|
|
@@ -57,7 +57,7 @@ module Nutkins::DockerBuilder
|
|
|
57
57
|
unless cache_is_dirty
|
|
58
58
|
# searches the commit messages of all images for the one matching the expected
|
|
59
59
|
# cache entry for the given content
|
|
60
|
-
cache_img_id = find_cached_img_id run_shell_cmd
|
|
60
|
+
cache_img_id = find_cached_img_id parent_img_id, run_shell_cmd
|
|
61
61
|
|
|
62
62
|
if cache_img_id
|
|
63
63
|
puts "cached: #{run_args}"
|
|
@@ -106,11 +106,12 @@ module Nutkins::DockerBuilder
|
|
|
106
106
|
Nutkins::Docker.run 'tag', parent_img_id, cfg['tag']
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
-
def self.find_cached_img_id command
|
|
109
|
+
def self.find_cached_img_id parent_img_id, command
|
|
110
110
|
all_images = Nutkins::Docker.run_get_stdout('images', '-aq').split("\n")
|
|
111
111
|
images_meta = JSON.parse(Nutkins::Docker.run_get_stdout('inspect', *all_images))
|
|
112
112
|
images_meta.each do |image_meta|
|
|
113
|
-
if image_meta.dig('ContainerConfig', 'Cmd') == command
|
|
113
|
+
if image_meta.dig('ContainerConfig', 'Cmd') == command and
|
|
114
|
+
Nutkins::Docker.get_short_commit(image_meta['Parent']) == parent_img_id
|
|
114
115
|
return Nutkins::Docker.get_short_commit(image_meta['Id'])
|
|
115
116
|
end
|
|
116
117
|
end
|
data/lib/nutkins/version.rb
CHANGED