-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
217 lines (131 loc) · 5.51 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# ****************** DIRECT DEVELOPMENT ****************** #
start-hypercorn:
hypercorn src.main:app --reload --bind 0.0.0.0:8100
start-dev-postgres:
make down-dev-postgres
docker-compose -f ./docker/local/compose-files/docker-compose-postgres.yml up
down-dev-postgres:
docker-compose -f ./docker/local/compose-files/docker-compose-postgres.yml down
# ****************** END DIRECT DEVELOPMENT ****************** #
# --
# --
# --
# ****************** ALEMBIC ****************** #
run-db-upgrade:
alembic upgrade head
# ****************** END ALEMBIC ****************** #
# --
# --
# --
# ****************** TESTS ****************** #
build-local:
docker compose -f docker/local/docker-compose.yml build
kill-local:
docker compose -f docker/local/docker-compose.yml down -v --remove-orphans
run-local-migrations:
docker compose -f docker/local/docker-compose.yml run -v ./:/usr/src/regnify-api --rm regnify-api alembic upgrade head
make init-platform:
docker compose -f docker/local/docker-compose.yml run -v ./:/usr/src/regnify-api --rm regnify-api python ./src/init_platform.py
run:
make run-local-migrations
make make init-platform
docker compose -f docker/local/docker-compose.yml up --remove-orphans -d
run-prod:
docker build -f Dockerfile.prod -t regnify-api .
docker run -p 8100:8000 regnify-api
restart:
docker compose -f docker/local/docker-compose.yml down regnify-api
make run
follow-logs:
docker compose -f docker/local/docker-compose.yml logs regnify-api -f
# ****************** END TESTS ****************** #
# --
# --
# --
# ****************** TESTS ****************** #
build-test:
docker compose -f docker/test/docker-compose-test.yml build
kill-test: kill-local
docker compose -f docker/test/docker-compose-test.yml down
run-test-migrations:
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api alembic upgrade head
run-tests:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/
make kill-test
# * ------ User Module ------ * #
# Runs all tests under the user modules
run-test-users:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users tests/users
make kill-test
run-test-users-crud:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users tests/users/crud/test_users.py
make kill-test
run-test-roles-crud:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users tests/users/crud/test_roles.py
make kill-test
run-test-users-services:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users/services tests/users/services/test_users.py
make kill-test
run-test-roles-services:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users/services tests/users/services/test_roles.py
make kill-test
run-test-users-http:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users/routers tests/users/http/test_users.py
make kill-test
run-test-roles-http:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ./:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users tests/users/http/test_roles.py
make kill-test
# * ------ End User Modules ------ * #
# * ------ File Module ------ * #
# Runs all tests under the user modules
run-test-files:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ${PWD}:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/users tests/files
make kill-test
run-test-files-crud:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ${PWD}:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/files tests/files/crud/test_files.py
make kill-test
run-test-files-services:
make kill-test
make run-test-migrations
# * run the tests
docker compose -f docker/test/docker-compose-test.yml run -v ${PWD}:/usr/src/regnify-api --rm regnify-api python -m pytest --cov-report term-missing --cov=src/files tests/files/service/test_service_files.py
make kill-test
# * ------ End File Modules ------ * #
# ****************** END TESTS ****************** #
# --
# --
# --
# ****************** MISC ****************** #
create-network:
docker network create regnify-network
# ****************** END MISC ****************** #