Skip to content

Commit

Permalink
Add possibility to overwrite openapi images
Browse files Browse the repository at this point in the history
using environment variables

[noissue]
  • Loading branch information
dosas committed Dec 6, 2023
1 parent 78ccf94 commit a81999a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ else
VOLUME_DIR="${PWD}"
fi

OPENAPI_PYTHON_IMAGE="${OPENAPI_PYTHON_IMAGE:-docker.io/openapitools/openapi-generator-cli:v4.3.1}"
OPENAPI_RUBY_IMAGE="${OPENAPI_RUBY_IMAGE:-docker.io/openapitools/openapi-generator-cli:v4.3.1}"
OPENAPI_TYPESCRIPT_IMAGE="${OPENAPI_TYPESCRIPT_IMAGE:-docker.io/openapitools/openapi-generator-cli:v5.2.1}"

echo ::group::BINDINGS
if [ $2 = 'python' ]
then
Expand All @@ -88,7 +92,7 @@ then
$USER_COMMAND \
--rm \
${VOLUME_OPTION} \
docker.io/openapitools/openapi-generator-cli:v4.3.1 generate \
$OPENAPI_PYTHON_IMAGE generate \
-i ${VOLUME_DIR}/api.json \
-g python \
-o ${VOLUME_DIR}/$1-client \
Expand All @@ -110,7 +114,7 @@ then
$ULIMIT_COMMAND \
$USER_COMMAND \
--rm ${VOLUME_OPTION} \
docker.io/openapitools/openapi-generator-cli:v4.3.1 generate \
$OPENAPI_RUBY_IMAGE generate \
-i ${VOLUME_DIR}/api.json \
-g ruby \
-o ${VOLUME_DIR}/$1-client \
Expand All @@ -126,7 +130,7 @@ then
$ULIMIT_COMMAND \
$USER_COMMAND \
--rm ${VOLUME_OPTION} \
docker.io/openapitools/openapi-generator-cli:v5.2.1 generate \
$OPENAPI_TYPESCRIPT_IMAGE generate \
-i ${VOLUME_DIR}/api.json \
-g typescript-axios \
-o ${VOLUME_DIR}/$1-client \
Expand Down

0 comments on commit a81999a

Please sign in to comment.