load.sh 1.18 KB
Newer Older
1 2 3 4 5 6 7
#! /bin/sh

# create virtual env
# without --system-site-packages
test -d venv || virtualenv venv/

# install required dependencies
chris's avatar
chris committed
8
./venv/bin/pip install -U pip
chris's avatar
chris committed
9
./venv/bin/pip install -U -r requirements.txt
10

chris's avatar
chris committed
11 12 13 14 15 16 17
# Use `source venv/bin/activate`

# We do not use pip for the following apps because they require django/wagtail downgrades
test -d ext || mkdir ext
test -f ext/__init__.py || touch ext/__init__.py
test -d ext/wagtail-simple-gallery || (cd ext; git clone https://github.com/Temeez/wagtail-simple-gallery.git)
test -d ext/wagtail_simple_gallery || (cd ext; ln -s wagtail-simple-gallery/wagtail_simple_gallery .)
chris's avatar
chris committed
18 19

./venv/bin/python manage.py migrate --no-input
20 21
./venv/bin/python manage.py collectstatic --no-input

chris's avatar
chris committed
22
NAME="flyers.org-${RANDOM}"
23 24 25 26 27 28 29 30 31 32 33 34 35
test -n "$1" && NAME=$1

cat deployment/apache-vhost.example |\
    sed "s@/path/to/mysite.com@$PWD@" |\
    sed "s@/path/to/venv@$PWD/venv@" |\
    sed "s@/mysite@/flyers@" |\
    sed "s@example.com@$NAME@" > deployment/apache-vhost

cat deployment/apache-vhost-compat.example |\
    sed "s@/path/to/mysite.com@$PWD@" |\
    sed "s@/path/to/venv@$PWD/venv@" |\
    sed "s@/mysite@/flyers@" |\
    sed "s@example.com@$NAME@" > deployment/apache-vhost-compat