-
Notifications
You must be signed in to change notification settings - Fork 5
/
Vagrantfile
37 lines (37 loc) · 1.19 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
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y git python-virtualenv python-pip python-dev
mkdir -p /opt
cd /opt
git clone https://github.com/kx499/ostip.git
virtualenv ostip
cd ostip
bin/pip install -r requirements.txt
scripts/install-redis.sh --DoNotStartRedis
SHELL
config.vm.provision "shell", run: 'always', inline: <<-SHELL
cd /opt
redis-stable/src/redis-server &
cd /opt/ostip
mkdir -p tmp
touch tmp/ostip_access.log
sudo chown -R vagrant:vagrant /opt/ostip
SHELL
config.vm.provision "shell", inline: <<-SHELL
cd /opt/ostip
./db_create.py
touch feeder/feed.json
if [ -z `cat feeder/feed.json` ]; then echo "[]" > feeder/feed.json ; fi
SHELL
config.vm.provision "shell", run: 'always', inline: <<-SHELL
cd /opt/ostip
mkdir -p tmp
touch tmp/ostip_access.log
sudo chown -R vagrant:vagrant /opt/ostip
sudo -u vagrant -- bin/celery -A tasks.celery worker --loglevel=info --beat &
sudo -u vagrant -- ./run.py --prod &
SHELL
end