Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 "<project>@<AK>" 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
Expand Down Expand Up @@ -138,7 +136,6 @@ jobs:
exit 1
fi

# SWR authenticates with "<project>@<AK>" 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
Expand Down
Loading