From: Guillaume Pellerin Date: Tue, 6 Mar 2018 11:04:48 +0000 (+0100) Subject: Add various options for upgrading X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a154d2390a03921699e502a00963bb84d44fa3c5;p=docker-django-scripts.git Add various options for upgrading --- diff --git a/pull.sh b/pull.sh index 3f6998b..7e66168 100755 --- 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 diff --git a/upgrade.sh b/upgrade.sh index 594359f..1f1a1b2 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -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