hack-wpi-python/Makefile
Cara Salter 42d857d261
meta: Add database makefile recipes
Allows for generation of migrations and automatic upgrading of the
database with `make make_migrations` and `make run_migrations`
2022-12-06 09:07:41 -05:00

39 lines
1.2 KiB
Makefile

SHELL := /bin/bash
all: clean
# Clean up temp files
#------------------------------------------------------------------
clean:
@echo "Cleaning up temp files"
@find . -name '*~' -ls -delete
@find . -name '*.bak' -ls -delete
@echo "Cleaning up __pycache__ directories"
@find . -name __pycache__ -type d -not -path "./.venv/*" -ls -exec rm -r {} +
@echo "Cleaning up logfiles"
@find ./logs -name '*.log*' -ls -delete
@echo "Cleaning up flask_session"
@find . -name flask_session -type d -not -path "./.venv/*" -ls -exec rm -r {} +
init_env:
python -m .venv venv
source .venv/bin/activate && pip3 install --upgrade pip
source .venv/bin/activate && pip3 install -r requirements.txt txt
upgrade_env:
source .venv/bin/activate && pip3 install --upgrade -r requirements.txt txt
make_migrations:
source .venv/bin/activate && flask db migrate
run_migrations:
source .venv/bin/activate && flask db upgrade
daemon:
@echo "--- STARTING UWSGI DAEMON ---"
@echo ""
@echo ""
source .venv/bin/activate && uwsgi --py-autoreload=5 --socket 0.0.0.0:8000 --protocol=http --wsgi-file goathacks.py --enable-threads --master
@echo ""
@echo ""
@echo "--- STARTING UWSGI DAEMON ---"