Skip to content

Commit 792fa8c

Browse files
authored
Create Makefile
1 parent 6da54ad commit 792fa8c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
SRCPATH := $(CURDIR)
2+
ENTRYPOINT := $(shell find $(SRCPATH) -name '*.ini')
3+
PROJECTNAME := $(shell basename "$PWD")
4+
5+
define HELP
6+
Manage $(PROJECTNAME).
7+
8+
Usage:
9+
10+
make run - Run uWSGI server for $(PROJECTNAME).
11+
make restart - Purge cache & reinstall modules.
12+
make update - Update npm production dependencies.
13+
make clean - Remove cached files.
14+
endef
15+
export HELP
16+
17+
.PHONY: run restart update help
18+
19+
all help:
20+
@echo "$$HELP"
21+
22+
.PHONY: run
23+
run:
24+
nohup uwsgi $(ENTRYPOINT) &
25+
26+
.PHONY: restart
27+
restart:
28+
pkill -9 -f $(shell uwsgi $(ENTRYPOINT))
29+
nohup uwsgi $(ENTRYPOINT) &
30+
31+
.PHONY: update
32+
update:
33+
git pull origin master
34+
pkill -9 -f $(shell uwsgi $(ENTRYPOINT))
35+
poetry shell
36+
poetry update
37+
nohup uwsgi $(ENTRYPOINT) &
38+
39+
.PHONY: clean
40+
clean:
41+
find . -name '*.pyc' -delete
42+
find . -name '__pycache__' -delete

0 commit comments

Comments
 (0)