Skip to content

Instantly share code, notes, and snippets.

@rhyolight
Created November 2, 2015 21:09
Show Gist options
  • Save rhyolight/a6aa626a9a17d77e5f44 to your computer and use it in GitHub Desktop.
Save rhyolight/a6aa626a9a17d77e5f44 to your computer and use it in GitHub Desktop.
#!/bin/bash
pushd ~/nta/htmengine-traffic-tutorial/python-engine
export APPLICATION_CONFIG_PATH=`pwd`/conf
echo
echo "Stopping Supervisor services..."
supervisorctl stop all
echo
echo "Flushing RabbitMQ queues..."
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl start_app
echo
echo "Wiping MySQL database..."
mysql -u root --execute="DROP DATABASE traffic"
mysql -u root --execute="CREATE DATABASE traffic;"
echo
echo "Applying SQL migrations..."
python repository/migrate.py
echo
echo "Clearing out model checkpoints..."
rm -rf /Users/mtaylor/tmp/traffic-htmengine-app/model_checkpoints/*
echo
echo "Restarting Supervisor services..."
supervisorctl start all
popd
echo
echo "Complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment