tiller 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/tiller +1 -1
- data/lib/tiller/data/environment_json.rb +36 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27d12e01d34394a6fad400842d4aa83ebc197e3a
|
4
|
+
data.tar.gz: 0ee3df3eff85b7a044198b81722943fefde97207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef5413950dc0402cbcbad9d2644678e8f09977e0a06fc791eb4cbc612fd0d774a773a622b0dd06bc808f730aa2a4fc0be1f321c9563b9d80b99df7cae8e9ec3a
|
7
|
+
data.tar.gz: 05c0e4a79290f4defc0d7434363f992086bf49c0360147da85f9baaa57b4c20adaba00e4b7e402ca0ba51901cd94b429193f97f298ce41630b12f0f5b9b1f702
|
data/bin/tiller
CHANGED
@@ -6,19 +6,50 @@ require 'json'
|
|
6
6
|
require 'pp'
|
7
7
|
|
8
8
|
class EnvironmentJsonDataSource < Tiller::DataSource
|
9
|
-
def global_values
|
10
9
|
|
10
|
+
VERSION_KEY='_version'
|
11
|
+
|
12
|
+
def setup
|
11
13
|
if ENV.has_key?('tiller_json')
|
12
14
|
begin
|
13
|
-
|
14
|
-
json_structure
|
15
|
+
parse = JSON.parse(ENV['tiller_json'])
|
16
|
+
@json_structure = parse.is_a?(Hash) ? parse : Hash.new
|
17
|
+
if @json_structure[VERSION_KEY].is_a? Integer
|
18
|
+
@json_version = @json_structure[VERSION_KEY]
|
19
|
+
@log.debug("Using v#{@json_version} tiller_json format")
|
20
|
+
else
|
21
|
+
@json_version = 1
|
22
|
+
end
|
15
23
|
rescue JSON::ParserError
|
16
24
|
@log.warn('Warning : Error parsing tiller_json environment variable')
|
17
|
-
Hash.new
|
18
25
|
end
|
19
26
|
else
|
20
|
-
Hash.new
|
27
|
+
@json_structure = Hash.new
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def global_values
|
32
|
+
if @json_version < 2
|
33
|
+
@json_structure
|
34
|
+
else
|
35
|
+
if @json_structure.has_key?('global')
|
36
|
+
@json_structure['global']
|
37
|
+
else
|
38
|
+
Hash.new
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def values(template_name)
|
44
|
+
if @json_version < 2
|
45
|
+
return Hash.new
|
21
46
|
end
|
22
47
|
|
48
|
+
if @json_structure.has_key?(template_name)
|
49
|
+
return @json_structure[template_name]
|
50
|
+
else
|
51
|
+
return Hash.new
|
52
|
+
end
|
23
53
|
end
|
54
|
+
|
24
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Dastmalchi-Round
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A tool to create configuration files from a variety of sources, particularly
|
14
14
|
useful for Docker containers. See https://github.com/markround/tiller for examples
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.
|
71
|
+
rubygems_version: 2.5.1
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: Dynamic configuration file generation
|