mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-09 17:13:45 +01:00
Add more util scripts
This commit is contained in:
parent
22d02edbd8
commit
64e1805b53
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Open SSH to app instance
|
||||
|
||||
docker exec -it contentdb_app_1 bash
|
||||
|
9
utils/create_migration.sh
Executable file
9
utils/create_migration.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Create a database migration, and copy it back to the host.
|
||||
|
||||
docker exec -it contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db migrate"
|
||||
docker exec -u root -it contentdb_app_1 sh -c "cp /home/cdb/migrations/versions/* /source/migrations/versions/"
|
||||
|
||||
USER=$(whoami)
|
||||
sudo chown -R $USER:$USER migrations/versions
|
5
utils/db.sh
Executable file
5
utils/db.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Open SQL console for the database
|
||||
|
||||
docker exec -it contentdb_db_1 sh -c "psql contentdb contentdb"
|
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Hot/live reload - only works in debug mode
|
||||
|
||||
docker exec -it contentdb_app_1 sh -c "cp -r /source/* ."
|
||||
|
5
utils/run_migrations.sh
Executable file
5
utils/run_migrations.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run all pending migrations
|
||||
|
||||
docker exec -it contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db update"
|
@ -2,6 +2,8 @@
|
||||
|
||||
#
|
||||
# Call from a docker host to build and start CDB.
|
||||
# This is really only for production mode, for debugging it's better to use
|
||||
# docker-compose directly: docker-compose up --build
|
||||
#
|
||||
|
||||
sudo docker-compose up --build -d --scale worker=2
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#
|
||||
# Call from a docker host to rebuild and update running instances of CDB.
|
||||
# This is for production use. See reload.sh for debug mode hot/live reloading.
|
||||
#
|
||||
|
||||
sudo docker-compose build app
|
||||
|
Loading…
Reference in New Issue
Block a user