Commit 939559d0 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE

media dir is needed for tests

parent 495e7531
......@@ -4,6 +4,15 @@ cd /code
source resources/tool_shed.sh
MEDIA_ROOT_DIR=$(python manage.py shell -c "from django.conf import settings; print(settings.MEDIA_ROOT)" | grep -v django.db.backends)
msg_info "Creating media root at $MEDIA_ROOT_DIR"
if [ "$MEDIA_ROOT_DIR" != "" ]; then
mkdir -p $MEDIA_ROOT_DIR
chmod 777 $MEDIA_ROOT_DIR
else
msg_warning "settings.MEDIA_ROOT missing, passed"
fi
if [ "$1" == "test" ]; then
msg_info "Running tests"
pip install coverage
......@@ -78,15 +87,6 @@ else
msg_warning "csscompressor missing, passed"
fi
MEDIA_ROOT_DIR=$(python manage.py shell -c "from django.conf import settings; print(settings.MEDIA_ROOT)" | grep -v django.db.backends)
msg_info "Creating media root at $MEDIA_ROOT_DIR"
if [ "$MEDIA_ROOT_DIR" != "" ]; then
mkdir -p $MEDIA_ROOT_DIR
chmod 777 $MEDIA_ROOT_DIR
else
msg_warning "settings.MEDIA_ROOT missing, passed"
fi
sudo /usr/sbin/service cron start
msg_info "Adding cron task to dump db every day"
cat <(crontab -l) <(echo "") <(echo "* * * * * find $MEDIA_ROOT_DIR/ -type f -name 'Template*.xlsx' -mtime +1 -exec rm {} \; >> /code/persistent_volume/django-crontab.log 2>> /code/persistent_volume/django-crontab.err") | crontab -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment