Skip to content

Instantly share code, notes, and snippets.

@mitio
Created June 26, 2016 08:53
Show Gist options
  • Save mitio/ebd22257cfb9a53d115471835d56750d to your computer and use it in GitHub Desktop.
Save mitio/ebd22257cfb9a53d115471835d56750d to your computer and use it in GitHub Desktop.
Europe Code Week deployment script
#!/bin/bash
set -e
deploy_commands="
source /home/codeeu/.virtualenvs/v1.1.4/bin/activate v1.1.4 &&
cd /home/codeeu/coding-events &&
git stash && git pull && git stash pop &&
pip install -r server-requirements.txt &&
./manage.py collectstatic --noinput &&
./manage.py compress --force &&
./manage.py migrate
"
echo "Updating code..."
su -l -c "$deploy_commands" codeeu
echo "Restarting Apache..."
service apache2 restart
echo "Deploy finished."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment