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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69265ab31556f8e5e183ff64ce97bd771a7126ea
4
- data.tar.gz: 4ed7e202dc0dc4a1ccc7338b4869f2ea2d314c64
3
+ metadata.gz: 9f6f7c532a577c1197ee2c0a70e473768b6a62de
4
+ data.tar.gz: 5bc0353b28487ecbb350b018b1366f9e2e32cccf
5
5
  SHA512:
6
- metadata.gz: bb313cc3b14afc954f49518aafd2712fe2db1bde0fb03b3c12317ce6544c019f089bf867b469d65c01bf19f5667473e6e6ee4974603006a17f75a330164b1bf5
7
- data.tar.gz: 48654d38201f36f9659781cccc7b358b8417ddd5fe0647926f60cc6fecd5a5675e59cbeb2924234c7732a0f80a6d9487b221a252bba05ff79fef60dbebde0eb7
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
@@ -1,3 +1,3 @@
1
1
  module Nutkins
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutkins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pike