forked from stac-utils/stac-fastapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (72 loc) · 2.14 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
#!make
APP_HOST ?= 0.0.0.0
APP_PORT ?= 8080
EXTERNAL_APP_PORT ?= ${APP_PORT}
run_sqlalchemy = docker-compose run --rm \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-sqlalchemy
run_pgstac = docker-compose run --rm \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-pgstac
.PHONY: image
image:
docker-compose build
.PHONY: docker-run-all
docker-run-all:
docker-compose up
.PHONY: docker-run-sqlalchemy
docker-run-sqlalchemy: image
$(run_sqlalchemy)
.PHONY: docker-run-pgstac
docker-run-pgstac: image
$(run_pgstac)
.PHONY: docker-shell-sqlalchemy
docker-shell-sqlalchemy:
$(run_sqlalchemy) /bin/bash
.PHONY: docker-shell-pgstac
docker-shell-pgstac:
$(run_pgstac) /bin/bash
.PHONY: test-sqlalchemy
test-sqlalchemy: run-joplin-sqlalchemy
$(run_sqlalchemy) /bin/bash -c 'export && ./scripts/wait-for-it.sh database:5432 && cd /app/stac_fastapi/sqlalchemy/tests/ && pytest -vvv'
.PHONY: test-pgstac
test-pgstac:
$(run_pgstac) /bin/bash -c 'export && ./scripts/wait-for-it.sh database:5432 && cd /app/stac_fastapi/pgstac/tests/ && pytest -vvv'
.PHONY: test-api
test-api:
$(run_sqlalchemy) /bin/bash -c 'cd /app/stac_fastapi/api && pytest -svvv'
.PHONY: run-database
run-database:
docker-compose run --rm database
.PHONY: run-joplin-sqlalchemy
run-joplin-sqlalchemy:
docker-compose run --rm loadjoplin-sqlalchemy
.PHONY: run-joplin-pgstac
run-joplin-pgstac:
docker-compose run --rm loadjoplin-pgstac
.PHONY: test
test: test-sqlalchemy test-pgstac
.PHONY: pybase-install
pybase-install:
pip install wheel && \
pip install -e ./stac_fastapi/api[dev] && \
pip install -e ./stac_fastapi/types[dev] && \
pip install -e ./stac_fastapi/extensions[dev]
.PHONY: pgstac-install
pgstac-install: pybase-install
pip install -e ./stac_fastapi/pgstac[dev,server]
.PHONY: sqlalchemy-install
sqlalchemy-install: pybase-install
pip install -e ./stac_fastapi/sqlalchemy[dev,server]
.PHONY: docs-image
docs-image:
docker-compose -f docker-compose.docs.yml \
build
.PHONY: docs
docs: docs-image
docker-compose -f docker-compose.docs.yml \
run docs