simple_provision 0.99.10 → 0.99.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/simple_provision/configuration.rb +7 -3
- data/lib/simple_provision/version.rb +1 -1
- 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: a84b27a7d77c4dab349b86d6eefd5284a634c9e6
|
|
4
|
+
data.tar.gz: 02df93e35588a93b161e85aca17de65e4138c6ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 40fb63e80483f5e12f060f40a332d1a6f0feca8fc4420ab90201f8aa898cd3cb887386306714368908d09a670373b317165ced044ec4cf3e60db5cc19189f11c
|
|
7
|
+
data.tar.gz: d52379b7f229d185bc0c9e6ce5b1e00370cd317c9336bc1092c75afb21d4e0f8f3b88c8924129424bafffa2f5d69d5494e64a28bfee9f0ed7814d10174427bf5
|
data/README.md
CHANGED
|
@@ -87,6 +87,7 @@ scripts:
|
|
|
87
87
|
- scripts/redis.sh
|
|
88
88
|
env:
|
|
89
89
|
DBNAME: my_db_name
|
|
90
|
+
REDISNAME: <%= ENV["REDIS_NAME"] %>
|
|
90
91
|
WEBROOT: /var/www/app
|
|
91
92
|
```
|
|
92
93
|
|
|
@@ -98,6 +99,9 @@ provisioned server at ~/files and ~/scripts
|
|
|
98
99
|
### Passing variables to scripts
|
|
99
100
|
Variables defined in `env` will be exposed to scripts during execution.
|
|
100
101
|
That way you can re-use the same scripts for different type of servers.
|
|
102
|
+
You can pass environment variables (available through the use of bash `export ENVNAME=value`
|
|
103
|
+
or passing to `simpro` command such as `ENVNAME=value simpro`) to the
|
|
104
|
+
env section using the ERB syntax (`<%= ENV['ENVNAME'] %>`).
|
|
101
105
|
|
|
102
106
|
## Provision your server
|
|
103
107
|
`bundle exec simpro my-awesome-server root@my-host`
|
|
@@ -18,7 +18,7 @@ module SimpleProvision
|
|
|
18
18
|
|
|
19
19
|
def default_options
|
|
20
20
|
begin
|
|
21
|
-
YAML.load(File.read(
|
|
21
|
+
YAML.load(ERB.new(File.read(default_file)).result)
|
|
22
22
|
rescue Errno::ENOENT
|
|
23
23
|
{}
|
|
24
24
|
end
|
|
@@ -26,12 +26,16 @@ module SimpleProvision
|
|
|
26
26
|
|
|
27
27
|
def server_options
|
|
28
28
|
begin
|
|
29
|
-
YAML.load(File.read(server_file))
|
|
29
|
+
YAML.load(ERB.new(File.read(server_file)).result)
|
|
30
30
|
rescue Errno::ENOENT
|
|
31
|
-
raise MissingServerConfiguration, "Please create a configuration file '
|
|
31
|
+
raise MissingServerConfiguration, "Please create a configuration file at '#{server_file}'"
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
def default_file
|
|
36
|
+
"provision/servers/default.yml"
|
|
37
|
+
end
|
|
38
|
+
|
|
35
39
|
def server_file
|
|
36
40
|
"provision/servers/#{profile}.yml"
|
|
37
41
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_provision
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.99.
|
|
4
|
+
version: 0.99.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Phuong Gia Su
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-
|
|
12
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|