tiller 0.7.1 → 0.7.2
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/xml_file.rb +35 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23cb72e7fababe5a22673372565626bf2f12d7cc
|
4
|
+
data.tar.gz: 087415e292aabae4501b67597691731531b4e7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03c72384821731e643492147b7e8cc6ac303b78a56dcfeff21aab927ad537936fac54cadfabf684b0ac7609f7ad4c0a129aa144a8467cb67ce6bdfdd6d76e635
|
7
|
+
data.tar.gz: 031b42444defb5241356e4a96d778d19b6858927dfbeaf9398bb6f69b481548b322c229af6131aad70556099b1e79c426fb6f4385b17d499e5b8e559c1c6b4cb
|
data/bin/tiller
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'crack'
|
2
|
+
|
3
|
+
# This datasource reads an XML file (xml_file_path), parses it using the crack gem and then
|
4
|
+
# Makes it available to templates as a named structure (xml_file_var).
|
5
|
+
|
6
|
+
class XmlFileDataSource < Tiller::DataSource
|
7
|
+
|
8
|
+
def global_values
|
9
|
+
parse_xml(@config)
|
10
|
+
end
|
11
|
+
|
12
|
+
def values(template)
|
13
|
+
parse_xml(@config['environments'][@config[:environment]][template])
|
14
|
+
end
|
15
|
+
|
16
|
+
def parse_xml(config_hash)
|
17
|
+
if config_hash.has_key?('xml_file_path') && config_hash.has_key?('xml_file_var')
|
18
|
+
path = config_hash['xml_file_path']
|
19
|
+
var = config_hash['xml_file_var']
|
20
|
+
@log.info('Opening XML file : ' + path)
|
21
|
+
begin
|
22
|
+
xml = Crack::XML.parse(File.open(path))
|
23
|
+
rescue Exception => e
|
24
|
+
abort "Error : Could not parse XML file #{path}\n#{e}"
|
25
|
+
end
|
26
|
+
struct = {}
|
27
|
+
struct[var] = xml
|
28
|
+
@log.debug("Created XML structure : #{struct}")
|
29
|
+
struct
|
30
|
+
else
|
31
|
+
{}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
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.2
|
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: 2015-09-
|
11
|
+
date: 2015-09-29 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
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/tiller/data/file.rb
|
58
58
|
- lib/tiller/data/http.rb
|
59
59
|
- lib/tiller/data/random.rb
|
60
|
+
- lib/tiller/data/xml_file.rb
|
60
61
|
- lib/tiller/data/zookeeper.rb
|
61
62
|
- lib/tiller/datasource.rb
|
62
63
|
- lib/tiller/defaults.rb
|