|
| 1 | +#!make |
| 2 | +APP_HOST ?= 0.0.0.0 |
| 3 | +APP_PORT ?= 8080 |
| 4 | +EXTERNAL_APP_PORT ?= ${APP_PORT} |
| 5 | +run_docker = docker-compose run --rm \ |
| 6 | + -p ${EXTERNAL_APP_PORT}:${APP_PORT} \ |
| 7 | + -e APP_HOST=${APP_HOST} \ |
| 8 | + -e APP_PORT=${APP_PORT} \ |
| 9 | + app-sqlalchemy |
| 10 | + |
| 11 | +run_pgstac = docker-compose run --rm \ |
| 12 | + -p ${EXTERNAL_APP_PORT}:${APP_PORT} \ |
| 13 | + -e APP_HOST=${APP_HOST} \ |
| 14 | + -e APP_PORT=${APP_PORT} \ |
| 15 | + app-pgstac |
| 16 | + |
| 17 | +run_mongo = docker-compose -f docker-compose.mongo.yml \ |
| 18 | + run \ |
| 19 | + -p ${EXTERNAL_APP_PORT}:${APP_PORT} \ |
| 20 | + -e PY_IGNORE_IMPORTMISMATCH=1 \ |
| 21 | + -e APP_HOST=${APP_HOST} \ |
| 22 | + -e APP_PORT=${APP_PORT} \ |
| 23 | + app-mongo |
| 24 | + |
| 25 | +.PHONY: image |
| 26 | +image: |
| 27 | + docker-compose build |
| 28 | + |
| 29 | +.PHONY: mongo-image |
| 30 | +mongo-image: |
| 31 | + docker-compose -f docker-compose.mongo.yml build |
| 32 | + |
| 33 | +.PHONY: docker-run |
| 34 | +docker-run: image |
| 35 | + $(run_docker) |
| 36 | + |
| 37 | +.PHONY: docker-run-pgstac |
| 38 | +docker-run-pgstac: image |
| 39 | + $(run_pgstac) |
| 40 | + |
| 41 | +.PHONY: docker-run-mongo |
| 42 | +docker-run-mongo: mongo-image |
| 43 | + $(run_mongo) |
| 44 | + |
| 45 | +.PHONY: docker-shell |
| 46 | +docker-shell: |
| 47 | + $(run_docker) /bin/bash |
| 48 | + |
| 49 | +.PHONY: docker-shell-pgstac |
| 50 | +docker-shell-pgstac: |
| 51 | + $(run_pgstac) /bin/bash |
| 52 | + |
| 53 | +.PHONY: docker-shell-mongo |
| 54 | +docker-shell-mongo: |
| 55 | + $(run_mongo) /bin/bash |
| 56 | + |
| 57 | +.PHONY: test-sqlalchemy |
| 58 | +test-sqlalchemy: run-joplin-sqlalchemy |
| 59 | + $(run_docker) /bin/bash -c 'export && ./scripts/wait-for-it.sh database:5432 && cd /app/stac_fastapi/sqlalchemy/tests/ && pytest' |
| 60 | + |
| 61 | +.PHONY: test-pgstac |
| 62 | +test-pgstac: |
| 63 | + $(run_pgstac) /bin/bash -c 'export && ./scripts/wait-for-it.sh database:5432 && cd /app/stac_fastapi/pgstac/tests/ && pytest' |
| 64 | + |
| 65 | +.PHONY: test-mongo |
| 66 | +test-mongo: |
| 67 | + $(run_mongo) /bin/bash -c 'export && cd /app/stac_fastapi/mongo/tests/ && pytest' |
| 68 | + |
| 69 | +.PHONY: run-database |
| 70 | +run-database: |
| 71 | + docker-compose run --rm database |
| 72 | + |
| 73 | +.PHONY: run-mongo-database |
| 74 | +run-mongo-database: |
| 75 | + docker-compose -f docker-compose.mongo.yml run --rm mongo_db |
| 76 | + |
| 77 | +.PHONY: run-joplin-sqlalchemy |
| 78 | +run-joplin-sqlalchemy: |
| 79 | + docker-compose run --rm loadjoplin-sqlalchemy |
| 80 | + |
| 81 | +.PHONY: run-joplin-pgstac |
| 82 | +run-joplin-pgstac: |
| 83 | + docker-compose run --rm loadjoplin-pgstac |
| 84 | + |
| 85 | +.PHONY: test |
| 86 | +test: test-sqlalchemy test-pgstac test-mongo |
| 87 | + |
| 88 | +.PHONY: pybase-install |
| 89 | +pybase-install: |
| 90 | + pip install wheel && \ |
| 91 | + pip install -e ./stac_fastapi/api[dev] && \ |
| 92 | + pip install -e ./stac_fastapi/types[dev] && \ |
| 93 | + pip install -e ./stac_fastapi/extensions[dev] |
| 94 | + |
| 95 | +.PHONY: pgstac-install |
| 96 | +pgstac-install: pybase-install |
| 97 | + pip install -e ./stac_fastapi/pgstac[dev,server] |
| 98 | + |
| 99 | +.PHONY: sqlalchemy-install |
| 100 | +sqlalchemy-install: pybase-install |
| 101 | + pip install -e ./stac_fastapi/sqlalchemy[dev,server] |
| 102 | + |
| 103 | +.PHONY: mongo-install |
| 104 | +mongo-install: pybase-install |
| 105 | + pip install -e ./stac_fastapi/mongo[dev,server] |
| 106 | + |
| 107 | +.PHONY: docs-image |
| 108 | +docs-image: |
| 109 | + docker-compose -f docker-compose.docs.yml \ |
| 110 | + build |
| 111 | + |
| 112 | +.PHONY: docs |
| 113 | +docs: docs-image |
| 114 | + docker-compose -f docker-compose.docs.yml \ |
| 115 | + run docs |
0 commit comments