|
| 1 | +# -*- mode: ruby -*- |
| 2 | +# vi: set ft=ruby : |
| 3 | + |
| 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 /usr/src/git directory. |
| 7 | +# |
| 8 | +# See https://github.com/git-for-windows/git/wiki/Vagrant for details. |
| 9 | + |
| 10 | +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! |
| 11 | +VAGRANTFILE_API_VERSION = "2" |
| 12 | + |
| 13 | +$provision = <<PROVISION |
| 14 | +apt-get update |
| 15 | +apt-get install -y make gcc libexpat-dev libcurl4-openssl-dev gettext tk8.6 libsvn-perl |
| 16 | +
|
| 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 |
| 23 | +} |
| 24 | +
|
| 25 | +# add a nice greeting |
| 26 | +cat >> /home/vagrant/.profile << \EOF |
| 27 | +
|
| 28 | +cd /vagrant/ |
| 29 | +export PATH=/home/vagrant/bin:$PATH |
| 30 | +cat << \TOOEOF |
| 31 | +
|
| 32 | +Welcome to the Vagrant setup for Git! |
| 33 | +-------------------------------------- |
| 34 | +
|
| 35 | +To build & install Git, just execute |
| 36 | +
|
| 37 | + make -j NO_PERL_MAKEMAKER=t install |
| 38 | +
|
| 39 | +For more information, see https://github.com/git-for-windows/git/wiki/Vagrant |
| 40 | +TOOEOF |
| 41 | +EOF |
| 42 | +
|
| 43 | +cat << EOF |
| 44 | +
|
| 45 | +Now that everything is set up, connect to the Vagrant machine with the command: |
| 46 | +
|
| 47 | + vagrant ssh |
| 48 | +
|
| 49 | +EOF |
| 50 | +PROVISION |
| 51 | + |
| 52 | +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 53 | + config.vm.box = "ubuntu/trusty64" |
| 54 | + config.vm.box_url = "https://atlas.hashicorp.com/ubuntu/boxes/trusty64" |
| 55 | + |
| 56 | + config.vm.provision :shell, :inline => $provision |
| 57 | +end |
0 commit comments