Commit 1fafc86b authored by Nadrieril's avatar Nadrieril

Add agios cron

parent 8b6847c1
......@@ -6,7 +6,7 @@ MAINTAINER Nadrieril ""
#ENV https_proxy
RUN apt-get update && \
apt-get install -y python-pip gunicorn python-dev libmysqlclient-dev python-dateutil
apt-get install -y cron python-pip gunicorn python-dev libmysqlclient-dev python-dateutil
RUN mkdir /app
......@@ -21,8 +21,13 @@ RUN sed -i 's/bars_django\.settings\.dev_local/' bars_
# TODO: Temporary
ADD routes.html /app/static/
ADD agios.cron /etc/cron.d/agios
RUN chmod 0744 /etc/cron.d/agios
VOLUME /srv/api
CMD rm -r /srv/api/*; \
cp -R /app/static /srv/api/static; \
python migrate; \
cron; \
gunicorn bars_django.wsgi -w 4 -b unix:/srv/api/gunicorn.sock --log-level=warning --log-file=-
0 0 * * * root /app/
# An empty line is required at the end of this file for a valid cron file.
......@@ -17,6 +17,9 @@ class Bar(models.Model):
def __unicode__(self):
def apply_agios(self, account):
return 0
class BarSerializer(serializers.ModelSerializer):
class Meta:
cd /app
date >> $LOGFILE
python runscript agios >> $LOGFILE 2>&1
from bars_core.models.account import Account
def run():
sum = 0
for a in Account.objects.select_related('bar'):
sum +=
print "Done (took %f euros)" % sum
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment