Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Bootstrap script for local development. Does the following:
  4. # 1. Resets database
  5. # 2. Seeds with fakes
  6.  
  7. E_USERNAME_NOT_CHANGED=60
  8.  
  9.  
  10. USERNAME="ivo"
  11. DATABASE="colab"
  12. TEMPLATE_DB="colab_basic"
  13.  
  14. ADMIN_EMAIL="test@thecollective.co.uk"
  15. ADMIN_PASSWORD="test"
  16. API_TOKEN="48a18eae1e3c8b81898c1983f99f51b7e6b0ae46"
  17.  
  18. if [[ -z "$USERNAME" ]]
  19. then
  20. echo "Open `basename $0` and change the USERNAME value"
  21. exit "$E_USERNAME_NOT_CHANGED"
  22. fi
  23.  
  24. dropdb --if-exists "$DATABASE"
  25.  
  26. if [[ "$OSTYPE" == "darwin"* ]]; then
  27. createdb -O $USERNAME "$DATABASE"
  28. else
  29. sudo -u postgres createdb -O $USERNAME -T "$TEMPLATE_DB" "$DATABASE"
  30. fi
  31.  
  32. python manage.py migrate
  33.  
  34. echo "Purging all celery tasks."
  35. celery -A colab purge -f -Q celery,determined_profile
  36.  
  37. echo "Admin credentials: $ADMIN_EMAIL / $ADMIN_PASSWORD"
  38. echo "API token: $API_TOKEN"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement