2023-04-22 17:07:56 +11:00
|
|
|
.PHONY: clean distclean install run stop all docker-build docker-run docker-stop docker-all
|
2023-02-24 20:04:30 +11:00
|
|
|
|
|
|
|
install:
|
2023-04-21 00:09:57 +11:00
|
|
|
set -e ;\
|
2023-04-22 17:07:56 +11:00
|
|
|
python -m venv thsf_venv; \
|
2023-04-21 00:09:57 +11:00
|
|
|
. thsf_venv/bin/activate; \
|
2023-04-22 17:07:56 +11:00
|
|
|
pip install -r requirements.txt ;\
|
|
|
|
pip install . ;\
|
2023-04-23 17:57:37 +11:00
|
|
|
pip install gunicorn;
|
2023-04-21 00:09:57 +11:00
|
|
|
|
|
|
|
run:
|
|
|
|
set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
. thsf_venv/bin/activate; \
|
2023-04-22 17:07:56 +11:00
|
|
|
thsf_venv/bin/gunicorn -p thsf.pid -w 4 -b 0.0.0.0:8042 'thsf:app'
|
2023-04-21 00:09:57 +11:00
|
|
|
|
|
|
|
debug:
|
|
|
|
set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
. thsf_venv/bin/activate; \
|
2023-04-22 17:07:56 +11:00
|
|
|
thsf_venv/bin/gunicorn -p thsf.pid -w 4 -b 0.0.0.0:8042 'thsf:app'
|
2023-04-21 00:09:57 +11:00
|
|
|
|
|
|
|
stop:
|
|
|
|
-set -e;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
kill -15 $$(cat $$THSF_DIR/thsf.pid); \
|
|
|
|
rm thsf.pid
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
rm -Rf ./build ./src/thsf.egg-info ./thsf.pid ./thsf.log; \
|
|
|
|
. thsf_venv/bin/activate; \
|
2023-04-22 17:07:56 +11:00
|
|
|
pip uninstall thsf -y
|
2023-04-21 00:09:57 +11:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -Rf thsf_venv/
|
|
|
|
|
|
|
|
all: stop clean install run
|
2023-04-22 17:07:56 +11:00
|
|
|
|
|
|
|
docker-build:
|
|
|
|
docker-compose build
|
|
|
|
|
|
|
|
docker-run:
|
|
|
|
docker-compose up -d
|
|
|
|
|
|
|
|
docker-stop:
|
|
|
|
-docker-compose down
|
|
|
|
|
|
|
|
docker-all: docker-stop docker-build docker-run
|