tiller 0.0.8 → 0.1.0
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/examples/lib/tiller/data/dummy.rb +2 -5
- data/examples/lib/tiller/data/network.rb +2 -4
- data/lib/tiller/data/environment.rb +3 -2
- data/lib/tiller/data/file.rb +5 -3
- data/lib/tiller/datasource.rb +8 -2
- data/lib/tiller/templatesource.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0faa026bbfbb368fe8d689c233cf79614e5dc9e1
|
4
|
+
data.tar.gz: 3f90927d1e6c1185fb41f70a7f543f11c36a04a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283636ada09058f6ecaa3c2ed1064f50d25a6354815eca4579e4d452663dcb1f576d34eb0d94f9c3f26a27866497d1aaadf64314530fcdfdcd4b1661d1dc9084
|
7
|
+
data.tar.gz: a7645f090d7eba2e112b83c2ea96996fda23e10fe5b95d7e4e9fd8fc9e601e6aebab2c8a83c7cd234a3cfc7fc6860450cb94cef9c6acc95df94a046f80617c70
|
data/bin/tiller
CHANGED
@@ -3,11 +3,8 @@
|
|
3
3
|
|
4
4
|
class DummyDataSource < Tiller::DataSource
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
@global_values = {
|
9
|
-
'dummy_global' => 'dummy global replacement text'
|
10
|
-
}
|
6
|
+
def global_values
|
7
|
+
{ 'dummy_global' => 'dummy global replacement text' }
|
11
8
|
end
|
12
9
|
|
13
10
|
def values(template_name)
|
@@ -6,14 +6,12 @@ require 'socket'
|
|
6
6
|
|
7
7
|
class NetworkDataSource < Tiller::DataSource
|
8
8
|
|
9
|
-
def
|
10
|
-
super
|
9
|
+
def global_values
|
11
10
|
# Note, these rely on DNS being available and configured correctly!
|
12
|
-
|
11
|
+
{
|
13
12
|
'fqdn' => Socket.gethostbyname(Socket.gethostname).first,
|
14
13
|
'ipv4_addresses' => Socket.getaddrinfo(Socket.gethostbyname(Socket.gethostname).first, nil, :INET)
|
15
14
|
}
|
16
15
|
end
|
17
16
|
|
18
|
-
|
19
17
|
end
|
data/lib/tiller/data/file.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
# File datasource for Tiller. This works the same way as the default behaviour in Runner.rb - it loads your
|
2
2
|
# <environment>.yaml file and provides data from it. See examples/etc/tiller/environments/production.yaml to see
|
3
3
|
# what this file looks like.
|
4
|
+
#
|
5
|
+
# We also don't provide any global values, just ones specific to a template.
|
6
|
+
|
4
7
|
|
5
8
|
require 'yaml'
|
6
9
|
|
7
10
|
class FileDataSource < Tiller::DataSource
|
8
11
|
|
9
|
-
#
|
10
|
-
def
|
11
|
-
super
|
12
|
+
# Open and parse the environment file
|
13
|
+
def setup
|
12
14
|
env_file = File.join(@@config[:tiller_base], "environments", "#{@@config[:environment]}.yaml")
|
13
15
|
@config_hash = YAML::load(open(env_file))
|
14
16
|
end
|
data/lib/tiller/datasource.rb
CHANGED
@@ -11,10 +11,16 @@ module Tiller
|
|
11
11
|
|
12
12
|
def initialize(config)
|
13
13
|
@@config = config
|
14
|
-
|
14
|
+
self.setup
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
# This is where any post-initialisation logic happens (connecting to a database etc.)
|
18
|
+
def setup
|
19
|
+
end
|
20
|
+
|
21
|
+
def global_values
|
22
|
+
Hash.new
|
23
|
+
end
|
18
24
|
|
19
25
|
# We should always return a hash; if we have no data for the given template, just return an empty hash.
|
20
26
|
def values(template_name)
|
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.0
|
4
|
+
version: 0.1.0
|
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-08-
|
11
|
+
date: 2014-08-08 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.
|