2023-04-10 02:12:26 +02:00
|
|
|
.PHONY: clean distclean install run stop
|
2023-02-24 10:04:30 +01:00
|
|
|
|
|
|
|
install:
|
2023-04-05 16:14:50 +02:00
|
|
|
set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
echo [+] Déploiement dans $$THSF_DIR; \
|
|
|
|
python3 -m venv thsf_venv; \
|
|
|
|
. thsf_venv/bin/activate; \
|
2023-04-06 13:41:56 +02:00
|
|
|
pip3 install -r requirements.txt ;\
|
|
|
|
pip3 install . ;\
|
|
|
|
pip3 install gunicorn; \
|
2023-04-05 16:14:50 +02:00
|
|
|
|
|
|
|
run:
|
|
|
|
set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
echo [+] Démarrage dans $$THSF_DIR; \
|
|
|
|
. thsf_venv/bin/activate; \
|
2023-04-06 13:22:49 +02:00
|
|
|
thsf_venv/bin/gunicorn -D -p thsf.pid -w 4 -b 127.0.0.1:8042 'thsf:app'
|
2023-04-05 16:14:50 +02:00
|
|
|
|
2023-04-09 08:29:44 +02:00
|
|
|
debug:
|
|
|
|
set -e ;\
|
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
echo [+] Démarrage dans $$THSF_DIR; \
|
|
|
|
. thsf_venv/bin/activate; \
|
|
|
|
thsf_venv/bin/gunicorn -p thsf.pid -w 4 -b 127.0.0.1:8042 'thsf:app'
|
|
|
|
|
2023-04-05 16:14:50 +02:00
|
|
|
stop:
|
|
|
|
-set -e;\
|
2023-04-06 12:17:18 +02:00
|
|
|
THSF_DIR=$$(pwd); \
|
2023-04-06 13:22:49 +02:00
|
|
|
echo [+] Arrêt dans $$THSF_DIR; \
|
2023-04-06 12:17:18 +02:00
|
|
|
kill -15 $$(cat $$THSF_DIR/thsf.pid); \
|
2023-04-05 16:14:50 +02:00
|
|
|
rm thsf.pid
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-set -e ;\
|
2023-04-06 13:22:49 +02:00
|
|
|
THSF_DIR=$$(pwd); \
|
|
|
|
echo [+] Nettoyage dans $$THSF_DIR; \
|
2023-04-10 02:12:26 +02:00
|
|
|
rm -Rf ./build ./src/thsf.egg-info ./thsf.pid ./thsf.log; \
|
2023-04-05 16:14:50 +02:00
|
|
|
. thsf_venv/bin/activate; \
|
2023-04-06 13:41:56 +02:00
|
|
|
pip3 uninstall thsf -y
|
2023-04-05 16:14:50 +02:00
|
|
|
|
2023-04-10 02:12:26 +02:00
|
|
|
distclean: clean
|
|
|
|
rm -Rf thsf_venv/
|
|
|
|
|
2023-04-06 12:53:10 +02:00
|
|
|
all: stop clean install run
|