#!/bin/bash # A provisioning script for installing deps on ubuntu set -eo pipefail cd /vagrant PACKAGES=( 'gcc' 'git' 'python-dev' 'python-pip' 'libpq-dev' 'ruby1.9.1-full' 'ruby1.9.3' 'npm' 'redis-tools' 'redis-server' 'libsasl2-dev' 'libldap2-dev' ) # OS-specific install instructions case $(lsb_release -sc) in "precise") # add-apt-repository is not available in the base system if ! which add-apt-repository; then apt-get update apt-get install -y python-software-properties fi ;; "trusty") # add-apt-repository is not available in the base system if ! which add-apt-repository; then apt-get update apt-get install -y software-properties-common fi ;; esac add-apt-repository -y ppa:chris-lea/redis-server apt-get update apt-get install -y --force-yes ${PACKAGES[@]} gem install foreman # ubuntu 14.04 has `nodejs` not `node` [ ! -f /usr/bin/node ] && ln -s /usr/bin/nodejs /usr/bin/node pip install virtualenv if [ ! -d /home/vagrant/venv ]; then virtualenv --no-site-packages /home/vagrant/venv/ fi npm install --no-color -g coffee-script less@1.3 --registry http://registry.npmjs.org/ # eco browserify /home/vagrant/venv/bin/pip install --timeout=30 --exists-action=w -e /vagrant/ --no-use-wheel # Start redis sudo service redis-server restart # Add in a venv activate to our bash profile profile_file=/home/vagrant/.bashrc if ! grep -q 'venv' "${profile_file}" ; then echo -e ". ~/venv/bin/activate\ncd /vagrant/" >> ${profile_file} fi if ! grep -q '/vagrant/bin/activate' "${profile_file}" ; then echo -e ". /vagrant/bin/activate" >> ${profile_file} fi