2023-04-06 01:14:50 +11:00
|
|
|
.PHONY: clean install run stop
|
2023-02-24 20:04:30 +11:00
|
|
|
|
|
|
|
install:
|
2023-04-06 01:14:50 +11:00
|
|
|
set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
echo [+] Déploiement dans $$THSF_DIR; \
|
|
|
|
python3 -m venv thsf_venv; \
|
|
|
|
. thsf_venv/bin/activate; \
|
|
|
|
pip install -r requirements.txt ;\
|
|
|
|
pip install . ;\
|
2023-04-06 20:47:07 +11:00
|
|
|
pip install gunicorn; \
|
|
|
|
sudo chown apache:apache $$THSF_DIR
|
2023-04-06 01:14:50 +11:00
|
|
|
|
|
|
|
run:
|
|
|
|
set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
echo [+] Démarrage dans $$THSF_DIR; \
|
|
|
|
. thsf_venv/bin/activate; \
|
|
|
|
thsf_venv/bin/gunicorn -D -p thsf.pid -w 4 -b 127.0.0.1:8042 'thsf:app'
|
|
|
|
|
|
|
|
stop:
|
|
|
|
-set -e;\
|
2023-04-06 21:17:18 +11:00
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
kill -15 $$(cat $$THSF_DIR/thsf.pid); \
|
2023-04-06 01:14:50 +11:00
|
|
|
rm thsf.pid
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-set -e ;\
|
|
|
|
rm -Rf ./build ;\
|
|
|
|
rm -Rf ./src/thsf.egg-info; \
|
|
|
|
. thsf_venv/bin/activate; \
|
|
|
|
pip uninstall thsf -y
|
|
|
|
|
|
|
|
all: clean stop install run
|