Merge pull request #159 from msysgit/vagrant
[msysgit.git] / Vagrantfile
blobb4f7425b3de731c0371e0faacab8457b37d9b2cf
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
4 # This Vagrantfile defines the requirements of a Linux development environment
5 # to develop/run Git. This environment can be set up conveniently by installing
6 # Vagrant and VirtualBox and calling "vagrant up" in the Git directory.
8 # See https://github.com/msysgit/msysgit/wiki/Vagrant for details.
10 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
11 VAGRANTFILE_API_VERSION = "2"
13 $provision = <<PROVISION
14 apt-get update
15 apt-get install -y make gcc libexpat-dev libcurl4-openssl-dev gettext tk8.5 libsvn-perl
17 # clean .profile in case we're re-provisioning
18 n="$(grep -n 'cd /vagrant' < /home/vagrant/.profile 2> /dev/null |
19         sed 's/:.*//')"
20 test -z "$n" || {
21         head -n $(($n-1)) < /home/vagrant/.profile > /tmp/.profile
22         mv /tmp/.profile /home/vagrant/.profile
25 # add a nice greeting
26 cat >> /home/vagrant/.profile << \EOF
28 cd /vagrant/git
29 export PATH=/home/vagrant/bin:$PATH
30 cat << \TOOEOF
32 Welcome to the Vagrant setup for Git!
33 --------------------------------------
35 To build & install Git, just execute
37         make -j NO_PERL_MAKEMAKER=t install
39 For more information, see https://github.com/msysgit/msysgit/wiki/Vagrant and
40 remember that this project is only as good as you make it.
41 TOOEOF
42 EOF
44 cat << EOF
46 Now that everything is set up, connect to the Vagrant machine with the command:
48         vagrant ssh
50 EOF
51 PROVISION
53 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
54   # Start with a 64-bit Ubuntu 12.04 "Precise Penguin" box
55   config.vm.box = "ubuntu"
56   config.vm.box_url = "http://files.vagrantup.com/precise64.box"
58   config.vm.provision :shell, :inline => $provision
59 end