Skip to content

Commit

Permalink
Update to Wheeze release
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed May 10, 2013
1 parent a41e8d5 commit c343442
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 73 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ end

group :test do
gem "rake"
#gem "vagrant" , "1.0.7"
gem "vagrant", github: "mitchellh/vagrant", tag: "v1.2.2"
# gem "vagrant" , "1.0.7"
#gem "chef"
#gem "knife-windows"
end
Expand Down
8 changes: 4 additions & 4 deletions gen_elexis_vbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def system(cmd)
#puts "We always edit the templates file, not the definition"
puts "if anything goes wrong. You might try to login using
# ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l vagrant 127.0.0.1"
exit unless system("vagrant basebox define #{buildTarget} #{name} --force")
exit unless system("vagrant basebox build #{buildTarget} --force")
exit unless system("vagrant basebox export #{buildTarget} --force")
exit unless system("vagrant box add #{name} #{name}-#{buildTarget}.box --force")
exit unless system("veewee vbox define #{buildTarget} #{name} --force")
exit unless system("veewee vbox build #{buildTarget} --force")
exit unless system("veewee vbox export #{buildTarget} --force")
exit unless system("veewee vbox box add #{buildTarget} #{File.expand_path(buildTarget)}.box --force")
if 0
exit unless system("vagrant init #{buildTarget}")
exit unless system("vagrant up")
Expand Down
2 changes: 1 addition & 1 deletion templates/Elexis-Wheezy-amd64/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant
echo 'UseDNS no' >> /etc/ssh/sshd_config

# Remove 5s grub timeout to speed up booting
echo <<EOF > /etc/default/grub
cat <<EOF > /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
Expand Down
6 changes: 3 additions & 3 deletions templates/Elexis-Wheezy-amd64/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
:memory_size=> '512',
:disk_size => '40000', :disk_format => 'VDI', :hostiocache => 'off',
:os_type_id => 'Debian_64',
:iso_file => "debian-wheezy-DI-rc1-amd64-netinst.iso",
:iso_src => "http://cdimage.debian.org/cdimage/wheezy_di_rc1/amd64/iso-cd/debian-wheezy-DI-rc1-amd64-netinst.iso",
:iso_md5 => "412f77d4b98adf2a7d575745fd282d78",
:iso_file => "debian-7.0.0-amd64-netinst.iso",
:iso_src => "http://cdimage.debian.org/cdimage/release/7.0.0/amd64/iso-cd/debian-7.0.0-amd64-netinst.iso",
:iso_md5 => "6a55096340b5b1b7d335d5b559e13ea0",
:iso_download_timeout => "1000",
:boot_wait => "10", :boot_cmd_sequence => [
'<Esc>',
Expand Down
3 changes: 0 additions & 3 deletions templates/Elexis-Wheezy-amd64/puppet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# To update the path to get access the newly installed rvm/gem/ruby we need to source /etc/profile
source /etc/profile

if [ -f .veewee_params ]
then
. .veewee_params
Expand Down
71 changes: 10 additions & 61 deletions templates/Elexis-Wheezy-amd64/ruby.sh
Original file line number Diff line number Diff line change
@@ -1,61 +1,10 @@
debInst()
{
dpkg-query -Wf'${db:Status-abbrev}' "${1}" 2>/dev/null | grep -q '^i'
}

packets_needed="curl"
for j in $packets_needed
do
if debInst $j; then
echo $j seems to be already installed
else
apt-get install $j
if [ $? -ne 0 ] ; then exit 1; fi
fi
done

echo "gem: --no-ri --no-rdoc" > /root/.gemrc

echo "(Re)installing needed packets for RVM and ruby"
apt-get --assume-yes --no-install-recommends install bash curl git patch bzip2 \
build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev \
libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf \
libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion libffi-dev libvirt-dev \
ruby1.9.1 libaugeas-ruby
if [ $? -ne 0 ] ; then exit 1; fi

if false
then
# install rvm and ruby 1.9.3
RUBY_VERSION="1.9.3"

# Similar to https://raw.github.com/ngiger/elexis-vagrant/with_hiera/bootstrap_debian.sh
# Thanks to ideas from templates/ubuntu-11.10-server-amd64-rvm/postinstall.sh
# Install Ruby Version Manager
echo "Installing rvm as multi user into $RVM_MULTI_PATH"
curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -o /tmp/rvm-installer
chmod +x /tmp/rvm-installer
sudo /tmp/rvm-installer --autolibs=3 stable

# Enable RVM for all users
(cat <<'EOP'
[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"
EOP
) > /etc/profile.d/rvm.sh
echo "gem: --no-rdoc --no-ri" > /home/vagrant/.gemrc
chown vagrant:vagrant /home/vagrant/.gemrc


# Install Ruby using RVM
echo "Installing Ruby ${RUBY_VERSION} as default ruby"
bash -c '
source /etc/profile
rvm install ${RUBY_VERSION}
echo ruby ${RUBY_VERSION} installed
rvm alias create default ruby-${RUBY_VERSION}
rvm use ${RUBY_VERSION} --default
'

# Make default user member of RVM group
usermod -a -G rvm vagrant
fi
# Install Ruby from packages
apt-get -y install ruby1.9.1 ruby-dev libopenssl-ruby1.8 libopenssl-ruby1.9.1 irb ri rdoc libaugeas-ruby

# Install Rubygems from source
rg_ver=1.8.22
curl -o /tmp/rubygems-${rg_ver}.zip \
"http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip"
(cd /tmp && unzip rubygems-${rg_ver}.zip && \
cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable)
rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip

0 comments on commit c343442

Please sign in to comment.