cluster

Infrastructure files for Nordgedanken and Midnightthoughts.
git clone git://archive.git.mtrnord.blog/MTRNord/cluster.git
Log | Files | Refs | README

bookwyrm.sh (826B)


      1 #! /bin/bash
      2 
      3 migrate() {
      4     python manage.py migrate "$@" || return 1
      5 }
      6 
      7 initdb() {
      8     python manage.py initdb "$@" || return 1
      9 }
     10 
     11 init() {
     12     echo "Running init function..."
     13     migrate || return 1
     14     migrate "django_celery_beat" || return 1
     15     initdb || return 1
     16     python manage.py compile_themes || return 1
     17     python manage.py collectstatic --no-input || return 1
     18     python manage.py admin_code || return 1
     19     return 0
     20 }
     21 
     22 update() {
     23     echo "Running update function..."
     24     migrate || return 1
     25     python manage.py compile_themes || return 1
     26     python manage.py collectstatic --no-input || return 1
     27 
     28     return 0
     29 }
     30 
     31 op="${1}"
     32 if [[ "${op}" == "init" ]]; then
     33     init || exit 1
     34 elif [[ "${op}" == "update" ]]; then
     35     update || exit 1
     36 else
     37     echo "Unknown operation ${op}, aborting."
     38     exit 1
     39 fi
     40 
     41 exit 0