tiller 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/tiller +14 -3
- data/examples/json/common.yaml +5 -0
- data/examples/json/environments/array.yaml +4 -0
- data/examples/json/environments/simple_keys.yaml +4 -0
- data/examples/json/templates/array.erb +3 -0
- data/examples/json/templates/simple_keys.erb +4 -0
- data/examples/{etc → plugins/etc}/tiller/common.yaml +1 -0
- data/examples/{etc → plugins/etc}/tiller/environments/production.yaml +0 -0
- data/examples/{etc → plugins/etc}/tiller/environments/staging.yaml +0 -0
- data/examples/{etc → plugins/etc}/tiller/templates/sensu_client.erb +0 -0
- data/examples/{lib → plugins/lib}/tiller/data/dummy.rb +0 -0
- data/examples/{lib → plugins/lib}/tiller/data/network.rb +0 -0
- data/examples/{lib → plugins/lib}/tiller/template/dummy.rb +0 -0
- data/lib/tiller/data/environment_json.rb +24 -0
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf773d678bba89ec6157521d7bddf05d22681e74
|
4
|
+
data.tar.gz: 5546392bad1250d0747fc4fc93aa7659af25dc03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1c32ea6fd357a09ecf9d56cee9cd245d81941e0094241fec971da01b3ee98dee1b7fd76073a00dd403a8dad76a94e62d8832e1beed9ebffa5c38f1e16dee5af
|
7
|
+
data.tar.gz: 36a15edabd7c35851f8b8e49d834b00910e5fc1d60b5b9b8f440fb51ecbf7896001cfa0d16716367a904685f790f2242977f8058539efb66865965341d2f8b71
|
data/bin/tiller
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# didn't have an existing gem named after it!
|
5
5
|
# Mark Round <github@markround.com>
|
6
6
|
|
7
|
-
VERSION = '0.1.
|
7
|
+
VERSION = '0.1.4'
|
8
8
|
|
9
9
|
require 'erb'
|
10
10
|
require 'ostruct'
|
@@ -13,7 +13,7 @@ require 'fileutils'
|
|
13
13
|
require 'optparse'
|
14
14
|
require 'pp'
|
15
15
|
|
16
|
-
# This is needed so we can
|
16
|
+
# This is needed so we can enumerate all the loaded plugins later
|
17
17
|
class Class
|
18
18
|
def subclasses
|
19
19
|
ObjectSpace.each_object(Class).select { |c| c < self }
|
@@ -49,9 +49,20 @@ module Tiller
|
|
49
49
|
opts.on('-v', '--verbose', 'Display verbose output') do
|
50
50
|
config[:verbose] = true
|
51
51
|
end
|
52
|
+
opts.on('-b', '--base-dir [BASE_DIR]', 'Override the tiller_base environment variable') do |base_dir|
|
53
|
+
config[:tiller_base] = base_dir
|
54
|
+
end
|
55
|
+
opts.on('-l', '--lib-dir [LIB_DIR]', 'Override the tiller_lib environment variable') do |lib_dir|
|
56
|
+
config[:tiller_lib] = lib_dir
|
57
|
+
end
|
58
|
+
opts.on('-e', '--environment [ENV]', 'Override the \'environment\' environment variable') do |environment|
|
59
|
+
config[:environment] = environment
|
60
|
+
end
|
61
|
+
|
52
62
|
opts.on('-h', '--help', 'Display this screen') do
|
53
63
|
puts opts
|
54
|
-
puts 'Tiller also uses the environment variables tiller_base
|
64
|
+
puts 'Tiller also uses the environment variables tiller_base, environment'
|
65
|
+
puts 'and tiller_lib (or they can be provided using the arguments shown above).'
|
55
66
|
puts 'See https://github.com/markround/tiller for documentation and usage.'
|
56
67
|
puts 'Current configuration hash follows :'
|
57
68
|
pp config
|
@@ -28,6 +28,7 @@ data_sources:
|
|
28
28
|
- environment
|
29
29
|
- network
|
30
30
|
|
31
|
+
|
31
32
|
# template_sources: Sources of templates, in priority order (first takes precendence). Again using the provided
|
32
33
|
# FileTemplateSource (uses templates under <tiller_base>/templates), and also because we set tiller_lib, we can use
|
33
34
|
# DummyTemplateSource which creates a single "dummy.erb" template.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Environment JSON datasource for Tiller. This extracts all JSON from the
|
2
|
+
# tiller_json environment variable and merges the resulting hash data
|
3
|
+
# structure into the global_values available to templates.
|
4
|
+
|
5
|
+
require 'json'
|
6
|
+
require 'pp'
|
7
|
+
|
8
|
+
class EnvironmentJsonDataSource < Tiller::DataSource
|
9
|
+
def global_values
|
10
|
+
|
11
|
+
if ENV.has_key?('tiller_json')
|
12
|
+
begin
|
13
|
+
json_structure = JSON.parse(ENV['tiller_json'])
|
14
|
+
json_structure if json_structure.is_a?(Hash)
|
15
|
+
rescue JSON::ParserError
|
16
|
+
puts "Warning : Error parsing tiller_json environment variable"
|
17
|
+
Hash.new
|
18
|
+
end
|
19
|
+
else
|
20
|
+
Hash.new
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
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.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Round
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A tool to create configuration files in Docker containers from a variety
|
14
14
|
of sources. See https://github.com/markround/tiller for examples and documentation.
|
@@ -19,14 +19,20 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- bin/tiller
|
22
|
-
- examples/
|
23
|
-
- examples/
|
24
|
-
- examples/
|
25
|
-
- examples/
|
26
|
-
- examples/
|
27
|
-
- examples/
|
28
|
-
- examples/
|
22
|
+
- examples/json/common.yaml
|
23
|
+
- examples/json/environments/array.yaml
|
24
|
+
- examples/json/environments/simple_keys.yaml
|
25
|
+
- examples/json/templates/array.erb
|
26
|
+
- examples/json/templates/simple_keys.erb
|
27
|
+
- examples/plugins/etc/tiller/common.yaml
|
28
|
+
- examples/plugins/etc/tiller/environments/production.yaml
|
29
|
+
- examples/plugins/etc/tiller/environments/staging.yaml
|
30
|
+
- examples/plugins/etc/tiller/templates/sensu_client.erb
|
31
|
+
- examples/plugins/lib/tiller/data/dummy.rb
|
32
|
+
- examples/plugins/lib/tiller/data/network.rb
|
33
|
+
- examples/plugins/lib/tiller/template/dummy.rb
|
29
34
|
- lib/tiller/data/environment.rb
|
35
|
+
- lib/tiller/data/environment_json.rb
|
30
36
|
- lib/tiller/data/file.rb
|
31
37
|
- lib/tiller/data/random.rb
|
32
38
|
- lib/tiller/datasource.rb
|