-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
123 lines (106 loc) · 2.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.PHONY: run install test clean clear format boot
all: test check
## Run tests
test:
-dropdb test
createdb test
pytest
## Run static check
check:
ruff src
# flake8 src
## Run dev server
run:
FLASK_DEBUG=true flask dev
# honcho start
## Build static assets
build:
flask tailwind build
## Deploy to production
deploy: clean
fab -e deploy
## Clean up
clean:
adt clean
find . -name __pycache__ -print0 | xargs -0 rm -rf
find . -name .DS_Store -print0 | xargs -0 rm -rf
## Super clean up
tidy: clean
rm -rf .pytest_cache .tox .nox
#install:
# pip install -U pip setuptools wheel
# pip install -r requirements.txt
#
#run:
# flask devserver
#
#start-server:
# gunicorn -D -w1 --timeout 300 \
# --bind unix:run/gunicorn.sock \
# --pid run/gunicorn.pid \
# --capture-output \
# --access-logfile run/access.log \
# --error-logfile run/error.log \
# wsgi:app
#
#stop-server:
# kill `cat run/gunicorn.pid`
#
#restart-server:
# kill -HUP `cat run/gunicorn.pid`
#
#
#clear:
# rm -rf var/*
#
#format:
# black *.py app scripts
# isort -rc *.py app scripts
# cd front && make format
#
#deploy: clean
# # @make build
# @make push
# python scripts/deploy.py
# #ssh pilaf "cd annuaire-cnll && ./env/bin/pip install -q -r requirements.txt"
# ssh pilaf "cd annuaire-cnll && make restart-server"
#
#push:
# rsync --exclude env --exclude .env --exclude data \
# --exclude .git --exclude .idea \
# --exclude front/node_modules \
# --exclude nuxt/node_modules \
# --exclude run \
# --delete-after -e ssh -avz . pilaf:annuaire-cnll/
#
#
#boot:
# flask clear-data
# flask load-data
# flask import-descriptions
# flask geocode
# flask take-screenshots
#
## Format source code
format:
black *.py src tests scripts migrations
isort *.py src tests scripts
## Prepare data
boot:
flask clear-data
flask load-data
flask import-descriptions
flask geocode
flask take-screenshots
## Update dependencies
update-deps:
pip install -U pip wheel setuptools
poetry update
# dephell deps convert --from=pyproject.toml --to=requirements.txt --envs main
# dephell deps convert --from=pyproject.toml --to=setup.py
black setup.py
## Push to prod
push: clean
rsync -e ssh -avz ./ pilaf:annuaire-cnll/backend/
help:
adt help-make