Skip to content

Commit d0565e1

Browse files
committed
update makefile
1 parent 152ecf0 commit d0565e1

File tree

3 files changed

+31
-160
lines changed

3 files changed

+31
-160
lines changed

Makefile

Lines changed: 31 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,92 +2,58 @@
22
APP_HOST ?= 0.0.0.0
33
EXTERNAL_APP_PORT ?= ${APP_PORT}
44

5-
ES_APP_PORT ?= 8080
6-
ES_HOST ?= docker.for.mac.localhost
7-
ES_PORT ?= 9200
5+
MONGO_APP_PORT ?= 8084
6+
MONGO_HOST ?= docker.for.mac.localhost
7+
MONGO_PORT ?= 27017
88

9-
OS_APP_PORT ?= 8082
10-
OS_HOST ?= docker.for.mac.localhost
11-
OS_PORT ?= 9202
12-
13-
run_es = docker-compose \
9+
run_mongo = docker-compose \
1410
run \
15-
-p ${EXTERNAL_APP_PORT}:${ES_APP_PORT} \
11+
-p ${EXTERNAL_APP_PORT}:${MONGO_APP_PORT} \
1612
-e PY_IGNORE_IMPORTMISMATCH=1 \
1713
-e APP_HOST=${APP_HOST} \
18-
-e APP_PORT=${ES_APP_PORT} \
19-
app-elasticsearch
14+
-e APP_PORT=${MONGO_APP_PORT} \
15+
app-mongo
2016

21-
run_os = docker-compose \
22-
run \
23-
-p ${EXTERNAL_APP_PORT}:${OS_APP_PORT} \
24-
-e PY_IGNORE_IMPORTMISMATCH=1 \
25-
-e APP_HOST=${APP_HOST} \
26-
-e APP_PORT=${OS_APP_PORT} \
27-
app-opensearch
17+
.PHONY: image-deploy-mongo
18+
image-deploy-mongo:
19+
docker build -f dockerfiles/Dockerfile.dev.mongo -t stac-fastapi-mongo:latest .
2820

29-
.PHONY: image-deploy-es
30-
image-deploy-es:
31-
docker build -f dockerfiles/Dockerfile.dev.es -t stac-fastapi-elasticsearch:latest .
32-
33-
.PHONY: image-deploy-os
34-
image-deploy-os:
35-
docker build -f dockerfiles/Dockerfile.dev.os -t stac-fastapi-opensearch:latest .
3621

3722
.PHONY: run-deploy-locally
3823
run-deploy-locally:
39-
docker run -it -p 8080:8080 \
40-
-e ES_HOST=${ES_HOST} \
41-
-e ES_PORT=${ES_PORT} \
42-
-e ES_USER=${ES_USER} \
43-
-e ES_PASS=${ES_PASS} \
44-
stac-fastapi-elasticsearch:latest
24+
docker run -it -p 8084:8084 \
25+
-e ES_HOST=${MONGO_HOST} \
26+
-e ES_PORT=${MONGO_PORT} \
27+
-e ES_USER=${MONGO_USER} \
28+
-e ES_PASS=${MONGO_PASS} \
29+
stac-fastapi-mongo:latest
4530

4631
.PHONY: image-dev
4732
image-dev:
4833
docker-compose build
4934

50-
.PHONY: docker-run-es
51-
docker-run-es: image-dev
52-
$(run_es)
53-
54-
.PHONY: docker-run-os
55-
docker-run-os: image-dev
56-
$(run_os)
35+
.PHONY: docker-run-mongo
36+
docker-run-mongo: image-dev
37+
$(run_mongo)
5738

58-
.PHONY: docker-shell-es
59-
docker-shell-es:
60-
$(run_es) /bin/bash
39+
.PHONY: docker-shell-mongo
40+
docker-shell-mongo:
41+
$(run_mongo) /bin/bash
6142

62-
.PHONY: docker-shell-os
63-
docker-shell-os:
64-
$(run_os) /bin/bash
6543

66-
.PHONY: test-elasticsearch
67-
test-elasticsearch:
68-
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
69-
docker-compose down
70-
71-
.PHONY: test-opensearch
72-
test-opensearch:
73-
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
44+
.PHONY: test-mongo
45+
test-mongo:
46+
-$(run_mongo) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh mongo:27017 && cd stac_fastapi/tests/ && pytest'
7447
docker-compose down
7548

7649
.PHONY: test
7750
test:
78-
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
79-
docker-compose down
80-
81-
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
51+
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh mongo:27017 && cd stac_fastapi/tests/ && pytest'
8252
docker-compose down
8353

84-
.PHONY: run-database-es
85-
run-database-es:
86-
docker-compose run --rm elasticsearch
87-
88-
.PHONY: run-database-os
89-
run-database-os:
90-
docker-compose run --rm opensearch
54+
.PHONY: run-database-mongo
55+
run-database-mongo:
56+
docker-compose run --rm mongo
9157

9258
.PHONY: pybase-install
9359
pybase-install:
@@ -97,13 +63,9 @@ pybase-install:
9763
pip install -e ./stac_fastapi/extensions[dev] && \
9864
pip install -e ./stac_fastapi/core
9965

100-
.PHONY: install-es
66+
.PHONY: install-mongo
10167
install-es: pybase-install
102-
pip install -e ./stac_fastapi/elasticsearch[dev,server]
103-
104-
.PHONY: install-os
105-
install-os: pybase-install
106-
pip install -e ./stac_fastapi/opensearch[dev,server]
68+
pip install -e ./stac_fastapi/mongo[dev,server]
10769

10870
.PHONY: ingest
10971
ingest:

examples/pip_docker/elasticsearch/config/elasticsearch.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/publish

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)