diff --git a/Vagrantfile b/Vagrantfile index 0d409cc408..10218bb1c0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -22,12 +22,13 @@ Vagrant.configure("2") do |config| config.vm.provider :virtualbox do |vb| # Use VBoxManage to customize the VM. For example to change memory: - vb.customize ["modifyvm", :id, "--memory", "1024"] + vb.customize ["modifyvm", :id, "--memory", "2048"] # This setting makes it so that network access from inside the vagrant guest # is able to resolve DNS using the hosts VPN connection. vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end + config.vm.provision :shell, :path => "scripts/install-acceptance-req.sh" config.vm.provision :shell, :path => "scripts/vagrant-provisioning.sh" end diff --git a/scripts/install-acceptance-req.sh b/scripts/install-acceptance-req.sh new file mode 100755 index 0000000000..012e983f30 --- /dev/null +++ b/scripts/install-acceptance-req.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +# Install all the requirements for running the +# acceptance test suite and the JavaScript +# unit test suite. +# +# Requires 32-bit Ubuntu + +# Exit if any commands return a non-zero status +set -e + +sudo apt-get update + +sudo apt-get install unzip + +# Install xvfb +if [ -z `command -v xvfb` ]; then + echo "Installing Xvfb..." + sudo apt-get install -y xvfb + + # Install the xvfb upstart script + sudo cat > /etc/init/xvfb.conf <> .bashrc < /dev/null || sudo restart xvfb 2> /dev/null || echo "Cannot start xvfb" + +# Move to a temp directory so we can download things +cd /var/tmp + +# Install Chrome +echo "Downloading Google Chrome..." +if [ -z `command -v google-chrome` ]; then + wget --quiet https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb + sudo dpkg -i google-chrome*.deb 2> /dev/null || true + sudo apt-get -f -y install +else + echo "Already installed; skipping." +fi + +# Install ChromeDriver +echo "Installing ChromeDriver..." +if [ -z `command -v chromedriver` ]; then + wget --quiet https://chromedriver.googlecode.com/files/chromedriver_linux32_2.3.zip + unzip chromedriver_linux32_2.3.zip + sudo mv chromedriver /usr/local/bin/chromedriver + sudo chmod go+rx /usr/local/bin/chromedriver +else + echo "Already installed; skipping." +fi + +# Install Firefox +echo "Installing Firefox..." +sudo apt-get -y install firefox + +# Install dbus (required for FF) +sudo apt-get -y install dbus-x11 + +# Install PhantomJS +echo "Installing PhantomJS..." +if [ -z `command -v phantomjs` ]; then + wget --quiet "https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-i686.tar.bz2" + tar -xjf phantomjs-1.9.1-linux-i686.tar.bz2 + sudo mv phantomjs-1.9.1-linux-i686/bin/phantomjs /usr/local/bin/phantomjs +else + echo "Already installed; skipping." +fi + +exit 0