Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Bootstrap script for local development. Does the following:
- # 1. Resets database
- # 2. Seeds with fakes
- E_USERNAME_NOT_CHANGED=60
- USERNAME="ivo"
- DATABASE="colab"
- TEMPLATE_DB="colab_basic"
- ADMIN_EMAIL="test@thecollective.co.uk"
- ADMIN_PASSWORD="test"
- API_TOKEN="48a18eae1e3c8b81898c1983f99f51b7e6b0ae46"
- if [[ -z "$USERNAME" ]]
- then
- echo "Open `basename $0` and change the USERNAME value"
- exit "$E_USERNAME_NOT_CHANGED"
- fi
- dropdb --if-exists "$DATABASE"
- if [[ "$OSTYPE" == "darwin"* ]]; then
- createdb -O $USERNAME "$DATABASE"
- else
- sudo -u postgres createdb -O $USERNAME -T "$TEMPLATE_DB" "$DATABASE"
- fi
- python manage.py migrate
- echo "Purging all celery tasks."
- celery -A colab purge -f -Q celery,determined_profile
- echo "Admin credentials: $ADMIN_EMAIL / $ADMIN_PASSWORD"
- echo "API token: $API_TOKEN"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement