diff --git a/run.sh b/run.sh index f73621e453bf6a2f60f1117778b23d065f28828f..e9212a55705da1b02e52f866be0654238e016b7a 100755 --- a/run.sh +++ b/run.sh @@ -12,13 +12,15 @@ docker="false" # - lqs # - api-dev # - api -# +# - recreate-database + # - docker:engine # - docker:core # - docker:lqs +# - docker:recreate-database # - docker:build # - docker:api -# +# if [[ $* =~ ^(engine|core|lqs|api-dev|api)$ ]]; then mode=$1 @@ -78,6 +80,12 @@ if [[ $docker == "false" ]]; then gunicorn -c configuration/gunicorn.conf.py engine-api:app fi + ### CAUTION: This deletes everything in your database ### + + if [[ $mode == "recreate-database" ]]; then + /usr/bin/env python3.7 engine-core.py --recreate-database + fi + fi @@ -137,6 +145,16 @@ if [[ $docker == "true" ]]; then -c "gunicorn -c configuration/gunicorn.conf.py engine-api:app" fi + ### CAUTION: This deletes everything in your database ### + + if [[ $mode == "recreate-database" ]]; then + exec sudo docker run --rm -it \ + -u $UID:$GID \ + -v "$BASE_D":/srv \ + -v "$BASE_D/configuration/":/etc/aura \ + --tmpfs /var/log/aura/ autoradio/engine /srv/engine-core.py --recreate-database + fi + ### Create Docker Image from local project ### if [[ $mode == "build" ]]; then