Handle not ready repos
[gitorious:mainline.git] / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3
4 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5 VAGRANTFILE_API_VERSION = "2"
6
7 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
9   config.vm.provider :virtualbox do |vb, override|
10     override.vm.box = "ubuntu/trusty64"
11     override.vm.network :forwarded_port, guest: 80, host: 8080
12     override.vm.network :forwarded_port, guest: 443, host: 8443
13     override.vm.network :forwarded_port, guest: 3000, host: 3000
14     override.vm.synced_folder ".", "/vagrant", type: "nfs"
15     override.vm.network "private_network", ip: "10.5.7.5"
16     vb.memory = 2048
17     vb.cpus = 2
18     vb.customize ["modifyvm", :id, "--ioapic", "on"]
19   end
20
21   config.vm.provision :shell, inline: <<EOS
22     set -e
23
24     export DEBIAN_FRONTEND=noninteractive
25
26     apt-get update
27
28     apt-get install -y memcached redis-server mysql-server git \
29       build-essential libmysqlclient-dev libxml2-dev libxslt1-dev \
30       libreadline6 libicu-dev imagemagick nodejs mysql-client cmake \
31       pkg-config nginx
32
33     cd /tmp
34     wget -O ruby-install-0.4.3.tar.gz https://github.com/postmodern/ruby-install/archive/v0.4.3.tar.gz
35     tar -xzvf ruby-install-0.4.3.tar.gz
36     cd ruby-install-0.4.3/
37     make install
38
39     ruby-install -p https://gist.githubusercontent.com/plexus/10021261/raw/305492ebd17308e55eee1baab27568fafaa940cb/ruby-2.0-p451-readline.patch ruby 2.0
40
41     cd /tmp
42     wget -O chruby-0.3.8.tar.gz https://github.com/postmodern/chruby/archive/v0.3.8.tar.gz
43     tar -xzvf chruby-0.3.8.tar.gz
44     cd chruby-0.3.8/
45     make install
46
47     cat <<EOF >/etc/profile.d/chruby.sh
48 source /usr/local/share/chruby/chruby.sh
49 source /usr/local/share/chruby/auto.sh
50 EOF
51
52
53     cat <<EOF >/usr/bin/gitorious
54 #!/bin/bash
55 source /etc/profile.d/chruby.sh
56 cd /vagrant
57 exec bin/gitorious "$@"
58 EOF
59
60     chmod a+x /usr/bin/gitorious
61 EOS
62
63 end