Skip to content

Commit

Permalink
Issue #5: Script de base pour déployer en prod - sans doute très amél…
Browse files Browse the repository at this point in the history
…iorable
  • Loading branch information
SpaceFox committed Jul 11, 2014
1 parent b055b58 commit d8f2067
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions server/deploy.sh
@@ -0,0 +1,35 @@
#!/bin/bash
#
# Zeste de Savoir deployment script
#
# Deploys specified version of Zeste de Savoir

if [ "$(whoami)" != "zds" ]; then
echo "This script must be run by zds user" >&2
exit 1
fi

if [ "$#" -ne 1 ]; then
echo "Usage: $0 <tag name>" >&2
exit 1
fi
cd /opt/zdsenv/ZesteDeSavoir/

# Switch to new tag
git fetch
# -b is required to have version data in footer
git checkout -b $1

# Compute front stuff
source /usr/local/nvm/nvm.sh
gulp pack
gulp build

# Update application data
source ../bin/activate
pip install --upgrade -r requirements.txt
python manage.py migrate
deactivate

# Restart zds
sudo supervisorctl restart zds

0 comments on commit d8f2067

Please sign in to comment.