server-blender 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/files/bootstrap.sh +133 -132
  3. data/server-blender.gemspec +3 -9
  4. metadata +7 -10
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.21
1
+ 0.0.22
data/files/bootstrap.sh CHANGED
@@ -3,15 +3,15 @@
3
3
  # log both to the 'real' stdout and into the log
4
4
  function log()
5
5
  {
6
- echo "************* $@"
7
- echo "************* $@" >&3
6
+ echo "************* $@"
7
+ echo "************* $@" >&3
8
8
  }
9
9
 
10
10
  trap "log FAILED" EXIT
11
11
 
12
12
  function banner()
13
13
  {
14
- cat <<_
14
+ cat <<_
15
15
  Bootstraping blender...
16
16
  Date: `date`
17
17
  Hostname: `hostname`
@@ -21,216 +21,217 @@ _
21
21
 
22
22
  function is_darwin()
23
23
  {
24
- [[ "`uname -s`" == "Darwin" ]]
24
+ [[ "`uname -s`" == "Darwin" ]]
25
25
  }
26
26
 
27
27
  function setup_node()
28
28
  {
29
- if [ -n "${NODE:-}" ]; then
30
- echo SET NODE: $NODE
31
- echo $NODE > /etc/node
32
- fi
29
+ if [ -n "${NODE:-}" ]; then
30
+ echo SET NODE: $NODE
31
+ echo $NODE > /etc/node
32
+ fi
33
33
  }
34
34
 
35
35
  function setup_hostname()
36
36
  {
37
- if [ -n "${HOSTNAME:-}" ]; then
38
- echo SET HOSTNAME: $HOSTNAME
39
- echo $HOSTNAME > /etc/hostname
40
- hostname $HOSTNAME
41
- fi
37
+ if [ -n "${HOSTNAME:-}" ]; then
38
+ echo SET HOSTNAME: $HOSTNAME
39
+ echo $HOSTNAME > /etc/hostname
40
+ hostname $HOSTNAME
41
+ fi
42
42
  }
43
43
 
44
44
  # initialize blender directory and redirect output to the log file
45
45
  function blender_init()
46
46
  {
47
- mkdir -p /var/lib/blender/{recipes,logs,tmp}
48
- chmod 0700 /var/lib/blender/
49
-
50
- # save stdout into fd 3
51
- exec 3>&1
52
-
53
- # redirect stdout/error to the log
54
- if [ -n "${TRACE:-}" ]; then
55
- exec 1 | tee -a /var/lib/blender/logs/blender-bootstrap.log
56
- else
57
- exec 1>> /var/lib/blender/logs/blender-bootstrap.log
58
- fi
59
- exec 2>&1
60
-
61
- cd /tmp
62
- # lets log everything
63
- set -x
47
+ mkdir -p /var/lib/blender/{recipes,logs,tmp}
48
+ chmod 0700 /var/lib/blender/
49
+
50
+ # save stdout into fd 3
51
+ exec 3>&1
52
+
53
+ # redirect stdout/error to the log
54
+ if [ -n "${TRACE:-}" ]; then
55
+ exec 1 | tee -a /var/lib/blender/logs/blender-bootstrap.log
56
+ else
57
+ exec 1>> /var/lib/blender/logs/blender-bootstrap.log
58
+ fi
59
+ exec 2>&1
60
+
61
+ cd /tmp
62
+ # lets log everything
63
+ set -x
64
64
  }
65
65
 
66
66
  function distribution()
67
67
  {
68
- echo "$DISTRIB_ID $DISTRIB_RELEASE"
68
+ echo "$DISTRIB_ID $DISTRIB_RELEASE"
69
69
  }
70
70
 
71
71
  function supported_version()
72
72
  {
73
- . /etc/lsb-release
74
-
75
- case "`distribution`" in
76
- "Ubuntu 9.10") true;;
77
- "Ubuntu 10.04") true;;
78
- "Ubuntu 10.10") true;;
79
- *) false;;
80
- esac
73
+ . /etc/lsb-release
74
+
75
+ case "`distribution`" in
76
+ "Ubuntu 9.10") true;;
77
+ "Ubuntu 10.04") true;;
78
+ "Ubuntu 10.10") true;;
79
+ "Ubuntu 11.04") true;;
80
+ *) false;;
81
+ esac
81
82
  }
82
83
 
83
84
  function check_version()
84
85
  {
85
- if ! supported_version; then
86
- log "`distribution` is not supported"
87
- exit
88
- fi
86
+ if ! supported_version; then
87
+ log "`distribution` is not supported"
88
+ exit
89
+ fi
89
90
  }
90
91
 
91
92
  XCODE=xcode_3.2.2_and_iphone_sdk_3.2_final.dmg
92
93
 
93
94
  function install_xcode()
94
95
  {
95
- if [ -e /usr/bin/gcc ]; then
96
+ if [ -e /usr/bin/gcc ]; then
96
97
 
97
- log "XCODE seems to be installed"
98
+ log "XCODE seems to be installed"
98
99
 
99
- else
100
+ else
100
101
 
101
- log "Installing XCODE..."
102
+ log "Installing XCODE..."
102
103
 
103
- if [ ! -e $XCODE ]; then
104
- log "plase download $XCODE and place it in root's home directory"
105
- exit
106
- fi
104
+ if [ ! -e $XCODE ]; then
105
+ log "plase download $XCODE and place it in root's home directory"
106
+ exit
107
+ fi
107
108
 
108
- hdiutil mount -plist -nobrowse -readonly -mountrandom /tmp -noidme $XCODE | tee /tmp/xcode-mount.xml
109
+ hdiutil mount -plist -nobrowse -readonly -mountrandom /tmp -noidme $XCODE | tee /tmp/xcode-mount.xml
109
110
 
110
- pkg_path=`cat /tmp/xcode-mount.xml | grep string | grep /tmp/ | cut '-d>' -f2 | cut '-d<' -f1`
111
+ pkg_path=`cat /tmp/xcode-mount.xml | grep string | grep /tmp/ | cut '-d>' -f2 | cut '-d<' -f1`
111
112
 
112
- log "package is mounted in $pkg_path"
113
+ log "package is mounted in $pkg_path"
113
114
 
114
- installer -pkg $pkg_path/*.mpkg -target /
115
+ installer -pkg $pkg_path/*.mpkg -target /
115
116
 
116
- hdiutil eject $pkg_path
117
+ hdiutil eject $pkg_path
117
118
 
118
- log "XCODE installed"
119
+ log "XCODE installed"
119
120
 
120
- fi
121
+ fi
121
122
  }
122
123
 
123
124
  function set_apt_options()
124
125
  {
125
- export DEBIAN_FRONTEND=noninteractive
126
- export DEBIAN_PRIORITY=critical
127
- APT_OPTS="-qy -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confnew"
126
+ export DEBIAN_FRONTEND=noninteractive
127
+ export DEBIAN_PRIORITY=critical
128
+ APT_OPTS="-qy -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confnew"
128
129
  }
129
130
 
130
131
  function apt_upgrade()
131
132
  {
132
- log "apt upgrade"
133
- apt-get update
134
- apt-get upgrade $APT_OPTS
135
- apt-get autoremove $APT_OPTS
133
+ log "apt upgrade"
134
+ apt-get update
135
+ apt-get upgrade $APT_OPTS
136
+ apt-get autoremove $APT_OPTS
136
137
  }
137
138
 
138
139
  function apt_install()
139
140
  {
140
- apt-get install $APT_OPTS "$@"
141
+ apt-get install $APT_OPTS "$@"
141
142
  }
142
143
 
143
144
  function setup_etckeeper()
144
145
  {
145
- log "installing etckeeper"
146
- apt_install git-core etckeeper
147
- cp /etc/etckeeper/etckeeper.conf /etc/etckeeper/etckeeper.conf.orig
148
- # etckeeper comes configured for bazr. use git instead.
149
- (rm /etc/etckeeper/etckeeper.conf; awk "/^\s*VCS=/{sub(/.*/, \"VCS=git\")};{print}" > /etc/etckeeper/etckeeper.conf) < /etc/etckeeper/etckeeper.conf
150
- etckeeper init
151
- etckeeper commit "import during bootstrap" || true
146
+ log "installing etckeeper"
147
+ apt_install git-core etckeeper
148
+ cp /etc/etckeeper/etckeeper.conf /etc/etckeeper/etckeeper.conf.orig
149
+ # etckeeper comes configured for bazr. use git instead.
150
+ (rm /etc/etckeeper/etckeeper.conf; awk "/^\s*VCS=/{sub(/.*/, \"VCS=git\")};{print}" > /etc/etckeeper/etckeeper.conf) < /etc/etckeeper/etckeeper.conf
151
+ etckeeper init
152
+ etckeeper commit "import during bootstrap" || true
152
153
  }
153
154
 
154
155
  function install_stuff()
155
156
  {
156
- log "installing required packages"
157
- apt_install rsync build-essential zlib1g-dev libssl-dev libreadline5-dev wget bind9-host
157
+ log "installing required packages"
158
+ apt_install rsync build-essential zlib1g-dev libssl-dev libreadline5-dev wget bind9-host
158
159
  }
159
160
 
160
161
  function install_system_ruby()
161
162
  {
162
- log "installing system ruby"
163
- apt_install ruby irb ruby-dev libopenssl-ruby
163
+ log "installing system ruby"
164
+ apt_install ruby irb ruby-dev libopenssl-ruby
164
165
  }
165
166
 
166
167
  function install_system_rubygems()
167
168
  {
168
- log "installing system rubygems"
169
- apt_install rubygems
169
+ log "installing system rubygems"
170
+ apt_install rubygems
170
171
  }
171
172
 
172
173
  function upgrade_rubygems()
173
174
  {
174
- log "upgrading rubygems"
175
- gem install --no-rdoc --no-ri rubygems-update
176
- update_rubygems
175
+ log "upgrading rubygems"
176
+ gem install --no-rdoc --no-ri rubygems-update
177
+ update_rubygems
177
178
  }
178
179
 
179
180
  UPSTREAM_GEMS_VERSION=1.3.6
180
181
  function install_custom_rubygems()
181
182
  {
182
- log "installing custom rubygems"
183
- # remove system rubygems if exist
184
- apt-get remove -qy --purge rubygems
185
- apt-get autoremove -qy
186
-
187
- # download and install gems
188
- cd /tmp
189
- wget http://production.cf.rubygems.org/rubygems/rubygems-$UPSTREAM_GEMS_VERSION.tgz
190
- tar xfz rubygems-$UPSTREAM_GEMS_VERSION.tgz
191
- pushd rubygems-$UPSTREAM_GEMS_VERSION
192
- ruby setup.rb --no-rdoc --no-ri
193
- ln -sfn /usr/bin/gem1.8 /usr/bin/gem
183
+ log "installing custom rubygems"
184
+ # remove system rubygems if exist
185
+ apt-get remove -qy --purge rubygems
186
+ apt-get autoremove -qy
187
+
188
+ # download and install gems
189
+ cd /tmp
190
+ wget http://production.cf.rubygems.org/rubygems/rubygems-$UPSTREAM_GEMS_VERSION.tgz
191
+ tar xfz rubygems-$UPSTREAM_GEMS_VERSION.tgz
192
+ pushd rubygems-$UPSTREAM_GEMS_VERSION
193
+ ruby setup.rb --no-rdoc --no-ri
194
+ ln -sfn /usr/bin/gem1.8 /usr/bin/gem
194
195
  }
195
196
 
196
197
  # adds /var/lib/gems/1.8/bin to paths. only needed with the system (debian) braindead gems
197
198
  function add_gems_to_system_path()
198
199
  {
199
- log "fixing system path"
200
- ## # default /etc/login.defs
201
- ## ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
202
- ## ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
203
- ## # default /etc/environment
204
- ## PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
205
- ##
206
- ## When loggin-in over SSH /etc/environment path is active
207
- ## When doing "su - xxx" - /etc/login.defs path is active
208
-
209
- etckeeper commit "before PATH update" || true
210
-
211
- ENV_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/lib/gems/1.8/bin
212
- USER_PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/var/lib/gems/1.8/bin
213
- ROOT_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/gems/1.8/bin
214
-
215
- cat <<-ENV >/etc/environment
200
+ log "fixing system path"
201
+ ## # default /etc/login.defs
202
+ ## ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
203
+ ## ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
204
+ ## # default /etc/environment
205
+ ## PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
206
+ ##
207
+ ## When loggin-in over SSH /etc/environment path is active
208
+ ## When doing "su - xxx" - /etc/login.defs path is active
209
+
210
+ etckeeper commit "before PATH update" || true
211
+
212
+ ENV_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/lib/gems/1.8/bin
213
+ USER_PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/var/lib/gems/1.8/bin
214
+ ROOT_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/gems/1.8/bin
215
+
216
+ cat <<-ENV >/etc/environment
216
217
  PATH="$ENV_PATH"
217
218
  ENV
218
219
 
219
- ( rm /etc/login.defs; awk "/^\s*ENV_SUPATH/{sub(/.*/, \"ENV_SUPATH PATH=$ROOT_PATH\")};/^\s*ENV_PATH/{sub(/.*/, \"ENV_PATH PATH=$USER_PATH\")};{print}" > /etc/login.defs ) < /etc/login.defs
220
+ ( rm /etc/login.defs; awk "/^\s*ENV_SUPATH/{sub(/.*/, \"ENV_SUPATH PATH=$ROOT_PATH\")};/^\s*ENV_PATH/{sub(/.*/, \"ENV_PATH PATH=$USER_PATH\")};{print}" > /etc/login.defs ) < /etc/login.defs
220
221
 
221
- etckeeper commit "after PATH update" || true
222
+ etckeeper commit "after PATH update" || true
222
223
  }
223
224
 
224
225
  function install_rubygems()
225
226
  {
226
- if [[ "${USE_SYSTEM_GEMS:-y}" == "y" ]]; then
227
- install_system_rubygems
228
- add_gems_to_system_path
229
- else
230
- install_custom_rubygems
231
- upgrade_rubygems
232
- # upstream rubygems install executables into /usr/bin so no need to fix the path
233
- fi
227
+ if [[ "${USE_SYSTEM_GEMS:-y}" == "y" ]]; then
228
+ install_system_rubygems
229
+ add_gems_to_system_path
230
+ else
231
+ install_custom_rubygems
232
+ upgrade_rubygems
233
+ # upstream rubygems install executables into /usr/bin so no need to fix the path
234
+ fi
234
235
  }
235
236
 
236
237
  #########################################################
@@ -244,18 +245,18 @@ setup_node
244
245
  setup_hostname
245
246
 
246
247
  if is_darwin; then
247
- install_xcode
248
+ install_xcode
248
249
  else
249
- check_version
250
- set_apt_options
251
- apt_upgrade
252
- setup_etckeeper
253
- install_stuff
254
- install_system_ruby
255
- install_rubygems
256
- #add_gems_to_system_path
257
-
258
- etckeeper commit "bootstrapped" || true # might have nothing to commit
250
+ check_version
251
+ set_apt_options
252
+ apt_upgrade
253
+ setup_etckeeper
254
+ install_stuff
255
+ install_system_ruby
256
+ install_rubygems
257
+ #add_gems_to_system_path
258
+
259
+ etckeeper commit "bootstrapped" || true # might have nothing to commit
259
260
  fi
260
261
 
261
262
  log "Installing some gems"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{server-blender}
8
- s.version = "0.0.21"
8
+ s.version = "0.0.22"
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"]
12
- s.date = %q{2011-02-27}
12
+ s.date = %q{2011-07-11}
13
13
  s.default_executable = %q{blender}
14
14
  s.description = %q{Boostrap and manage servers with shadow_puppet
15
15
 
@@ -51,14 +51,8 @@ http://reductivelabs.com/products/puppet/
51
51
  ]
52
52
  s.homepage = %q{http://astrails.com/opensource/server-blender}
53
53
  s.require_paths = ["lib"]
54
- s.rubygems_version = %q{1.5.0}
54
+ s.rubygems_version = %q{1.6.2}
55
55
  s.summary = %q{Server provisioning and configuration management tool}
56
- s.test_files = [
57
- "spec/cli/init_spec.rb",
58
- "spec/cli/mix_spec.rb",
59
- "spec/cli/start_spec.rb",
60
- "spec/spec_helper.rb"
61
- ]
62
56
 
63
57
  if s.respond_to? :specification_version then
64
58
  s.specification_version = 3
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server-blender
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 21
10
- version: 0.0.21
9
+ - 22
10
+ version: 0.0.22
11
11
  platform: ruby
12
12
  authors:
13
13
  - Vitaly Kushner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-27 00:00:00 +02:00
18
+ date: 2011-07-11 00:00:00 +03:00
19
19
  default_executable: blender
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -118,12 +118,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements: []
119
119
 
120
120
  rubyforge_project:
121
- rubygems_version: 1.5.0
121
+ rubygems_version: 1.6.2
122
122
  signing_key:
123
123
  specification_version: 3
124
124
  summary: Server provisioning and configuration management tool
125
- test_files:
126
- - spec/cli/init_spec.rb
127
- - spec/cli/mix_spec.rb
128
- - spec/cli/start_spec.rb
129
- - spec/spec_helper.rb
125
+ test_files: []
126
+