]> git.parisson.com Git - docker-django-scripts.git/commitdiff
Merge branch 'master' of https://github.com/Ircam-Web/mezzo-bin into dev
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 14 Mar 2018 09:53:59 +0000 (10:53 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 14 Mar 2018 09:55:06 +0000 (10:55 +0100)
1  2 
.gitmodules
prod/upgrade.sh

diff --cc .gitmodules
index 4ee2e0090453a62687bcd872ba6b242edfc87a16,02f3962d7d9dd3d90d06ffd9ab27fceae5bf356c..1aa499c11c6170bd924204a0c3bd413e3eafad64
@@@ -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 0450646061248164206c9a013651d1285a19aa35,0000000000000000000000000000000000000000..dbc36269eee1a85b8976d2a5b2d13effa05795bd
mode 100755,000000..100755
--- /dev/null
@@@ -1,36 -1,0 +1,58 @@@
- # Update main project and submodules
- ./bin/prod/update.sh
 +#!/bin/bash
 +
 +cd "$(dirname "$0")"/../../
 +
- # 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