forked from mytardis/mytardis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
47 lines (35 loc) · 1.62 KB
/
build.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
#!/bin/bash
echo This is a guide only, please either edit or run appropriate commands manually
exit
# for Ubuntu 14.04
# sudo bash install-ubuntu-requirements.sh
# # optionally:
# # sudo apt-get install memcached python-memcache
# for OS X we need these dependencies installed via brew
# brew install imagemagick --with-libtiff
# brew install libmagic freetype
# brew install postgresql
# or for a local development server, install http://postgresapp.com/
# for Ubuntu 14.04
# source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
# for OS X
# source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv --system-site-packages mytardis
pip install -U pip
pip install -r requirements.txt
# for OS X, but might also need some brew requirements.
pip install -r requirements-osx.txt
npm install
mkdir -p var/store
# execute this wonderful command to have your settings.py created/updated
# with a generated Django SECRET_KEY (required for MyTardis to run)
python -c "import os; from random import choice; key_line = '%sSECRET_KEY=\"%s\" # generated from build.sh\n' % ('from tardis.settings_changeme import * \n\n' if not os.path.isfile('tardis/settings.py') else '', ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789\\!@#$%^&*(-_=+)') for i in range(50)])); f=open('tardis/settings.py', 'a+'); f.write(key_line); f.close()"
python test.py
# for empty databases, sync all and fake migrate, otherwise run a real migration
python mytardis.py migrate
python mytardis.py createcachetable default_cache
python mytardis.py createcachetable celery_lock_cache
python mytardis.py collectstatic
python mytardis.py runserver
# os x:
open http://127.0.0.1:8000/