-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
116 lines (93 loc) · 2.72 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
#!make
APP_HOST ?= 0.0.0.0
EXTERNAL_APP_PORT ?= 8080
ES_APP_PORT ?= 8080
ES_HOST ?= docker.for.mac.localhost
ES_PORT ?= 9200
OS_APP_PORT ?= 8082
OS_HOST ?= docker.for.mac.localhost
OS_PORT ?= 9202
run_es = docker-compose \
run \
-p ${EXTERNAL_APP_PORT}:${ES_APP_PORT} \
-e PY_IGNORE_IMPORTMISMATCH=1 \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${ES_APP_PORT} \
app-elasticsearch
run_os = docker-compose \
run \
-p ${EXTERNAL_APP_PORT}:${OS_APP_PORT} \
-e PY_IGNORE_IMPORTMISMATCH=1 \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${OS_APP_PORT} \
app-opensearch
.PHONY: image-deploy-es
image-deploy-es:
docker build -f dockerfiles/Dockerfile.dev.es -t stac-fastapi-elasticsearch:latest .
.PHONY: image-deploy-os
image-deploy-os:
docker build -f dockerfiles/Dockerfile.dev.os -t stac-fastapi-opensearch:latest .
.PHONY: run-deploy-locally
run-deploy-locally:
docker run -it -p 8080:8080 \
-e ES_HOST=${ES_HOST} \
-e ES_PORT=${ES_PORT} \
-e ES_USER=${ES_USER} \
-e ES_PASS=${ES_PASS} \
stac-fastapi-elasticsearch:latest
.PHONY: image-dev
image-dev:
docker-compose build
.PHONY: docker-run-es
docker-run-es: image-dev
$(run_es)
.PHONY: docker-run-os
docker-run-os: image-dev
$(run_os)
.PHONY: docker-shell-es
docker-shell-es:
$(run_es) /bin/bash
.PHONY: docker-shell-os
docker-shell-os:
$(run_os) /bin/bash
.PHONY: test-elasticsearch
test-elasticsearch:
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
docker-compose down
.PHONY: test-opensearch
test-opensearch:
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
docker-compose down
.PHONY: test
test:
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
docker-compose down
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
docker-compose down
.PHONY: run-database-es
run-database-es:
docker-compose run --rm elasticsearch
.PHONY: run-database-os
run-database-os:
docker-compose run --rm opensearch
.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] && \
pip install -e ./stac_fastapi/core
.PHONY: install-es
install-es: pybase-install
pip install -e ./stac_fastapi/elasticsearch[dev,server]
.PHONY: install-os
install-os: pybase-install
pip install -e ./stac_fastapi/opensearch[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