Skip to content

Commit

Permalink
WIP: Update python generator image
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Jun 6, 2024
1 parent 6bc3825 commit 09f7286
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 407 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_file' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template
---
name: pulp-openapi-generator PR CI
on: pull_request
Expand Down Expand Up @@ -66,7 +60,7 @@ jobs:
run: |
echo ::group::HTTPIE
sudo apt-get update -yq
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install httpie
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install httpie jq
echo ::endgroup::
echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/.ci/assets/httpie/" >> $GITHUB_ENV
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ target/

# written in generate.sh
.openapi-generator-ignore

# generated stuff
/api.json
/*-client/
10 changes: 7 additions & 3 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ else
VOLUME_DIR="${PWD}"
fi

OPENAPI_PYTHON_IMAGE="${OPENAPI_PYTHON_IMAGE:-docker.io/openapitools/openapi-generator-cli:v4.3.1}"
OPENAPI_PYTHON_IMAGE="${OPENAPI_PYTHON_IMAGE:-docker.io/openapitools/openapi-generator-cli:v7.6.0}"
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}"

Expand Down Expand Up @@ -114,14 +114,14 @@ then
mkdir -p "$1-client"
echo git_push.sh > "$1-client/.openapi-generator-ignore"

python3 remove-cookie-auth.py
cat api.json | jq 'del(.paths[][].security|select(.)[]|select(.cookieAuth))|del(.components.securitySchemes.cookieAuth)' > patched-api.json
$CONTAINER_EXEC run \
"${ULIMIT_COMMAND[@]}" \
"${USER_COMMAND[@]}" \
--rm \
"${VOLUME_OPTION[@]}" \
"$OPENAPI_RUBY_IMAGE" generate \
-i "${VOLUME_DIR}/api.json" \
-i "${VOLUME_DIR}/patched-api.json" \
-g ruby \
-o "${VOLUME_DIR}/$1-client" \
"--additional-properties=gemName=$1_client,gemLicense="GPLv2+",gemVersion=${VERSION},gemHomepage=https://github.com/pulp/$1" \
Expand All @@ -147,6 +147,10 @@ then
fi

echo ::endgroup::

exit


if [[ -z "${USE_LOCAL_API_JSON:-}" ]]
then
rm api.json
Expand Down
58 changes: 0 additions & 58 deletions remove-cookie-auth.py

This file was deleted.

260 changes: 0 additions & 260 deletions templates/python/api.mustache

This file was deleted.

Loading

0 comments on commit 09f7286

Please sign in to comment.