deploy 982 Bytes
Newer Older
Jamesie Pic's avatar
Jamesie Pic committed
1 2 3 4 5 6 7 8 9
#!/bin/bash
# This deploy hook gets executed after dependencies are resolved and the
# build hook has been run but before the application has been started back
# up again.  This script gets executed directly, so it could be python, php,
# ruby, etc.
set -xe

source ${OPENSHIFT_HOMEDIR}app-root/runtime/dependencies/python/virtenv/bin/activate

10 11
pip2 install --no-cache-dir -U pip
pip2 install --no-cache-dir -Ue ${OPENSHIFT_REPO_DIR}
Jamesie Pic's avatar
Jamesie Pic committed
12

13 14
mkdir -p ${OPENSHIFT_DATA_DIR}media

Jamesie Pic's avatar
Jamesie Pic committed
15
pushd ${OPENSHIFT_REPO_DIR}
16
	if [ -f ${OPENSHIFT_DATA_DIR}sentry ]; then
17
	    pip2 --no-cache-dir install raven
18
	fi
Jamesie Pic's avatar
Jamesie Pic committed
19

Jamesie Pic's avatar
Jamesie Pic committed
20
	src/memopol/bin/install_client_deps.sh
21 22 23

	mkdir -p wsgi/static

Jamesie Pic's avatar
Jamesie Pic committed
24 25
	[ -f src/memopol/local_settings.py ] && rm src/memopol/local_settings.py
	cp .openshift/local_settings.py src/memopol/local_settings.py
26

Jamesie Pic's avatar
Jamesie Pic committed
27 28
	memopol migrate --noinput
	memopol collectstatic --noinput
29 30 31 32

	ln -sf ${OPENSHIFT_DATA_DIR}media wsgi/static/media
	ln -sf ${OPENSHIFT_DATA_DIR}compress/CACHE wsgi/static/collected/CACHE
popd