diff --git a/templates/github/.github/workflows/scripts/script.sh.j2 b/templates/github/.github/workflows/scripts/script.sh.j2 index 245e10dc..e10ef575 100755 --- a/templates/github/.github/workflows/scripts/script.sh.j2 +++ b/templates/github/.github/workflows/scripts/script.sh.j2 @@ -47,11 +47,15 @@ password password # Some commands like ansible-galaxy specifically require 600 cmd_prefix bash -c "chmod 600 ~pulp/.netrc" -# Workaround: Domains are not supported by the published bindings. +# Infer the client name from the package name by replacing "-" with "_". +# Use the component to infer the package name on older versions of pulpcore. + if [ "$(echo "$REPORTED_STATUS" | jq -r '.domain_enabled')" = "true" ] then + # Workaround: Domains are not supported by the published bindings. + # Generate new bindings for all packages. pushd ../pulp-openapi-generator - for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[].package|sub("-"; "_")') + for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[]|(.package // ("pulp_" + .component)|sub("pulp_core"; "pulpcore"))|sub("-"; "_")') do ./generate.sh "${item}" python cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client" @@ -65,7 +69,7 @@ else {%- for plugin in plugins -%} |select(.component!="{{ plugin.app_label }}") {%- endfor -%} - .package|sub("-"; "_")') + |(.package // ("pulp_" + .component)|sub("pulp_core"; "pulpcore"))|sub("-"; "_")') do ./generate.sh "${item}" python cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client"