diff --git a/.gitignore b/.gitignore index 6e6250b1..2bfa8cdf 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ secret-key .idea/ .env +*.mo diff --git a/Changelog b/Changelog index 7491cbd1..812a1229 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +1.0.14: 2017-06-14 + * [all] Added deploy.sh + * [all] Removed .mo files and updated .gitignore 1.0.13: 2017-06-13 * [datacenterlight] Added translations for email and name placeholders fields 1.0.12: 2017-06-13 diff --git a/alplora/locale/de/LC_MESSAGES/django.mo b/alplora/locale/de/LC_MESSAGES/django.mo deleted file mode 100644 index c69bd979..00000000 Binary files a/alplora/locale/de/LC_MESSAGES/django.mo and /dev/null differ diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 00000000..f2a1d59e --- /dev/null +++ b/deploy.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# +# deploy.sh +# +# This script made to deploy dynamicweb project. +# Please run this script as app user. +# + +APP_HOME_DIR=~/app + +echo "" > $APP_HOME_DIR/deploy.log +while true; do + case "$1" in + -h | --help ) HELP=true; shift ;; + -v | --verbose ) VERBOSE=true; shift ;; + -d | --dbmigrate ) DB_MIGRATE=true; shift ;; + -n | --nogit ) NO_GIT=true; shift ;; + -b | --branch ) BRANCH="$2"; shift 2 ;; + -- ) shift; break ;; + * ) break ;; + esac +done + +if [ "$BRANCH" == "" ]; then + BRANCH="master" +fi + +if [ "$HELP" == "true" ]; then + echo "./deploy.sh " + echo " " + echo "options are : " + echo " -h, --help: Print this help message" + echo " -v, --verbose: Show verbose output to stdout. Without this a deploy.log is written to ~/app folder" + echo " -d, --dbmigrate: Do DB migrate" + echo " -n, --nogit: Don't execute git commands. With this --branch has no effect." + echo " -b, --branch: The branch to pull from origin repo." + exit +fi + +echo "BRANCH="$BRANCH +echo "DB_MIGRATE="$DB_MIGRATE +echo "NO_GIT="$NO_GIT +echo "VERBOSE="$VERBOSE + +# The project directory exists, we pull the specified branch +cd $APP_HOME_DIR +if [ -z "$NO_GIT" ]; then + echo 'We are executing default git commands. Please -no_git to not use this.' + # Save any modified changes before git pulling + git stash + # Fetch all branches/tags + git fetch -a + git checkout $BRANCH + git pull origin $BRANCH +else + echo 'Not using git commands.' +fi + +source ~/pyvenv/bin/activate +pip install -r requirements.txt > deploy.log 2>&1 +echo "###" >> deploy.log +if [ -z "$DB_MIGRATE" ]; then + echo 'We are not doing DB migration' +else + ./manage.py makemigrations >> deploy.log 2>&1 + echo "###" >> deploy.log + ./manage.py migrate >> deploy.log 2>&1 + echo "###" >> deploy.log +fi +printf 'yes' | ./manage.py collectstatic >> deploy.log 2>&1 +echo "###" >> deploy.log +django-admin compilemessages +sudo systemctl restart uwsgi + diff --git a/digitalglarus/locale/de/LC_MESSAGES/django.mo b/digitalglarus/locale/de/LC_MESSAGES/django.mo deleted file mode 100644 index 77296614..00000000 Binary files a/digitalglarus/locale/de/LC_MESSAGES/django.mo and /dev/null differ diff --git a/ungleich_page/locale/de/LC_MESSAGES/django.mo b/ungleich_page/locale/de/LC_MESSAGES/django.mo deleted file mode 100644 index c1aa51c7..00000000 Binary files a/ungleich_page/locale/de/LC_MESSAGES/django.mo and /dev/null differ