From e63975f5257d3cc03236f626d9ccc72f016e9acc Mon Sep 17 00:00:00 2001 From: Tobias Svane Mikkelsen Date: Wed, 3 Jun 2026 14:44:15 +0200 Subject: [PATCH] feat(deploy-ocpp-gateway): add optional infra-portal-context input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The releaser URL hardcodes the context segment as ocpp-${cluster}, which breaks when a gateway moves to a different cluster: OCPP gateway staging now runs on main-staging, but the blue/green releaser call still targets the ocpp-staging context. Adds an optional infra-portal-context input used as the context segment when provided, falling back to the existing ocpp-${cluster} derivation — behavior for all current callers (including production) is unchanged. Also logs the final URL for easier verification. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/actions/deploy-ocpp-gateway/action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/actions/deploy-ocpp-gateway/action.yml b/.github/actions/deploy-ocpp-gateway/action.yml index 942fd66..6874faf 100644 --- a/.github/actions/deploy-ocpp-gateway/action.yml +++ b/.github/actions/deploy-ocpp-gateway/action.yml @@ -16,6 +16,10 @@ inputs: infra-portal-token: description: 'Infra Portal token' required: true + infra-portal-context: + description: 'Kube context the infra-portal releaser should target (e.g. main-staging). Defaults to ocpp- derived from stage.' + required: false + default: '' runs: using: 'composite' @@ -42,7 +46,13 @@ runs: cluster=production path_prefix="" fi - response_code=$(curl --write-out '%{http_code}' --silent -o resp_body.txt -X POST -H "Authorization: Bearer ${{ inputs.infra-portal-token }}" -H "Content-Type: application/json" -d '{"commitHash": "'"${{ github.sha }}"'", "buildNumber": "'"${{ github.run_number }}"'", "awsAccountId": "'"${{ inputs.aws-account-id }}"'", "replicas": ${{ inputs.ocpp-gateway-replicas }}}' https://${{ steps.set-infra-portal-server.outputs.infra-portal-hostname }}${path_prefix}/ocpp-${cluster}/${{ inputs.service-identifier }}-${{ inputs.stage }}/create-gateway-release) + context="${{ inputs.infra-portal-context }}" + if [[ -z "$context" ]]; then + context="ocpp-${cluster}" + fi + release_url="https://${{ steps.set-infra-portal-server.outputs.infra-portal-hostname }}${path_prefix}/${context}/${{ inputs.service-identifier }}-${{ inputs.stage }}/create-gateway-release" + echo "Posting gateway release to ${release_url}" + response_code=$(curl --write-out '%{http_code}' --silent -o resp_body.txt -X POST -H "Authorization: Bearer ${{ inputs.infra-portal-token }}" -H "Content-Type: application/json" -d '{"commitHash": "'"${{ github.sha }}"'", "buildNumber": "'"${{ github.run_number }}"'", "awsAccountId": "'"${{ inputs.aws-account-id }}"'", "replicas": ${{ inputs.ocpp-gateway-replicas }}}' "${release_url}") if [[ $response_code != "200" ]]; then echo "::error::$(cat resp_body.txt)" exit 1