server-blender 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/.document CHANGED
@@ -1,4 +1,4 @@
1
- README.rdoc
1
+ README.markdown
2
2
  lib/**/*.rb
3
3
  bin/*
4
4
  features/**/*.feature
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.10
data/files/mix.sh ADDED
@@ -0,0 +1,35 @@
1
+ #!/bin/bash -eu
2
+
3
+ trap "echo FAILED" EXIT
4
+
5
+ # ensure_gem GEM [VERSION]
6
+ function ensure_gem()
7
+ {
8
+ if [ $# -eq 2 ]; then
9
+ # name + version
10
+ if ! gem list $1 | grep -q "$1 (\([^,]*, \)*${2//./\\.}\(, [^,]*\)*)$"; then
11
+ echo installing $1 $2
12
+ gem install --no-ri --no-rdoc $1 -v$2
13
+ fi
14
+ else
15
+ # name only
16
+ if ! gem list $1 | grep -q "^$1 ";then
17
+ echo installing $1
18
+ gem install --no-ri --no-rdoc $1
19
+ fi
20
+ fi
21
+ }
22
+
23
+ ensure_gem shadow_puppet 0.3.2
24
+ ensure_gem ruby-debug
25
+ ensure_gem server-blender-manifest 0.0.9
26
+
27
+ cd /var/lib/blender/recipes
28
+ echo "Running Puppet [recipe: $RECIPE]"
29
+
30
+ blender-mix-recipe $RECIPE
31
+
32
+ trap - EXIT
33
+
34
+ echo
35
+ echo Your ServerShake is ready
@@ -41,4 +41,4 @@ def run(*cmd)
41
41
  system(*cmd)
42
42
  end
43
43
 
44
- run "cat files/bootstrap.sh | ssh #{host} USE_SYSTEM_GEMS=#{options[:system_gems]}#{extra} /bin/bash -eu"
44
+ run "cat #{File.expand_path("files/bootstrap.sh", Blender::ROOT)} | ssh #{host} USE_SYSTEM_GEMS=#{options[:system_gems]}#{extra} /bin/bash -eu"
@@ -49,23 +49,19 @@ end
49
49
 
50
50
  File.file?(File.join(dir, recipe = options[:recipe])) ||
51
51
  File.file?(File.join(dir, recipe = "#{options[:recipe]}.rb")) ||
52
- abort("recipe #{recipe} not found\n#{opts}")
52
+ abort("recipe #{options[:recipe]} not found\n#{opts}")
53
53
 
54
54
  WORK_DIR = "/var/lib/blender/recipes"
55
- LOCAL_MANIFEST_DIR = File.expand_path("../../manifest", __FILE__)
56
- REMOTE_MANIFEST_DIR = "/var/lib/blender/manifest"
57
- ROOT_MANIFEST = File.join(REMOTE_MANIFEST_DIR, "root.rb")
58
55
 
59
56
  def run(*cmd)
60
57
  puts ">> #{cmd * ' '}"
61
58
  system(*cmd)
62
59
  end
63
60
 
64
- run("rsync -azP --delete --exclude '.*' #{LOCAL_MANIFEST_DIR}/ #{host}:#{REMOTE_MANIFEST_DIR}") &&
65
- run("rsync -azP --delete --exclude '.*' --exclude other #{dir}/ #{host}:#{WORK_DIR}") &&
61
+ run("rsync -azP --delete --exclude '.*' #{dir}/ #{host}:#{WORK_DIR}") &&
66
62
 
67
- extra=""
68
- extra << " NODE=#{options[:node]}" if options[:node]
69
- extra << " ROLES=#{options[:roles]}" if options[:roles]
63
+ env_config = "RECIPE=#{recipe}"
64
+ env_config << " NODE=#{options[:node]}" if options[:node]
65
+ env_config << " ROLES=#{options[:roles]}" if options[:roles]
70
66
 
71
- run("ssh", host, "echo 'Running Puppet [recipe: #{recipe}]...';cd #{WORK_DIR} && RECIPE=#{recipe} #{extra} shadow_puppet #{ROOT_MANIFEST}")
67
+ run "cat #{File.expand_path("files/mix.sh", Blender::ROOT)} | ssh #{host} #{env_config} /bin/bash -eu"
@@ -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.8"
8
+ s.version = "0.0.10"
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"]
@@ -36,6 +36,7 @@ http://reductivelabs.com/products/puppet/
36
36
  "VERSION",
37
37
  "bin/blender",
38
38
  "files/bootstrap.sh",
39
+ "files/mix.sh",
39
40
  "lib/blender.rb",
40
41
  "lib/blender/cli/init.rb",
41
42
  "lib/blender/cli/mix.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 8
9
- version: 0.0.8
8
+ - 10
9
+ version: 0.0.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Vitaly Kushner
@@ -71,6 +71,7 @@ files:
71
71
  - VERSION
72
72
  - bin/blender
73
73
  - files/bootstrap.sh
74
+ - files/mix.sh
74
75
  - lib/blender.rb
75
76
  - lib/blender/cli/init.rb
76
77
  - lib/blender/cli/mix.rb