From: Emilie Date: Thu, 12 Oct 2017 14:44:58 +0000 (+0200) Subject: [git] : add sync remote submodule + doc X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c29b585fbc8622f0e17ef112e4a530bdfc7644c4;p=docker-django-scripts.git [git] : add sync remote submodule + doc --- diff --git a/pull.sh b/pull.sh index a9a1c08..8e6a36a 100755 --- a/pull.sh +++ b/pull.sh @@ -1,12 +1,21 @@ #!/bin/sh +# We need to chown folders as they are docker's volumes sudo chown -R $USER var/media sudo chown -R $USER var/backup + +# Update main project git pull +# Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules +git submodule sync +# Checkout all submodules on right branches specified in .gitmodules, by default the branch is master git submodule foreach --recursive 'git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master)' +# Pull all submodules on right branches specified in .gitmodules, by default the branch is master git submodule foreach --recursive 'git pull origin $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master)' +# Restore database if [ "$1" = "--restore-db" ]; then docker-compose run db /srv/bin/db/restore.sh fi +# Build front-end docker-compose run app bash -c "cd /srv && bower --allow-root install && gulp build" diff --git a/upgrade.sh b/upgrade.sh index 393160d..212b901 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -1,18 +1,27 @@ #!/bin/sh +# Update main project git pull +# Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules +git submodule sync +# Checkout all submodules on right branches specified in .gitmodules, by default the branch is master git submodule foreach --recursive 'git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master)' +# Pull all submodules on right branches specified in .gitmodules, by default the branch is master git submodule foreach --recursive 'git pull origin $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master)' +# Apply migrations docker-compose run app python /srv/app/manage.py migrate -# docker-compose run app python /srv/app/manage.py update_translation_fields -docker-compose run app bash -c "cd /srv && bower --allow-root install && gulp build" -docker-compose run app python /srv/app/manage.py collectstatic --noinput +# Build front-end +./bin/build_front.sh +# Build documentation docker-compose run app bash /srv/doc/build.sh + +# Reload Wsgi if [ "$1" = "--reload-wsgi" ]; 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