Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

Commit

Permalink
update commands and add shell script; add commands to procfile
Browse files Browse the repository at this point in the history
  • Loading branch information
skasberger committed Aug 23, 2017
1 parent 0f6955d commit bebf349
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Procfile
@@ -1,7 +1,7 @@
web: gunicorn --pythonpath src offenewahlen_nrw17.wsgi --log-file -
importxml: python3 manage.py importxml
importtxt: python3 manage.py importtxt
importmunicipalities: python3 manage.py importmunicipalities
importnrw13: python3 manage.py importnrw13
importparties: python3 manage.py importparties

reset: sh reset_db.sh
migrate: sh migrate_db.sh
drop: sh drop_db.sh
import_base: sh import_base.sh
import_nrw13: sh import_nrw13.sh
import_nrw17: sh import_nrw17.sh
2 changes: 2 additions & 0 deletions drop_db.sh
@@ -0,0 +1,2 @@
#!/bin/bash
echo "ERROR: Drop-function not defined so far."
3 changes: 3 additions & 0 deletions import_base.sh
@@ -0,0 +1,3 @@
#!/bin/bash
python src/manage.py import_base
echo "Base data imported."
3 changes: 3 additions & 0 deletions import_nrw13.sh
@@ -0,0 +1,3 @@
#!/bin/bash
python src/manage.py import_results 'data/test/nrw_2013_1_results.json' nrw13 --file_type json --mapping_file 'data/test/nrw_2013_mapping.json'
echo "NRW13 results imported."
2 changes: 2 additions & 0 deletions import_nrw17.sh
@@ -0,0 +1,2 @@
#!/bin/bash
echo "ERROR: Import not defined so far."
5 changes: 5 additions & 0 deletions migrate_db.sh
@@ -0,0 +1,5 @@
#!/bin/bash
python src/manage.py makemigrations viz
python src/manage.py makemigrations
python src/manage.py migrate
echo "Database migrated succesfully."
4 changes: 4 additions & 0 deletions reset_db.sh
@@ -0,0 +1,4 @@
#!/bin/bash
sh drop_db.sh
sh migrate_db.sh
sh setup_db.sh

0 comments on commit bebf349

Please sign in to comment.