Merge pull request #339 from levivm/develop

Develop
This commit is contained in:
Levi Velázquez 2017-06-14 11:14:49 -05:00 committed by GitHub
commit 7ac1306ff5
6 changed files with 82 additions and 0 deletions

1
.gitignore vendored
View file

@ -34,3 +34,4 @@ secret-key
.idea/ .idea/
.env .env
*.mo

View file

@ -1,3 +1,10 @@
1.0.15: 2017-06-14
* [datacenterlight] Fixed error trying to delete ssh key
* [datacenterlight] Fixed footer links
* [datacenterlight] Fixed some styles on landing
1.0.14: 2017-06-14
* [all] Added deploy.sh
* [all] Removed .mo files and updated .gitignore
1.0.13: 2017-06-13 1.0.13: 2017-06-13
* [datacenterlight] Added translations for email and name placeholders fields * [datacenterlight] Added translations for email and name placeholders fields
1.0.12: 2017-06-13 1.0.12: 2017-06-13

74
deploy.sh Executable file
View file

@ -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 <options>"
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