Kód pro inventář spolku Herní historie.
Dependencies:
- PostgreSQL database
- Copy
.env_example
to.env
and fill in variables - Copy
alembic.ini_example
toalembic.ini
and fill in PostgreSQL database URL - Run:
poetry init
poetry run python dbseed.py
alembic heads
alembic stamp <revision>
Where <revision>
is the latest Alembic revision shown from alembic heads
.
The first registered user should be given admin permissions.
Run with poetry run flask run
.
# Řeknu si Sankymu aby mi vysvětlil alembic.ini...
source .venv/bin/activate
# Jako git status
alembic current
# Udělal jsem novou tabulku, chci aby jí alembic přemigroval
alembic revision --autogenerate -m "Add File table"
# omrknu alembic/versions/[nová revize].py, jestli tam je to co chci...
# Spustím migraci
alembic upgrade head
If there are no database migrations: run the script ./ops/deploy.sh
If there are database migrations:
ssh retroherna.org
cd /var/www/rhinventory
sudo -u flask git pull
sudo -u flask poetry run alembic upgrade head
# Correct any issues should they arise
sudo systemctl restart www_rhinventory
PYTHONPATH=. python scripts/script.py
Try to check logs with sudo journalctl -u www_rhinventory -e
. If that's not enough, run manually with:
sudo systemctl stop rhinventory
cd /var/www/rhinventory
sudo -u flask ./deploy.sh
Once solved:
sudo systemctl start rhinventory