forked from stac-utils/stac-fastapi-elasticsearch-opensearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (53 loc) · 1.4 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
#!make
APP_HOST ?= 0.0.0.0
APP_PORT ?= 8080
EXTERNAL_APP_PORT ?= ${APP_PORT}
APP_PORT ?= 8080
ES_HOST ?= docker.for.mac.localhost
ES_PORT ?= 9200
run_es = docker-compose \
run \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e PY_IGNORE_IMPORTMISMATCH=1 \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-elasticsearch
.PHONY: image-deploy
image-deploy:
docker build -f Dockerfile.deploy -t stac-fastapi-elasticsearch: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
docker-run: image-dev
$(run_es)
.PHONY: docker-shell
docker-shell:
$(run_es) /bin/bash
.PHONY: test
test:
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd /app/stac_fastapi/elasticsearch/tests/ && pytest'
docker-compose down
.PHONY: run-database
run-database:
docker-compose run --rm elasticsearch
.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: install
install: pybase-install
pip install -e ./stac_fastapi/elasticsearch[dev,server]
.PHONY: ingest
ingest:
python3 data_loader/data_loader.py