From 3a84ea9b7e06b5db4d402778f372b0f6bfc2d79a Mon Sep 17 00:00:00 2001 From: Emilie Date: Fri, 15 Jul 2016 11:48:57 +0200 Subject: [PATCH] update cron + push script --- install.py | 2 +- scripts/push.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/install.py b/install.py index 044d9ff6..7e4c45b1 100755 --- a/install.py +++ b/install.py @@ -158,7 +158,7 @@ class DockerCompositionInstaller(object): # version with migration # command = "cd /srv/ircam-www && git pull origin dev && " + self.docker_compose + " -f " + self.config + " run app /srv/app/manage.py migrate --noinput && ./scripts/push.sh >> /var/log/cri/cron/`date +\%Y\%m\%d\%H\%M\%S`-cron.log 2>&1 \n" # without migration - command = "cd /srv/ircam-www && git pull origin dev && ./scripts/push.sh >> /var/log/cri/cron/`date +\%Y\%m\%d-\%H-\%M-\%S`-cron.log 2>&1 \n" + command = "cd /srv/ircam-www && ./scripts/push.sh >> /var/log/cri/cron/`date +\%Y\%m\%d-\%H-\%M-\%S`-cron.log 2>&1 \n" rule = self.cron_rule % (self.user, command) f = open('/etc/cron.d/' + self.name, 'w') f.write(rule) diff --git a/scripts/push.sh b/scripts/push.sh index 2bc080c7..4b8ccb9e 100755 --- a/scripts/push.sh +++ b/scripts/push.sh @@ -1,6 +1,8 @@ #!/bin/bash docker-compose run db /srv/scripts/backup_db.sh -git add data/media +cd data +git add . git commit -a -m "update DB and media" -git push +git pull origin master +git push origin master -- 2.39.5