From 3ed2b03ad20271578cb3f70dbaa07c78bc07b3f4 Mon Sep 17 00:00:00 2001 From: PJ Dietz Date: Tue, 10 Mar 2015 17:06:27 -0400 Subject: [PATCH] Create initial Vagrant files. --- .gitignore | 3 +++ Vagrantfile | 6 ++++++ vagrant/log-in-message.txt | 9 +++++++++ vagrant/provision.sh | 20 ++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 Vagrantfile create mode 100644 vagrant/log-in-message.txt create mode 100644 vagrant/provision.sh diff --git a/.gitignore b/.gitignore index 965ee81..6c0c488 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ preview # PhpStorm workspace.xml + +# Vagrant +.vagrant/ diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..7b6a3d8 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,6 @@ +Vagrant.configure("2") do |config| + # Ubuntu 14.04 LTS + config.vm.box = "ubuntu/trusty64" + config.vm.network "forwarded_port", guest: 80, host: 8000 + config.vm.provision "shell", path: "vagrant/provision.sh" +end diff --git a/vagrant/log-in-message.txt b/vagrant/log-in-message.txt new file mode 100644 index 0000000..cfeadab --- /dev/null +++ b/vagrant/log-in-message.txt @@ -0,0 +1,9 @@ +Welcome to the WellRESTed development box. + +To run unit tests: + vendor/bin/phpunit + +To generate documentation: + make html -C docs + + diff --git a/vagrant/provision.sh b/vagrant/provision.sh new file mode 100644 index 0000000..42c6c4b --- /dev/null +++ b/vagrant/provision.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +apt-get update +apt-get install -q -y git augeas-tools nginx php5 php5-fpm php5-cli php5-curl php5-xdebug python-pip + +# Install or update composer. +if type composer &> /dev/null; then + composer self-update +else + curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin +fi + +pip install sphinx sphinx_rtd_theme + +composer --working-dir=/vagrant install + +if ! grep /home/vagrant/.bashrc -e "cd /vagrant" &> /dev/null ; then + echo "cd /vagrant" >> /home/vagrant/.bashrc + echo "cat /vagrant/vagrant/log-in-message.txt" >> /home/vagrant/.bashrc +fi