diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 915929cd..e79fcecd 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -1,4 +1,5 @@ name: stac-fastapi-elasticsearch + on: push: branches: diff --git a/Makefile b/Makefile index 545d2311..4dfb2aec 100644 --- a/Makefile +++ b/Makefile @@ -28,11 +28,11 @@ run_os = docker-compose \ .PHONY: image-deploy-es image-deploy-es: - docker build -f Dockerfile.dev.es -t stac-fastapi-elasticsearch:latest . + docker build -f dockerfiles/Dockerfile.dev.es -t stac-fastapi-elasticsearch:latest . .PHONY: image-deploy-os image-deploy-os: - docker build -f Dockerfile.dev.os -t stac-fastapi-opensearch:latest . + docker build -f dockerfiles/Dockerfile.dev.os -t stac-fastapi-opensearch:latest . .PHONY: run-deploy-locally run-deploy-locally: diff --git a/data_loader/data_loader.py b/data_loader/data_loader.py index c438811d..315068b6 100644 --- a/data_loader/data_loader.py +++ b/data_loader/data_loader.py @@ -13,6 +13,7 @@ DATA_DIR = os.path.join(os.path.dirname(__file__), "setup_data/") backend = sys.argv[1].lower() + if backend == "opensearch": STAC_API_BASE_URL = "http://localhost:8082" elif backend == "elasticsearch": diff --git a/docker-compose.yml b/docker-compose.yml index 9d665bce..ee6e995f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: restart: always build: context: . - dockerfile: Dockerfile.dev.es + dockerfile: dockerfiles/Dockerfile.dev.es environment: - APP_HOST=0.0.0.0 - APP_PORT=8080 @@ -36,7 +36,7 @@ services: restart: always build: context: . - dockerfile: Dockerfile.dev.os + dockerfile: dockerfiles/Dockerfile.dev.os environment: - APP_HOST=0.0.0.0 - APP_PORT=8082 diff --git a/Dockerfile.deploy.es b/dockerfiles/Dockerfile.deploy.es similarity index 100% rename from Dockerfile.deploy.es rename to dockerfiles/Dockerfile.deploy.es diff --git a/Dockerfile.deploy.os b/dockerfiles/Dockerfile.deploy.os similarity index 100% rename from Dockerfile.deploy.os rename to dockerfiles/Dockerfile.deploy.os diff --git a/Dockerfile.dev.es b/dockerfiles/Dockerfile.dev.es similarity index 100% rename from Dockerfile.dev.es rename to dockerfiles/Dockerfile.dev.es diff --git a/Dockerfile.dev.os b/dockerfiles/Dockerfile.dev.os similarity index 100% rename from Dockerfile.dev.os rename to dockerfiles/Dockerfile.dev.os diff --git a/scripts/publish b/scripts/publish deleted file mode 100755 index 464bbe05..00000000 --- a/scripts/publish +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -set -e - -if [[ -n "${CI}" ]]; then - set -x -fi - -# Import shared variables -SUBPACKAGE_DIRS=( - "stac_fastapi/types" - "stac_fastapi/extensions" - "stac_fastapi/api" - "stac_fastapi/sqlalchemy" - "stac_fastapi/pgstac" - "stac_fastapi/elasticsearch" -) - -function usage() { - echo -n \ - "Usage: $(basename "$0") -Publish all stac-fastapi packages. - -Options: ---test Publish to test pypi. Requires a 'testpypi' repository - be defined in your .pypirc; - See https://packaging.python.org/guides/using-testpypi/#using-testpypi-with-pip -" -} - -POSITIONAL=() -while [[ $# -gt 0 ]] -do - key="$1" - case $key in - - --help) - usage - exit 0 - shift - ;; - - --test) - TEST_PYPI="--repository testpypi" - shift - ;; - - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; - esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - -# Fail if this isn't CI and we aren't publishing to test pypi -if [ -z "${TEST_PYPI}" ] && [ -z "${CI}" ]; then - echo "Only CI can publish to pypi" - exit 1 -fi - -if [ "${BASH_SOURCE[0]}" = "${0}" ]; then - for PACKAGE_DIR in "${SUBPACKAGE_DIRS[@]}" - do - echo ${PACKAGE_DIR} - pushd ./${PACKAGE_DIR} - rm -rf dist - python setup.py sdist bdist_wheel - twine upload ${TEST_PYPI} dist/* - popd - - done -fi \ No newline at end of file