-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
bootstrap.sh
42 lines (32 loc) · 1.42 KB
/
bootstrap.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
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
echo "Provisioning"
sudo apt-get update -qq
sudo apt-get install -y -qq python-software-properties
sudo add-apt-repository -y ppa:rwky/redis > /dev/null
sudo apt-get update -qq
sudo apt-get install -y -qq redis-server
sudo apt-get install -y -qq openjdk-7-jre-headless
echo "Installing Elasticsearch"
wget -q https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.deb
sudo dpkg -i elasticsearch-1.4.2.deb > /dev/null
sudo service elasticsearch start
echo "Installing Elasticsearch head plugin"
sudo /usr/share/elasticsearch/bin/plugin --install mobz/elasticsearch-head
sudo apt-get install -y make libxml2-dev libxslt1-dev libssl-dev libffi-dev libtiff4-dev libjpeg8-dev liblcms2-dev python-dev python-setuptools python-virtualenv git > /dev/null
sudo easy_install -q pip
virtualenv -q ocd
chown -R vagrant:vagrant ocd
echo "source /home/vagrant/ocd/bin/activate; cd /vagrant;" >> ~/.bashrc
echo "Installing requirements"
source ocd/bin/activate
cd /vagrant
pip install -q -r requirements.txt
echo "Starting"
./manage.py elasticsearch create_indexes /vagrant/es_mappings/
./manage.py elasticsearch put_template
echo ". ocd/bin/activate"
echo "python ./manage.py frontend runserver"
echo "python ./manage.py extract list_sources"
echo "python ./manage.py extract start rijksmuseum"
echo "celery --app=ocd_backend:celery_app worker --loglevel=info --concurrency=2"