From: Guillaume Pellerin Date: Wed, 14 Mar 2018 09:53:59 +0000 (+0100) Subject: Merge branch 'master' of https://github.com/Ircam-Web/mezzo-bin into dev X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=454cb76cde6eb655f52d9d67680f7b16c595ac00;p=docker-django-scripts.git Merge branch 'master' of https://github.com/Ircam-Web/mezzo-bin into dev --- 454cb76cde6eb655f52d9d67680f7b16c595ac00 diff --cc .gitmodules index 4ee2e00,02f3962..1aa499c --- a/.gitmodules +++ b/.gitmodules @@@ -1,3 -1,3 +1,3 @@@ [submodule "docker-composition-installer"] - path = docker-composition-installer - url = git@github.com:yomguy/docker-composition-installer.git + path = install - url = git@github.com:yomguy/docker-composition-installer.git ++ url = https://github.com/yomguy/docker-composition-installer.git diff --cc prod/upgrade.sh index 0450646,0000000..dbc3626 mode 100755,000000..100755 --- a/prod/upgrade.sh +++ b/prod/upgrade.sh @@@ -1,36 -1,0 +1,58 @@@ +#!/bin/bash + +cd "$(dirname "$0")"/../../ + - # Update main project and submodules - ./bin/prod/update.sh + - # Apply migrations - if [ "$1" = "--migrate" ]; then - docker-compose run app python /srv/app/manage.py migrate - fi + - # Build front-end - if [ "$1" = "--front" ]; then - docker-compose run app python /srv/app/manage.py build-front - fi - - # Build documentation - 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" = "--reload" ]; then - touch app/wsgi.py - fi - - # Install local cron to - if [ "$1" = "--cron" ]; then - sudo cp ./etc/cron.d/* /etc/cron.d/ - fi ++function usage() { ++ echo "Script to upgrade the Mezzo instance with various options" ++ echo "" ++ echo "./upgrade.sh" ++ echo " -h --help" ++ echo " -u --update : update main project and submodules" ++ echo " -m --migrate : apply migrations" ++ echo " -f --front : build frontend" ++ echo " -d --doc : build documentation" ++ echo " -c --collect : collect static files" ++ echo " -r --reload : reload Wsgi" ++ echo " -n --cron : install local cron to host" ++ echo "" ++} ++ ++while [ "$1" != "" ]; do ++ PARAM=`echo $1 | awk -F= '{print $1}'` ++ VALUE=`echo $1 | awk -F= '{print $2}'` ++ case $PARAM in ++ -h | --help) ++ usage ++ exit ++ ;; ++ -u | --update) ++ ./bin/prod/update.sh ++ ;; ++ -m | --migrate) ++ docker-compose run app python /srv/app/manage.py migrate ++ ;; ++ -f | --front) ++ docker-compose run app python /srv/app/manage.py build-front ++ ;; ++ -d | --doc) ++ docker-compose run app bash /srv/doc/build.sh ++ ;; ++ -c | --collect) ++ docker-compose run app python manage.py collectstatic --noinput ++ ;; ++ -r | --reload) ++ touch app/wsgi.py ++ ;; ++ -n | --cron) ++ sudo cp ./etc/cron.d/* /etc/cron.d/ ++ ;; ++ *) ++ echo "ERROR: unknown parameter \"$PARAM\"" ++ usage ++ exit 1 ++ ;; ++ esac ++ shift ++done