forked from wooyek/flask-social-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
70 lines (57 loc) · 2.55 KB
/
Vagrantfile
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
# ======================================
# System update and common utilities
# ======================================
cat /vagrant/.ssh_key >> .ssh/authorized_keys
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y htop git unzip
sudo apt-get install -y build-essential libffi-dev libssl-dev
sudo apt-get install -y python python-dev python-pip python-virtualenv
sudo apt-get install -y mongodb
sudo pip install virtualenvwrapper
# Change Time Zone
# dpkg-reconfigure tzdata
sudo timedatectl set-timezone Europe/Warsaw
# ======================================
# Vagrant development setup
# ======================================
echo "export WORKON_HOME=/home/vagrant/.virtualenvs" >> /home/vagrant/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> /home/vagrant/.bashrc
export WORKON_HOME=/home/vagrant/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
# ======================================
echo "Setting up virtual environments"
mkvirtualenv dev
/home/vagrant/.virtualenvs/dev/bin/pip install -r /vagrant/requirements.txt
/home/vagrant/.virtualenvs/dev/bin/pip install -r /vagrant/requirements-dev.txt
# ======================================
echo "Setting up sqla example environment"
mkvirtualenv sqla
/home/vagrant/.virtualenvs/sqla/bin/pip install -r /vagrant/example/sqla/requirements.txt
# ======================================
echo "Setting up mongodb example environment"
mkvirtualenv mongodb
/home/vagrant/.virtualenvs/mongodb/bin/pip install -r /vagrant/example/mongodb/requirements.txt
# ======================================
echo "Setting up gae example environment"
mkvirtualenv gae
/home/vagrant/.virtualenvs/gae/bin/pip install --target=/vagrant/example/gae/lib -r /vagrant/example/gae/requirements.txt
wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.30.zip
unzip google_appengine_1.9.30.zip
chown -R vagrant:vagrant /home/vagrant/.virtualenvs
SCRIPT
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "vagrant"
config.vm.provision "shell", inline: $script
config.vm.network "private_network", ip: "192.168.113.4"
config.vm.network "forwarded_port", host_ip: "127.0.0.1", host: 5055, guest: 5055
config.vm.synced_folder "example/gae/lib", "/vagrant/example/gae/lib", disabled: true
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
end