gusteau 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/gusteau.gemspec +1 -1
- data/lib/gusteau/config.rb +4 -3
- data/lib/gusteau/helpers.rb +7 -0
- data/lib/gusteau/version.rb +1 -1
- data/spec/config/remi.yml +3 -0
- data/spec/lib/gusteau/config_spec.rb +1 -0
- metadata +6 -5
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/gusteau.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_dependency 'coderay'
|
23
23
|
gem.add_dependency 'json'
|
24
24
|
gem.add_dependency 'hashie'
|
25
|
-
gem.add_dependency '
|
25
|
+
gem.add_dependency 'deep_merge'
|
26
26
|
gem.add_dependency 'net-ssh', '>= 2.2.2'
|
27
27
|
gem.add_dependency 'archive-tar-minitar', '>= 0.5.2'
|
28
28
|
|
data/lib/gusteau/config.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'gusteau/erb'
|
2
|
-
require '
|
2
|
+
require 'gusteau/helpers'
|
3
3
|
|
4
4
|
module Gusteau
|
5
5
|
class Config
|
@@ -56,12 +56,13 @@ module Gusteau
|
|
56
56
|
#
|
57
57
|
def build_node(node_name, env_hash, node_hash)
|
58
58
|
node_config = {
|
59
|
-
'server' => node_hash,
|
60
|
-
'attributes' => (
|
59
|
+
'server' => node_hash.slice('host', 'port', 'user', 'password', 'platform', 'vagrant'),
|
60
|
+
'attributes' => (node_hash['attributes'] || {}).deep_merge(env_hash['attributes'] || {}),
|
61
61
|
'run_list' => node_hash['run_list'] || env_hash['run_list'],
|
62
62
|
'before' => env_hash['before'] || @config['before'],
|
63
63
|
'after' => env_hash['after'] || @config['after']
|
64
64
|
}
|
65
|
+
node_config['server'].delete 'attributes'
|
65
66
|
Gusteau::Node.new(node_name, node_config)
|
66
67
|
end
|
67
68
|
end
|
data/lib/gusteau/version.rb
CHANGED
data/spec/config/remi.yml
CHANGED
@@ -10,6 +10,7 @@ environments:
|
|
10
10
|
|
11
11
|
production:
|
12
12
|
attributes:
|
13
|
+
net: { hostname: prod }
|
13
14
|
users:
|
14
15
|
- alex
|
15
16
|
- simon
|
@@ -23,12 +24,14 @@ environments:
|
|
23
24
|
<<: *default_node
|
24
25
|
host: db.myapp.com
|
25
26
|
attributes:
|
27
|
+
net: { hostname: prod-db }
|
26
28
|
mysql:
|
27
29
|
server_root_password: prodsecret
|
28
30
|
www:
|
29
31
|
<<: *default_node
|
30
32
|
host: www.myapp.com
|
31
33
|
attributes:
|
34
|
+
net: { hostname: prod-www }
|
32
35
|
nginx:
|
33
36
|
workers: 4
|
34
37
|
run_list: [ 'recipe[varnish]', 'recipe[nginx]' ]
|
@@ -26,6 +26,7 @@ describe Gusteau::Config do
|
|
26
26
|
|
27
27
|
it "should deeply merge the attributes" do
|
28
28
|
nodes['production-db'].config['attributes'].must_equal({
|
29
|
+
'net' => {'hostname' => 'prod-db'},
|
29
30
|
'users' => ['alex', 'simon'],
|
30
31
|
'mysql' => {'server_port' => 3307, 'server_root_password' => 'prodsecret' }
|
31
32
|
})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gusteau
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-07-
|
13
|
+
date: 2013-07-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: optitron
|
@@ -93,7 +93,7 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
96
|
+
name: deep_merge
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
none: false
|
99
99
|
requirements:
|
@@ -249,6 +249,7 @@ files:
|
|
249
249
|
- lib/gusteau/compressed_tar_stream.rb
|
250
250
|
- lib/gusteau/config.rb
|
251
251
|
- lib/gusteau/erb.rb
|
252
|
+
- lib/gusteau/helpers.rb
|
252
253
|
- lib/gusteau/log.rb
|
253
254
|
- lib/gusteau/node.rb
|
254
255
|
- lib/gusteau/server.rb
|
@@ -301,7 +302,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
301
302
|
version: '0'
|
302
303
|
segments:
|
303
304
|
- 0
|
304
|
-
hash: -
|
305
|
+
hash: -340047835644286635
|
305
306
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
306
307
|
none: false
|
307
308
|
requirements:
|
@@ -310,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
310
311
|
version: '0'
|
311
312
|
segments:
|
312
313
|
- 0
|
313
|
-
hash: -
|
314
|
+
hash: -340047835644286635
|
314
315
|
requirements: []
|
315
316
|
rubyforge_project:
|
316
317
|
rubygems_version: 1.8.23
|