summaryrefslogtreecommitdiff
path: root/Vagrantfile
blob: 30fd6d1d6cc7fadb7131ed90d1997522d37d6b4b (plain)
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

$script = <<SCRIPT
apt-get update
apt-get install -y apache2 php5 php5-sqlite php5-mysql php5-pgsql php5-gd curl unzip php5-curl && \
apt-get clean && \
echo "ServerName localhost" >> /etc/apache2/apache2.conf && \
sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf && \
a2enmod rewrite

service apache2 restart

rm -f /var/www/html/index.html
date > /etc/vagrant_provisioned_at

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

cd /var/www/html && composer install

wget -q https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit

SCRIPT

Vagrant.configure("2") do |config|

  config.vm.define "ubuntu" do |m|
    m.vm.box = "ubuntu/trusty64"
    m.vm.provision "shell", inline: $script
    m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data"
    m.vm.network :forwarded_port, guest: 80, host: 8001
  end
end