nutkins 0.4.0 → 0.4.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: 798a771286c34b95adbba75636c14ec38e7bc639
4
- data.tar.gz: 472275ac590b8eab6d01f12e4a23d0f2c1a193bb
3
+ metadata.gz: b874e33bfa103042603054b4ba321c1a5df2e819
4
+ data.tar.gz: 59ef7eded283b1715c84f6b9b3fa173d2404efc7
5
5
  SHA512:
6
- metadata.gz: e532d69c2de6b5266ba035aa77a35014ce95e2351f651744129c9b461d6d76f0a23e68c2cbc4218bc61744bcb3a68e7bd999e3fdb29c493c2056cfef97bd69d1
7
- data.tar.gz: 24d5cc0027b41f1b3100d76cc07c6bd6a759a6d1ac3f58664e0981a72175d101e62da3a650d837835633bee41bb7a9b510b3ee7e3e5c1cb57a17607a90aa7ad3
6
+ metadata.gz: 5d06cb4717c71e617c0583ac6f3904aa1909c22611c39420b5a9ce76aa1c2519ac2c34a77f73730e0b39049341568a7f9693540356f339d002cbfc233471a257
7
+ data.tar.gz: bffcf7293e083bfda9469d149bbd87062165954da6268effd5e1d9ba0b25c49a10191c5e5acaeeaefeb1279853c416e1171fb0a8c5d97f57d0ad56d63238dae8
@@ -1,3 +1,3 @@
1
1
  module Nutkins
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/lib/nutkins.rb CHANGED
@@ -210,6 +210,18 @@ module Nutkins
210
210
  etcd_store = {}
211
211
  configs.each do |config|
212
212
  etcd_store.merge! config['etcd']['data'] if config.dig('etcd', 'data')
213
+
214
+ if config.dig('etcd', 'files')
215
+ config['etcd']['files'].each do |file|
216
+ etcd_data_path = File.join config['directory'], file
217
+ begin
218
+ etcd_store.merge! YAML.load_file(etcd_data_path)
219
+ rescue => e
220
+ puts "failed to load etcd data file: #{etcd_data_path}"
221
+ puts e
222
+ end
223
+ end
224
+ end
213
225
  end
214
226
 
215
227
  if Docker.run 'start', name
@@ -258,9 +270,11 @@ module Nutkins
258
270
  end
259
271
 
260
272
  def get_image_config path
261
- img_cfg_path = File.join get_project_dir(path), IMG_CONFIG_FILE_NAME
273
+ directory = get_project_dir(path)
274
+ img_cfg_path = File.join directory, IMG_CONFIG_FILE_NAME
262
275
  img_cfg = File.exists?(img_cfg_path) ? YAML.load_file(img_cfg_path) : {}
263
- img_cfg["image"] ||= path if path != '.'
276
+ img_cfg['image'] ||= path if path != '.'
277
+ img_cfg['directory'] = directory
264
278
  img_cfg["version"] ||= @config.version if @config.version
265
279
  img_cfg['version'] = img_cfg['version'].to_s
266
280
  raise 'missing mandatory version field' unless img_cfg.has_key? 'version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutkins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pike
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler