semi 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -1
- data/lib/semi/driver.rb +2 -2
- data/lib/semi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80fb95486ba180d4b96a45f40360ffa8df51b044
|
4
|
+
data.tar.gz: ed494f2aac254260547e5ebe76d9ce32a61c7d29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e9b7a6311d3fedae0fefd7de3332f191434913e1817dd858ba7bbda072ea360005483ff58cea1b0fe3de9bc584c568d43c6c654333ddda5e76cc5f17de57c86
|
7
|
+
data.tar.gz: 013a7b0ecb085481b9c9e81195ca04ae029c4f3101b5ef94d5b9d6da1209f84c66b2fc2a78381ded61061a6f792fb64b48047dbf2f497b098178dc2514f14c65
|
data/README.md
CHANGED
@@ -8,6 +8,10 @@ Configuration File
|
|
8
8
|
Configuration file is expected at /etc/semi.conf or as specified by the
|
9
9
|
SEMI_CONF environmental variable.
|
10
10
|
|
11
|
+
The configuration file is nothing more than a YAML file with four principal
|
12
|
+
sections: defaults, validate, files and commands. Each of these sections
|
13
|
+
further explained elsewhere in this README file.
|
14
|
+
|
11
15
|
---
|
12
16
|
defaults:
|
13
17
|
PATH: /usr/bin:/bin
|
@@ -23,4 +27,62 @@ SEMI_CONF environmental variable.
|
|
23
27
|
commands:
|
24
28
|
README: cat /README.md
|
25
29
|
readme: cat /README.md
|
26
|
-
|
30
|
+
default: bundle exec unicorn -E production -c unicorn.rb
|
31
|
+
|
32
|
+
|
33
|
+
Defaults
|
34
|
+
--------
|
35
|
+
The defaults section will supply a value for any variable that has not been
|
36
|
+
specified in the environment. Currently there is a bug that if a value is
|
37
|
+
defined but is set to an empty string in the environment, the default value
|
38
|
+
will not override the environment.
|
39
|
+
|
40
|
+
Validators
|
41
|
+
----------
|
42
|
+
Validators allow one to insure that the value of a variable is within a
|
43
|
+
specified range. Each key of the validate section is a name of a variable
|
44
|
+
that can be used in the ERB templates. The values are one or more
|
45
|
+
validation expressions to test the values against. The values may be
|
46
|
+
specified as a comma seperated string or as an array.
|
47
|
+
|
48
|
+
* required
|
49
|
+
|
50
|
+
Ensures that a value is defined for the variable. If a value is not
|
51
|
+
defined, then the container will exit with a message detailing
|
52
|
+
which variable has not been set.
|
53
|
+
|
54
|
+
* string
|
55
|
+
|
56
|
+
Validate that the value is generally considered a string.
|
57
|
+
|
58
|
+
* integer
|
59
|
+
|
60
|
+
Test the value to see if it is an integer. Floating point numbers
|
61
|
+
will require another validator.
|
62
|
+
|
63
|
+
* boolean
|
64
|
+
|
65
|
+
This validator attempts to determine if the value is boolean value.
|
66
|
+
|
67
|
+
* Regular Expression
|
68
|
+
|
69
|
+
For validations that are not specified, one is able to specify a
|
70
|
+
regular expression to validate a value. The regular expression must
|
71
|
+
start and end with a slash (/).
|
72
|
+
|
73
|
+
Future plans are to include more validators for validating values like
|
74
|
+
hostnames, IPs, host/port combinations, filenames and URLs.
|
75
|
+
|
76
|
+
Filenames
|
77
|
+
---------
|
78
|
+
The filenames section list all the configuration files that ned to be
|
79
|
+
processed as ERB templates. The full ERB template syntax is supported.
|
80
|
+
|
81
|
+
Commands
|
82
|
+
--------
|
83
|
+
Additional commands can be added to the container in the commands section.
|
84
|
+
This is useful for adding automation and providing simple commands to
|
85
|
+
activate more complex commands in the container.
|
86
|
+
|
87
|
+
There is one special value (default) that will be used when the entrypoint
|
88
|
+
is not provided any arguements.
|
data/lib/semi/driver.rb
CHANGED
@@ -6,12 +6,12 @@ module Semi
|
|
6
6
|
|
7
7
|
def initialize(path)
|
8
8
|
@config = Semi::Config.new(path)
|
9
|
-
@dictionary = ENV.to_h
|
10
9
|
end
|
11
10
|
|
12
11
|
def start
|
13
12
|
# Merge defaults into the environment
|
14
|
-
@dictionary
|
13
|
+
@dictionary = @config.defaults.dup
|
14
|
+
@dictionary.merge!(ENV.to_h)
|
15
15
|
|
16
16
|
# Check any validations being asserted
|
17
17
|
@config.validators.each_key { |key|
|
data/lib/semi/version.rb
CHANGED