From: Emilie Date: Fri, 15 Jul 2016 09:48:57 +0000 (+0200) Subject: update cron + push script X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3a84ea9b7e06b5db4d402778f372b0f6bfc2d79a;p=mezzo.git update cron + push script --- 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