-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix openapi client generation in the playbooks. (#2109)
Handle the unique path required for generating the galaxy client. No-Issue Signed-off-by: James Tanner <tanner.jc@gmail.com>
- Loading branch information
Showing
3 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...books/collections/ansible_collections/galaxy_ng/tools/roles/pulp_client/files/generate.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash -x | ||
|
||
set -e | ||
|
||
PULP_IP=$1 | ||
PLUGIN=$2 | ||
|
||
cd ../../.. | ||
if [[ ! -d pulp-openapi-generator ]]; then | ||
git clone https://github.com/pulp/pulp-openapi-generator | ||
fi | ||
cd pulp-openapi-generator; | ||
|
||
export USE_LOCAL_API_JSON=true; | ||
export PULP_URL="https://${PULP_IP}/api/galaxy/pulp/api/v3/"; | ||
|
||
curl -L -k -u admin:password -o status.json "https://${PULP_IP}/api/galaxy/pulp/api/v3/status/"; | ||
curl -L -k -u admin:password -o api.json "https://${PULP_IP}/api/galaxy/pulp/api/v3/docs/api.json?bindings&plugin=${PLUGIN}"; | ||
|
||
if [ "${PLUGIN}" == "galaxy_ng" ]; then | ||
cat status.json | head | ||
export REPORTED_VERSION=$(jq '.versions[] | select (.component == "galaxy").version' status.json | tr -d '"') | ||
echo "REPORTED_VERSION: ${REPORTED_VERSION}" | ||
export VERSION="$(echo "$REPORTED_VERSION" | python -c 'from packaging.version import Version; print(Version(input()))')" | ||
echo "FINAL_VERSION: ${FINAL_VERSION}" | ||
else | ||
export VERSION="" | ||
fi; | ||
|
||
bash -x generate.sh ${PLUGIN} python ${VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters