soloist 0.0.5 → 0.0.6
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.
- data/.rvmrc +1 -0
- data/Gemfile.lock +1 -1
- data/README.markdown +7 -7
- data/bin/soloist +0 -0
- data/lib/soloist/chef_config_generator.rb +2 -0
- data/lib/soloist/version.rb +1 -1
- data/spec/chef_config_generator_spec.rb +40 -1
- metadata +5 -4
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm ruby-1.8.7-p299@soloist
|
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -19,9 +19,9 @@ Just put your soloistrc file in your home directory, and point it to wherever yo
|
|
19
19
|
# How do I write a solistrc file?
|
20
20
|
It's a yaml file, currently with two lists to maintain:
|
21
21
|
|
22
|
-
The first,
|
22
|
+
The first, _cookbook\_paths_, should point (using an absolute or path relative to your soloistrc file) to the directory containing your cookbooks, such was pivotal_workstation.
|
23
23
|
|
24
|
-
The second,
|
24
|
+
The second, _recipes_ should be a list of recipes you wish to run.
|
25
25
|
|
26
26
|
# Then What?
|
27
27
|
$> soloist
|
@@ -76,19 +76,19 @@ I'm trying out adding support in the soloistrc file for selecting recipes based
|
|
76
76
|
- pivotal_workstation::ack
|
77
77
|
env_variable_switches:
|
78
78
|
RACK_ENV:
|
79
|
-
|
79
|
+
production:
|
80
80
|
cookbook_paths:
|
81
|
-
- ./chef/
|
81
|
+
- ./chef/production_cookbooks/
|
82
82
|
recipes:
|
83
|
-
-
|
83
|
+
- production::foo
|
84
84
|
|
85
85
|
The values are merged in, so this results in a cookbook path of
|
86
86
|
[
|
87
87
|
"./chef/cookbooks/",
|
88
|
-
"./chef/
|
88
|
+
"./chef/production_cookbooks/"
|
89
89
|
]
|
90
90
|
and a recipe list of
|
91
91
|
[
|
92
92
|
"pivotal_workstation::ack",
|
93
|
-
"
|
93
|
+
"production::foo"
|
94
94
|
]
|
data/bin/soloist
CHANGED
File without changes
|
@@ -12,9 +12,11 @@ class ChefConfigGenerator
|
|
12
12
|
@hash["env_variable_switches"].keys.each do |variable|
|
13
13
|
sub_hash = @hash["env_variable_switches"][variable][ENV[variable]]
|
14
14
|
if sub_hash && sub_hash["recipes"]
|
15
|
+
@hash["recipes"] ||= []
|
15
16
|
@hash["recipes"] = (@hash["recipes"] + sub_hash["recipes"]).uniq
|
16
17
|
end
|
17
18
|
if sub_hash && sub_hash["cookbook_paths"]
|
19
|
+
@hash["cookbook_paths"] ||= []
|
18
20
|
@hash["cookbook_paths"] = (@hash["cookbook_paths"] + sub_hash["cookbook_paths"]).uniq
|
19
21
|
end
|
20
22
|
end
|
data/lib/soloist/version.rb
CHANGED
@@ -96,5 +96,44 @@ env_variable_switches:
|
|
96
96
|
"pivotal_dev::foo"
|
97
97
|
]
|
98
98
|
end
|
99
|
-
|
99
|
+
|
100
|
+
it "can deal with only having environment switched recipes/cookbooks" do
|
101
|
+
config = <<-CONFIG
|
102
|
+
env_variable_switches:
|
103
|
+
RACK_ENV:
|
104
|
+
development:
|
105
|
+
cookbook_paths:
|
106
|
+
- ./chef/development_cookbooks/
|
107
|
+
recipes:
|
108
|
+
- pivotal_development::foo
|
109
|
+
CONFIG
|
110
|
+
@generator = ChefConfigGenerator.new(config, "../..")
|
111
|
+
@generator.cookbook_paths.should == [
|
112
|
+
"//../.././chef/development_cookbooks/"
|
113
|
+
]
|
114
|
+
@generator.json_hash["recipes"].should == [
|
115
|
+
"pivotal_development::foo"
|
116
|
+
]
|
117
|
+
end
|
118
|
+
it "can deal with only having empty recipes/cookbooks" do
|
119
|
+
config = <<-CONFIG
|
120
|
+
cookbook_paths:
|
121
|
+
recipes:
|
122
|
+
env_variable_switches:
|
123
|
+
RACK_ENV:
|
124
|
+
development:
|
125
|
+
cookbook_paths:
|
126
|
+
- ./chef/development_cookbooks/
|
127
|
+
recipes:
|
128
|
+
- pivotal_development::foo
|
129
|
+
CONFIG
|
130
|
+
@generator = ChefConfigGenerator.new(config, "../..")
|
131
|
+
@generator.cookbook_paths.should == [
|
132
|
+
"//../.././chef/development_cookbooks/"
|
133
|
+
]
|
134
|
+
@generator.json_hash["recipes"].should == [
|
135
|
+
"pivotal_development::foo"
|
136
|
+
]
|
137
|
+
end
|
138
|
+
end
|
100
139
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soloist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthew Kocher
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-08 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
|
62
62
|
files:
|
63
63
|
- .gitignore
|
64
|
+
- .rvmrc
|
64
65
|
- Gemfile
|
65
66
|
- Gemfile.lock
|
66
67
|
- README.markdown
|