]> git.parisson.com Git - docker-django-scripts.git/commitdiff
Add various options for upgrading
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 6 Mar 2018 11:04:48 +0000 (12:04 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 6 Mar 2018 11:04:48 +0000 (12:04 +0100)
pull.sh
upgrade.sh

diff --git a/pull.sh b/pull.sh
index 3f6998b45246c9c4555613819b70dcd295bbe637..7e66168ba68d9156acf0b517ad939f968e33cff1 100755 (executable)
--- a/pull.sh
+++ b/pull.sh
@@ -1,4 +1,6 @@
-#!/bin/sh
+#!/bin/bash
+
+cd "$(dirname "$0")"/../
 
 # We need to chown folders as they are docker's volumes
 sudo chown -R $USER var/media
@@ -11,8 +13,7 @@ git pull
 ./bin/update_submodules.sh
 
 # Restore database
-if [ "$1" = "--restore-db" ];
-    then
+if [ "$1" = "--restore-db" ]; then
     docker-compose run db /srv/bin/db/restore.sh
 fi
 
index 594359f0c755e752bb1aab7b7038c579abe0cd45..1f1a1b2de2c785a477d879338422a0f5dd5aee06 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Update main project
 git pull
@@ -7,25 +7,31 @@ git pull
 ./bin/update_submodules.sh
 
 # Apply migrations
-if [ "$1" = "--migrate" ];
-    then
+if [ "$1" = "--migrate" ]; then
     docker-compose run app python /srv/app/manage.py migrate
 fi
 
 # Build front-end
-./bin/build_front.sh
+if [ "$1" = "--front" ]; then
+    ./bin/build_front.sh
+fi
 
 # Build documentation
-docker-compose run app bash /srv/doc/build.sh
+if [ "$1" = "--doc" ]; then
+    docker-compose run app bash /srv/doc/build.sh
+fi
+
+# Collect static files
+if [ "$1" = "--collect" ]; then
+    docker-compose run app python manage.py collectstatic --noinput
+fi
 
 # Reload Wsgi
-if [ "$1" = "-r" ];
-    then
+if [ "$1" = "--reload" ]; then
     touch app/wsgi.py
 fi
 
 # Install local cron to
-if [ "$1" = "--cron" ];
-    then
-    sudo cp /srv/ircam-www/etc/cron.d/app /etc/cron.d/ircam-www
+if [ "$1" = "--cron" ]; then
+    sudo cp ./etc/cron.d/* /etc/cron.d/
 fi