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
  • Loading branch information
dosas committed Nov 13, 2023
1 parent 30e72b6 commit e6cdb49
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 @@ -64,6 +64,10 @@ else
export VERSION=$(http ${PULP_URL}status/ | jq --arg plugin $COMPONENT_NAME -r '.versions[] | select(.component == $plugin) | .version')
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 @@ -72,7 +76,7 @@ then
$USER_COMMAND \
--rm \
-v ${PWD}:$volume_name \
docker.io/openapitools/openapi-generator-cli:v4.3.1 generate \
$OPENAPI_PYTHON_IMAGE generate \
-i /local/api.json \
-g python \
-o /local/$1-client \
Expand All @@ -94,7 +98,7 @@ then
$ULIMIT_COMMAND \
$USER_COMMAND \
--rm -v ${PWD}:$volume_name \
docker.io/openapitools/openapi-generator-cli:v4.3.1 generate \
$OPENAPI_RUBY_IMAGE generate \
-i /local/api.json \
-g ruby \
-o /local/$1-client \
Expand All @@ -110,7 +114,7 @@ then
$ULIMIT_COMMAND \
$USER_COMMAND \
--rm -v ${PWD}:$volume_name \
docker.io/openapitools/openapi-generator-cli:v5.2.1 generate \
$OPENAPI_TYPESCRIPT_IMAGE generate \
-i /local/api.json \
-g typescript-axios \
-o /local/$1-client \
Expand Down

0 comments on commit e6cdb49

Please sign in to comment.