Skip to content

Commit

Permalink
Nightly to use default OpenAPI document if cannot be generated
Browse files Browse the repository at this point in the history
- Add more verbose echo
  • Loading branch information
Kevin Ngai committed Oct 4, 2023
1 parent 66bb1a3 commit 442f3fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deploy/nightly/deploy-nightly-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ echo "Generating nightly build for $TIMESTAMP"
mkdir $NIGHTLYDIR && cd $NIGHTLYDIR

echo "Cloning Git repository"
git clone $MSC_PYGEOAPI_GITREPO . -b master --depth=1
git clone $MSC_PYGEOAPI_GITREPO . -b docker-oapi-doc-default --depth=1

echo "Stopping/building/starting Docker setup"
docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml build --no-cache
Expand Down
8 changes: 6 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,18 @@ entry_cmd=${1:-run}
# Shorthand (bash)
function error() {
echo "ERROR: $@"
exit -1
}

echo "Trying to generate OpenAPI document with PYGEOAPI_CONFIG=${PYGEOAPI_CONFIG} and PYGEOAPI_OPENAPI=${PYGEOAPI_OPENAPI}..."
pygeoapi openapi generate ${PYGEOAPI_CONFIG} --output-file ${PYGEOAPI_OPENAPI}
# pygeoapi openapi validate ${PYGEOAPI_OPENAPI}

[[ $? -ne 0 ]] && error "OpenAPI document could not be generated ERROR"
if [ $? -ne 0 ]; then
error "OpenAPI document could not be generated ERROR"
DEFAULT_PYGEOAPI_OPENAPI=`echo ${PYGEOAPI_OPENAPI} | sed 's|deploy/nightly|deploy/default|'`
echo "Using default OpenAPI document with DEFAULT_PYGEOAPI_OPENAPI=${DEFAULT_PYGEOAPI_OPENAPI}"
cp ${DEFAULT_PYGEOAPI_OPENAPI} ${PYGEOAPI_OPENAPI}
fi

echo "OpenAPI document generated. continue to pygeoapi..."

Expand Down

0 comments on commit 442f3fd

Please sign in to comment.