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
  • Loading branch information
Kevin Ngai committed Sep 27, 2023
1 parent 5c1f9d1 commit d6ba984
Showing 1 changed file with 6 additions and 2 deletions.
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"
echo "Using default OpenAPI document"
DEFAULT_PYGEOAPI_OPENAPI=`echo $PYGEOAPI_CONFIG | sed 's/deploy\/nightly/deploy/\default/'
cp $DEFAULT_PYGEOAPI_OPENAPI $PYGEOAPI_OPENAPI
fi
echo "OpenAPI document generated. continue to pygeoapi..."
Expand Down

0 comments on commit d6ba984

Please sign in to comment.