Skip to content
Snippets Groups Projects
Commit 1721269d authored by David Trattnig's avatar David Trattnig
Browse files

Added recreate-database.

parent 818d06b6
No related branches found
No related tags found
No related merge requests found
...@@ -12,13 +12,15 @@ docker="false" ...@@ -12,13 +12,15 @@ docker="false"
# - lqs # - lqs
# - api-dev # - api-dev
# - api # - api
# # - recreate-database
# - docker:engine # - docker:engine
# - docker:core # - docker:core
# - docker:lqs # - docker:lqs
# - docker:recreate-database
# - docker:build # - docker:build
# - docker:api # - docker:api
# #
if [[ $* =~ ^(engine|core|lqs|api-dev|api)$ ]]; then if [[ $* =~ ^(engine|core|lqs|api-dev|api)$ ]]; then
mode=$1 mode=$1
...@@ -78,6 +80,12 @@ if [[ $docker == "false" ]]; then ...@@ -78,6 +80,12 @@ if [[ $docker == "false" ]]; then
gunicorn -c configuration/gunicorn.conf.py engine-api:app gunicorn -c configuration/gunicorn.conf.py engine-api:app
fi 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 fi
...@@ -137,6 +145,16 @@ if [[ $docker == "true" ]]; then ...@@ -137,6 +145,16 @@ if [[ $docker == "true" ]]; then
-c "gunicorn -c configuration/gunicorn.conf.py engine-api:app" -c "gunicorn -c configuration/gunicorn.conf.py engine-api:app"
fi 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 ### ### Create Docker Image from local project ###
if [[ $mode == "build" ]]; then if [[ $mode == "build" ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment