server-blender 0.0.10 → 0.0.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
data/files/bootstrap.sh CHANGED
@@ -165,13 +165,6 @@ function install_custom_rubygems()
165
165
  ln -sfn /usr/bin/gem1.8 /usr/bin/gem
166
166
  }
167
167
 
168
- function install_puppet()
169
- {
170
- log "installing puppet"
171
- gem install --no-rdoc --no-ri shadow_puppet -v 0.3.2
172
- gem install --no-rdoc --no-ri ruby-debug
173
- }
174
-
175
168
  # adds /var/lib/gems/1.8/bin to paths. only needed with the system (debian) braindead gems
176
169
 
177
170
  function add_gems_to_system_path()
@@ -227,10 +220,8 @@ else
227
220
  # upstream rubygems install executables into /usr/bin so no need to fix the path
228
221
  fi
229
222
 
230
-
231
- gem install rdoc # needed by most gems
232
-
233
- install_puppet
223
+ gem install --no-rdoc --no-ri rdoc # needed by most gems
224
+ gem install --no-rdoc --no-ri ruby-debug # very useful to debug manifests
234
225
 
235
226
  date > /etc/bootstraped_at
236
227
  etckeeper commit "bootstrapped"
data/files/mix.sh CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/bin/bash -eu
2
2
 
3
+ SHADOW_PUPPET_VERSION="0.3.2"
4
+ MANIFEST_VERSION="0.0.11"
5
+
3
6
  trap "echo FAILED" EXIT
4
7
 
5
8
  # ensure_gem GEM [VERSION]
@@ -20,16 +23,22 @@ function ensure_gem()
20
23
  fi
21
24
  }
22
25
 
23
- ensure_gem shadow_puppet 0.3.2
26
+ ensure_gem shadow_puppet $SHADOW_PUPPET_VERSION
24
27
  ensure_gem ruby-debug
25
- ensure_gem server-blender-manifest 0.0.9
28
+ ensure_gem server-blender-manifest $MANIFEST_VERSION
29
+
30
+ echo "Mix: [recipe: $RECIPE, node: ${NODE:-}, roles: ${ROLES:-}]"
26
31
 
27
32
  cd /var/lib/blender/recipes
28
- echo "Running Puppet [recipe: $RECIPE]"
29
33
 
30
- blender-mix-recipe $RECIPE
34
+ ruby -rrubygems <<-RUBY
35
+ gem 'server-blender-manifest', '$MANIFEST_VERSION'
36
+ require 'blender/manifest'
37
+
38
+ system "shadow_puppet", "_${SHADOW_PUPPET_VERSION}_", Blender::Manifest::ROOT
39
+ RUBY
31
40
 
32
41
  trap - EXIT
33
42
 
34
43
  echo
35
- echo Your ServerShake is ready
44
+ echo Your ServerShake is ready. Have fun!
@@ -1,11 +1,9 @@
1
- options = {
2
- :recipe => 'default'
3
- }
1
+ options = {}
4
2
  opts = OptionParser.new do |opts|
5
3
  opts.banner = "Usage: blender mix [OPTIONS] [DIR] HOST"
6
4
  opts.separator "Options:"
7
5
 
8
- opts.on("-r", "--recipe RECIPE", "('default' will be used if RECIPE not specified") do |val|
6
+ opts.on("-r", "--recipe RECIPE", "if RECIPE is not specified blender will first look for <directory_name>.rb and then for blender-recipe.rb") do |val|
9
7
  options[:recipe] = val
10
8
  end
11
9
 
@@ -47,9 +45,15 @@ unless File.directory?(dir)
47
45
  abort(opts.to_s)
48
46
  end
49
47
 
50
- File.file?(File.join(dir, recipe = options[:recipe])) ||
51
- File.file?(File.join(dir, recipe = "#{options[:recipe]}.rb")) ||
52
- abort("recipe #{options[:recipe]} not found\n#{opts}")
48
+ # check for recipe, recipe.rb, directory_name.rb, and default.rb
49
+ recipes = []
50
+ if rname = options[:recipe]
51
+ recipes << rname << "#{rname}.rb"
52
+ end
53
+ recipes << "#{File.basename(File.expand_path(dir))}.rb" << "blender-recipe.rb"
54
+
55
+ recipe = recipes.detect {|r| File.file?(File.join(dir, r))} ||
56
+ abort("recipe not found\n#{opts}")
53
57
 
54
58
  WORK_DIR = "/var/lib/blender/recipes"
55
59
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{server-blender}
8
- s.version = "0.0.10"
8
+ s.version = "0.0.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Vitaly Kushner"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 10
9
- version: 0.0.10
8
+ - 11
9
+ version: 0.0.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Vitaly Kushner