-
-
Save arikfr/23500f83223c5a8ae64e to your computer and use it in GitHub Desktop.
re:dash development vagrant box provision script
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
export REDASH_CONNECTION_ADAPTER=pg | |
export REDASH_CONNECTION_STRING="dbname=redash" | |
export REDASH_STATIC_ASSETS_PATH="../rd_ui/app/" | |
export REDASH_LOG_LEVEL="INFO" | |
export REDASH_WORKERS_COUNT=6 | |
export REDASH_REDIS_URL=redis://localhost:6379/1 | |
export REDASH_DATABASE_URL="postgresql://redash" | |
export REDASH_COOKIE_SECRET=veryverysecret | |
export REDASH_GOOGLE_APPS_DOMAIN= |
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 | |
sudo apt-get update | |
sudo apt-get install -y python-pip redis-server postgresql postgresql-server-dev-9.1 python-dev curl python-software-properties git | |
sudo apt-add-repository -y ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install -y nodejs | |
sudo chown vagrant:vagrant /opt/redash | |
cd /opt/redash/current | |
# TODO: virtualenv? | |
sudo pip install -r requirements.txt | |
cd /opt/redash/current/rd_ui | |
npm install | |
npm install grunt-cli bower | |
./node_modules/.bin/bower install | |
if [ ! -f "/opt/redash/.env" ]; then | |
wget https://gist.githubusercontent.com/arikfr/23500f83223c5a8ae64e/raw/.env -O /opt/redash/.env | |
fi | |
ln -nfs /opt/redash/.env /opt/redash/current/.env | |
sudo -u postgres psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='vagrant'" | grep -q 1 | |
if [ $? -ne 0 ]; then | |
sudo -u postgres createuser vagrant --superuser | |
sudo -u postgres createdb redash --owner=vagrant | |
cd /opt/redash/current | |
sudo -u vagrant bin/run ./manage.py database create_tables | |
sudo -u vagrant bin/run ./manage.py ds import_from_settings | |
fi | |
sudo wget -O /etc/init/redash_updater.conf https://gist.githubusercontent.com/arikfr/23500f83223c5a8ae64e/raw/redash_updater.conf | |
sudo wget -O /etc/init/redash_web.conf https://gist.githubusercontent.com/arikfr/23500f83223c5a8ae64e/raw/redash_web.conf | |
sudo start redash_web | |
sudo start redash_updater |
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
description "re:dash updater" | |
chdir /opt/redash/current | |
setuid vagrant | |
kill signal TERM | |
respawn | |
respawn limit 10 5 | |
start on started network-services | |
stop on stopping network-services | |
script | |
bin/run celery worker --app=redash.worker --beat -Qqueries,celery,scheduled_queries | |
end script |
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
description "re:dash web" | |
chdir /opt/redash/current | |
setuid vagrant | |
kill signal INT | |
respawn | |
respawn limit 10 5 | |
start on started network-services | |
stop on stopping network-services | |
script | |
bin/run ./manage.py runserver -t 0.0.0.0 | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment