]> git.parisson.com Git - docker-django-scripts.git/commitdiff
[db] : add new push script + update backup.sh
authorEmilie <zawadzki@ircam.fr>
Thu, 10 Aug 2017 13:05:52 +0000 (15:05 +0200)
committerEmilie <zawadzki@ircam.fr>
Thu, 10 Aug 2017 13:05:52 +0000 (15:05 +0200)
db/backup.sh
mezzo-push.sh [new file with mode: 0755]

index 2ffa0ba09e59fa993953efc2da8646371c560226..f06c870ba387a65d7365ea342a99160a7f2ce84d 100755 (executable)
@@ -10,8 +10,8 @@ if [ ! -z "$MYSQL" ];
     mysqldump $MYSQL_DATABASE -hdb -u$MYSQL_USER > /srv/backup/mariadb.dump
 elif [ ! -z "$POSTGRES" ];
     then
-    export PGUSER=$POSTGRES_PASSWORD
-    export PGPASSWORD=$DB_ROOT_PASSWORD
+    export PGUSER="postgres"
+    export PGPASSWORD=$POSTGRES_PASSWORD
     export PGDATABASE="postgres"
     pg_dump -Fc -hdb > /srv/backup/postgres.dump
 fi
diff --git a/mezzo-push.sh b/mezzo-push.sh
new file mode 100755 (executable)
index 0000000..7a5d2a3
--- /dev/null
@@ -0,0 +1,7 @@
+echo "----------------------------"
+echo `date +\%Y\%m\%d-\%H-\%M-\%S`
+docker-compose run db /srv/bin/db/backup.sh
+git add var
+git commit -a -m "update DB and media"
+git pull
+git push