Skip to content

Commit

Permalink
Add simple upgrade script for deployments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ihodes committed Jul 31, 2015
1 parent 063b06e commit 120d6e1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/upgrade.sh
@@ -0,0 +1,31 @@
#!/bin/bash
set -o errexit

# If we're not in a virtual environment and haven't passed "force" to the
# script, then make sure the user wants to run the upgrade.
if [[ (! $VIRTUAL_ENV) && (! $1 || (! ($1 -neq 'force'))) ]]; then
read 'You are not running in a virtual environment, are you sure you would like to proceed? ' -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo 'Aborting upgrade.'
exit 1
fi
fi

echo Upgrading Cycledash
echo
echo Pulling from origin/master...
git pull origin master

echo Installing and upgrading dependencies...
source ENV.sh
pip install -r requirements.txt
npm install

echo Building assets...
gulp prod

echo Migrating the database...
alembic upgrade head

echo Done upgrading Cycledash.
echo Restart workers and the Cycledash server to finish your upgrade.

0 comments on commit 120d6e1

Please sign in to comment.