-
Notifications
You must be signed in to change notification settings - Fork 115
/
provision.sh
executable file
·47 lines (37 loc) · 1016 Bytes
/
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
47
#! /usr/bin/env bash
set -e
sudo apt-get update
sudo apt-get install -y tar curl git
# Libraries required to build a complete python with pyenv:
# https://github.com/yyuu/pyenv/wiki
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev
# Install pyenv
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo '
# Pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
' >> ~/.bash_profile
source ~/.bash_profile
hash
pushd /vagrant
# Submodules
git submodule update --init --recursive
# Install our python version
pyenv install
pyenv rehash
# Install a virtualenv
pip install virtualenv
if [ ! -d venv ]; then
virtualenv venv
fi
source venv/bin/activate
# Lastly, our dependencies
pip install -r requirements.txt
popd
echo 'cd /vagrant/' >> ~/.bash_profile
echo '
. /vagrant/venv/bin/activate
' >> ~/.bash_profile