forked from hacklabr/timtec
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Vagrantfile
32 lines (26 loc) · 1.15 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
TIMTEC_USER = "vagrant"
$runserver = <<SCRIPT
# must run with vagrant user
# cd /vagrant
cd /home/vagrant/timtec
~/env/bin/python manage.py migrate
tmux -2 new-session -d -s vagrant -n 'django'
tmux send-keys "/home/vagrant/env/bin/python manage.py runserver 0.0.0.0:8000" C-m
SCRIPT
Vagrant.configure('2') do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision :shell, path: "scripts/bootstrap-ubuntu.sh", privileged: false, keep_color: true
# config.vm.provision :shell, path: "scripts/production-ubuntu.sh", privileged: false, keep_color: true
#config.vm.provision "shell",
# inline: $runserver,
# privileged: false,
# run: "always"
config.vm.network "forwarded_port", guest: 8000, host: 8100
config.vm.network "forwarded_port", guest: 5432, host: 8150
config.ssh.username = TIMTEC_USER
config.vm.synced_folder "./", "/home/" + TIMTEC_USER + "/timtec/", create: true
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/me.pub"
config.vm.provision "shell", inline: "cat ~/.ssh/me.pub >> ~/.ssh/authorized_keys"
end