Skip to content

Commit

Permalink
Fix #2607 - Adjust deploy bash to only run provisioning thingz on job…
Browse files Browse the repository at this point in the history
…s_node (#2613)
  • Loading branch information
Mark Beacom authored and octavioamu committed Nov 2, 2018
1 parent 02a9cd2 commit 2d6cc5d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/deploy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ END

# deploy script
# assumes that gitcoin repo lives at $HOME/gitcoin
# and that gitcoinenv is the virtualenv under which it lives
# and that gitcoin-37 is the virtualenv under which it lives

# setup
cd || echo "Cannot find directory!"
Expand Down Expand Up @@ -54,25 +54,25 @@ echo "- install req"
echo "- cleaning up pyc files"
find . -name \*.pyc -delete

if [ "$UPDATE_CRONTAB" ]; then
if [ "$UPDATE_CRONTAB" ] && [ "$JOBS_NODE" ]; then
echo "- updating crontab"
crontab scripts/crontab
fi

cd app || echo "Cannot find app directory!"
echo "- collect static"
if [ "$ISFRONTENDPUSH" ]; then
if [ "$ISFRONTENDPUSH" ] && [ "$JOBS_NODE" ]; then
python3 manage.py collectstatic --noinput -i other;
fi

rm -Rf ~/gitcoin/coin/app/static/other

if [ "$MIGRATE_DB" ]; then
if [ "$MIGRATE_DB" ] && [ "$JOBS_NODE" ]; then
echo "- db"
python3 manage.py migrate
fi

if [ "$CREATE_CACHE_TABLE" ]; then
if [ "$CREATE_CACHE_TABLE" ] && [ "$JOBS_NODE" ]; then
echo "- creating cache table"
python3 manage.py createcachetable
fi
Expand All @@ -82,7 +82,7 @@ echo "- gunicorn"
sudo systemctl restart gunicorn

# invalidate cloudfront
if [ "$ISFRONTENDPUSH" ]; then
if [ "$ISFRONTENDPUSH" ] && [ "$JOBS_NODE" ]; then
if [ "$DISTID" ]; then
cd ~/gitcoin/coin || echo "Cannot find coin directory!"; bash scripts/bustcache.bash "$DISTID"
fi
Expand All @@ -92,7 +92,7 @@ fi
cd ~/gitcoin/coin || echo "Cannot find coin directory!"
bash scripts/run_management_command.bash ping_google

if [ "$ENV" = "prod" ]; then
if [ "$ENV" = "prod" ] && [ "$JOBS_NODE" ]; then
# Handle sentry deployment
echo "- publishing deployment information to Sentry"
bash scripts/sentry.bash
Expand Down

0 comments on commit 2d6cc5d

Please sign in to comment.