-
Notifications
You must be signed in to change notification settings - Fork 1
/
entrypoint.sh
executable file
·65 lines (60 loc) · 1.25 KB
/
entrypoint.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
function wait_for {
while ! $(nc -z $1 $2); do
echo 'Waiting for $1:$2';
sleep 2;
done
}
function wait_db { wait_for db 5432; }
function wait_redis { wait_for redis 6379; }
echo "Launching $@"
wait_db
case "$1" in
'upgrade')
# Set media volume permissions
chown -R web /code/media
chown -R web /celery-beat-store
./manage.py migrate
;;
'app')
wait_redis
IS_WEB=1 uwsgi /code/serviceform_project/uwsgi.ini
;;
'send-emails')
./manage.py send_emails
;;
'task-processor')
./manage.py task_processor
;;
'celery')
wait_redis
celery -A serviceform_project worker -l info
;;
'celery-beat')
wait_redis
celery -A serviceform_project beat -l info -S django --pidfile /tmp/beat.pid --schedule /store/beat.db
;;
'tests')
pip install -r requirements-tests.txt
wait_redis
export TESTS_RUNNING=1
py.test -v tests/
;;
'travis-tests')
pip install -r requirements-tests.txt
wait_redis
cd $2
./manage.py collectstatic --noinput
./manage.py compress
./manage.py compilemessages
export TESTS_RUNNING=1
py.test -v --cov serviceform/ --cov tasks/ tests/
;;
'bash')
bash
;;
*)
wait_redis
./manage.py $@
;;
esac