-
Notifications
You must be signed in to change notification settings - Fork 77
/
provision.sh
46 lines (37 loc) · 1.28 KB
/
provision.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/bash
set -e
sudo apt-get update
sudo apt-get install -y autoconf bison build-essential git g++ libssl-dev libyaml-dev \
libreadline6-dev zlib1g-dev libncurses5-dev redis-server fontconfig libxml2-dev \
libxslt-dev libffi-dev
# Rbenv
if [ ! -e /home/vagrant/.rbenv ]; then
git clone https://github.com/sstephenson/rbenv.git /home/vagrant/.rbenv
echo 'export PATH="/home/vagrant/.rbenv/bin:$PATH"' >> /home/vagrant/.bash_profile
echo 'eval "$(rbenv init -)"' >> /home/vagrant/.bash_profile
source /home/vagrant/.bash_profile
fi
if [ ! -e /home/vagrant/.rbenv/plugins/ruby-build ]; then
# Rbenv build
git clone https://github.com/sstephenson/ruby-build.git /home/vagrant/.rbenv/plugins/ruby-build
fi
# Rbenv permissions
chown -R vagrant:vagrant /home/vagrant/.rbenv
# PhantomJS for tests
version=phantomjs-1.7.0-linux-x86_64
wget http://phantomjs.googlecode.com/files/$version.tar.bz2
tar xjf $version.tar.bz2
sudo mv $version/bin/phantomjs /usr/local/bin/
echo 'export PATH=/vagrant/phantomjs/bin:$PATH' >> /home/vagrant/.bash_profile
# Dependencies
source /home/vagrant/.bash_profile
(
cd /vagrant
rbenv install
gem install bundler --no-ri --no-rdoc
rbenv rehash
bundle install
rbenv rehash
# Build
bundle exec rake core:build
)