fig-lock 0.0.8 → 0.0.9

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: 6082fc690c9c623864c00802f36b94c22d3db828
4
- data.tar.gz: 9d237cb409ee76286dfae5f8e2df5ad03cb220d9
3
+ metadata.gz: fdf7b2e8a7f23e93d3ff059406fa5f9a9fdd621d
4
+ data.tar.gz: b8926d1ef7bbb4c26f4907b6d668147c33fe8485
5
5
  SHA512:
6
- metadata.gz: 29f62424d2490aa223548a33a81c130f802cd39271a950a793ec3d1f847c25fddfd8589de8d337af6bac36fd7522c68e46d6ecc1d6e8a70891f88ac6fcf8e95c
7
- data.tar.gz: 7d87d6633eb97cd6f2e7c277088308e1a8867798a594371afa0a5f90d7b4af6be34082f132b5cdf602cf3513af618d4caa6ba7b51d97bbf192d93792d0bf388b
6
+ metadata.gz: c51780e7a3dacd769a0e0466107a700f4f9843a9df67b23cfb99605eacef3794f66183984096f343dc6f9cc69eea329736371021a5af5bbc0122681526b8edf8
7
+ data.tar.gz: 2d472e31040f166b85d99fa5fa81bb56a527b115145250a5650aff8c7bfdf270429129b6e967f7fb4635aea6f14d84f7026af7a21ae093cf1b5abe5d95cf4230
@@ -70,6 +70,8 @@ module Fig
70
70
 
71
71
  resolved_tags = {}
72
72
 
73
+ old_lock_yaml = lock_yaml
74
+
73
75
  hash.each do |k,v|
74
76
  image = v['image']
75
77
  image = "#{image}:latest" unless image.index(':')
@@ -87,7 +89,6 @@ module Fig
87
89
 
88
90
  # Figure out which one corresponds to "latest"
89
91
  version = tags.detect{|k,v|
90
- puts "#{k}: #{v}"
91
92
  v == latest && k != 'latest'
92
93
  }
93
94
  version = version[0] if version
@@ -99,16 +100,22 @@ module Fig
99
100
  end
100
101
 
101
102
  # Update hash
102
- if v['image'] == result
103
- log.info "Component #{k} already using #{result}"
103
+ v['image'] = result
104
+ if old_lock_yaml && old_lock_yaml[k] && old_lock_yaml[k]['image'] == result
105
+ log.debug "Component #{k} already using tag: #{result}"
104
106
  else
105
- log.info "Component #{k} updated to #{result}"
106
- v['image'] = result
107
+ log.info "Component #{k} updated to tag: #{result}"
107
108
  end
108
109
  end
109
110
  end
110
111
  end
111
112
 
113
+ def lock_yaml
114
+ if File.exists?(lock_file)
115
+ YAML.load(File.read(lock_file))
116
+ end
117
+ end
118
+
112
119
  # Fetch all images from the fig hash.
113
120
  def fetch_images(hash)
114
121
  log.info "Fetching images:"
@@ -1,5 +1,5 @@
1
1
  module Fig
2
2
  class Lock
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
@@ -31,6 +31,7 @@ module Fig
31
31
  context 'instance operations' do
32
32
 
33
33
  before :each do
34
+ allow(File).to receive(:exists?).with('fig.lock'){false}
34
35
  allow(File).to receive(:exists?).with('fig.yml'){true}
35
36
  allow(File).to receive(:directory?).with('fig.yml'){false}
36
37
  allow(File).to receive(:read).with('fig.yml'){yaml}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig-lock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Shea