diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index d1e445b..bfd602d 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -12,7 +12,6 @@ on: env: REGISTRY: swr.eu-de.otc.t-systems.com PROJECT: metrics-processor - # OTC project of the region, listed under "My Credentials > API Credentials" in the OTC console. SWR_PROJECT: eu-de permissions: @@ -24,7 +23,7 @@ jobs: if: github.event_name == 'pull_request' runs-on: ubuntu-latest env: - ORG: stackmon-preprod + ORG: stackmon steps: - uses: actions/checkout@v7 @@ -50,12 +49,12 @@ jobs: labels: ${{ steps.meta.outputs.labels }} push: false - # Builds from main and manual runs land in the preprod project; only a release reaches stackmon. + # Builds from main and manual runs land in the stackmon project (the preprod cluster's pull secret only grants access to it); a release adds a semver tag. publish-preprod: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest env: - ORG: stackmon-preprod + ORG: stackmon steps: - uses: actions/checkout@v7 @@ -74,17 +73,16 @@ jobs: - name: Login to Container Registry env: - SWR_AK: ${{ secrets.SWR_PREPROD_AK }} - SWR_SK: ${{ secrets.SWR_PREPROD_SK }} + SWR_AK: ${{ secrets.SWR_AK }} + SWR_SK: ${{ secrets.SWR_SK }} run: | set -euo pipefail if [ -z "$SWR_AK" ] || [ -z "$SWR_SK" ]; then - echo "The SWR_PREPROD_AK and SWR_PREPROD_SK repository secrets must be set" >&2 + echo "The SWR_AK and SWR_SK repository secrets must be set" >&2 exit 1 fi - - # SWR authenticates with "@" and a login key derived from the AK/SK pair. + login_key="$(printf '%s' "$SWR_AK" | openssl dgst -sha256 -hmac "$SWR_SK" | awk '{print $NF}')" if [[ ! "$login_key" =~ ^[0-9a-f]{64}$ ]]; then echo "Cannot derive the SWR login key from the AK/SK pair" >&2 @@ -138,7 +136,6 @@ jobs: exit 1 fi - # SWR authenticates with "@" and a login key derived from the AK/SK pair. login_key="$(printf '%s' "$SWR_AK" | openssl dgst -sha256 -hmac "$SWR_SK" | awk '{print $NF}')" if [[ ! "$login_key" =~ ^[0-9a-f]{64}$ ]]; then echo "Cannot derive the SWR login key from the AK/SK pair" >&2