Created
October 16, 2015 09:07
-
-
Save doidor/fbcfeeae114bf2606269 to your computer and use it in GitHub Desktop.
Django deploy script which works along with bundle.sh . It should be placed on the remote server.
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
#/bin/bash | |
TARGET_FOLDER='<target_folder_for_django_deployment>' | |
SYNCDB_COMMAND="$TARGET_FOLDER/<path_to_manage.py>" | |
# fetching the newest tar archive so we can deploy it | |
LATEST_TAR=`ls -t *.tar.gz | head -1` | |
echo "Cleaning up the target folder..." | |
rm -rf $TARGET_FOLDER"*" | |
echo "Extracting the latest build..." | |
tar -xzf $LATEST_TAR -C $TARGET_FOLDER | |
echo "Gracefully restarting the apache server..." | |
apachectl -k graceful | |
echo "Syncing the db..." | |
python $SYNCDB_COMMAND syncdb | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment