forked from jamtur01/hudson-ec2-build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·57 lines (48 loc) · 1.42 KB
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# Fix path for solaris
export PATH=/usr/gnu/bin/:$PATH
# Install Ruby
if [ -f /usr/bin/yum ]
then
yum install -y ruby rdoc
elif [ -f /usr/bin/apt-get ]
then
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y ruby libopenssl-ruby rdoc
elif [ -f /usr/bin/emerge ]
then
emerge dev-lang/ruby
elif [ -f /usr/bin/pkg ]
then
pkg install -q SUNWruby18
fi
# Download the latest stable puppet
rm -rf puppet*
wget -O puppet.tgz http://puppetlabs.com/downloads/puppet/puppet-latest.tgz
tar zxf puppet.tgz
rm puppet.tgz
mv puppet* puppet
# Download the latest stable facter
rm -rf facter*
wget -O facter.tgz http://puppetlabs.com/downloads/facter/facter-latest.tgz
tar zxf facter.tgz
rm facter.tgz
mv facter* facter
# Download the latest rubygems
rm -rf rubygems*
wget -O rubygems.tgz http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar zxf rubygems.tgz
cd rubygems*
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/bin/gem || true
cd
# Patch Puppet
cd puppet
patch -p1 < $HOME/hudson-ec2-build/patches/puppet_gem_options.patch
patch -p1 < $HOME/hudson-ec2-build/patches/puppet_pkg.patch
mv $HOME/hudson-ec2-build/pkg.rb lib/puppet/provider/package
# Get ready to run puppet
export PATH=$HOME/puppet/bin:$HOME/puppet/sbin:$HOME/facter/bin:$PATH
export RUBYLIB=$HOME/facter/lib:$HOME/puppet/lib
puppet --color false --modulepath=$HOME/hudson-ec2-build $HOME/hudson-ec2-build/manifest.pp