Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #5: Script de base pour déployer en prod - sans doute très amél…
…iorable
- Loading branch information
SpaceFox
committed
Jul 11, 2014
1 parent
b055b58
commit d8f2067
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |