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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 579178d76f20065852e9d4249dde9cf2820c8db1
4
- data.tar.gz: b3a2ccf6acba6c6d2cf20a211cd9b950703b9b25
3
+ metadata.gz: a84b27a7d77c4dab349b86d6eefd5284a634c9e6
4
+ data.tar.gz: 02df93e35588a93b161e85aca17de65e4138c6ad
5
5
  SHA512:
6
- metadata.gz: f41cdfc9a634d2c2233371a6f786ac9562a8275e8d34f7b28f39c2c0e7b19fac95fc3bcbe13106bb384a27f3081919b8c59e26e81ae78f8776e8cc19fa90d851
7
- data.tar.gz: 7afecbcf8f883f435c4c1d1cd9c38a06bed397a0c3ecb57406fb52d66756da5b7af05adc8172c4207242fc581914d2b88cf9c7ce147afa6f6e5bb6ed3f9daaf8
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(server_file))
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 './#{server_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
@@ -1,3 +1,3 @@
1
1
  module SimpleProvision
2
- VERSION = "0.99.10"
2
+ VERSION = "0.99.11"
3
3
  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.10
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-09-20 00:00:00.000000000 Z
12
+ date: 2014-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler