Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wf/korifi release #35

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions .github/workflows/build-korifi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: create korifi release artifacts
env:
VERSION: ${{ env.V_KORIFI }}
DOCKER_REGISTRY: ${{ env.REGISTRY }}
DOCKER_REGISTRY_USER: ${{ github.actor }}
DOCKER_REGISTRY_PASS: ${{ secrets.GITHUB_TOKEN }}
shell: bash
working-directory: .github.tools.sap/unified-runtime/korifi-trinity/
run: |
run: ./scripts/create-korifi-release.sh ${{ env.V_KORIFI }}


44 changes: 44 additions & 0 deletions scripts/create-korifi-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

set -x
set -euo pipefail

VERSION=${1:-}
RELEASE_DIR="./release-$VERSION"
GITSHA=$(git rev-parse --short HEAD)

mkdir -p $RELEASE_DIR
cp ./CHANGELOG.md $RELEASE_DIR/
cp ./scripts/assets/korifi-kbld.yml $RELEASE_DIR/

kbld \
-f "$RELEASE_DIR/korifi-kbld.yml" \
-f "./helm/korifi/values.yaml" \
--images-annotation=false >$RELEASE_DIR/values.yaml

API_SOURCE=`yq .api.image $RELEASE_DIR/values.yaml`
CONTR_SOURCE=`yq .controllers.image $RELEASE_DIR/values.yaml
`
API_TARGET="ghcr.io/kyma-project/cfapi/korifi-api"
CONTR_TARGET="ghcr.io/kyma-project/cfapi/korifi-controllers"

echo "tag target API image $API_TARGET"
docker tag $API_SOURCE $API_TARGET:latest
docker tag $API_SOURCE $API_TARGET:$VERSION
docker tag $API_SOURCE $API_TARGET:$GITSHA
docker push --all-tags $API_TARGET

echo "tag target CONTROLLERS image $API_TARGET"
docker tag $CONTR_SOURCE $CONTR_TARGET:latest
docker tag $CONTR_SOURCE $CONTR_TARGET:$VERSION
docker tag $CONTR_SOURCE $CONTR_TARGET:$GITSHA
docker push --all-tags $CONTR_TARGET

export API_SHA_REF=$(docker inspect --format='{{index .RepoDigests 0}}' $API_TARGET)
export CONTR_SHA_REF=$(docker inspect --format='{{index .RepoDigests 0}}' $CONTR_TARGET)

yq -i '.api.image = strenv(API_SHA_REF)' $RELEASE_DIR/values.yaml
yq -i '.controllers.image = strenv(CONTR_SHA_REF)' $RELEASE_DIR/values.yaml


tar -czf $RELEASE_DIR/korifi-helm.tar.gz -C helm korifi
Loading