Skip to content

Commit

Permalink
Add version release pipeline
Browse files Browse the repository at this point in the history
- Tag&Push images according to release tag

closes #358

Signed-off-by: Oguzcan Kirmemis <[email protected]>
  • Loading branch information
oguzcankirmemis authored and wagmarcel committed Mar 22, 2023
1 parent a1ed822 commit dbaadb4
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tag Image with Release Version

on:
push:
tags:
- v*

jobs:
call-build:
uses: IndustryFusion/DigitalTwin/.github/workflows/build.yaml@main
call-test:
uses: IndustryFusion/DigitalTwin/.github/workflows/k8s-tests.yaml@main
push-release-images:
needs: call-test
runs-on: private
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_PREFIX: ${{ secrets.DOCKER_PREFIX }}
SELF_HOSTED_RUNNER: true
steps:
- name: Push release images
shell: bash
run: |
set +o pipefail
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
TARGET_DOCKER_TAG=`git describe --tags --exact-match` || exit 1
# Tag and push passed "k3d-iff.localhost:12345" with release tag
images=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep ":0.1")
for image in $images; do
newimage=$(echo $image | sed -r "s/:0.1/:${TARGET_DOCKER_TAG}/g" | sed -r "s/k3d-iff.localhost:12345/${DOCKER_PREFIX}/g");
docker tag ${image} ${newimage};
docker push ${newimage};
done
# Tag and push scorpio-aio image
image=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep "k3d-iff.localhost:12345/digitaltwin/scorpio-all-in-one")
newimage="${DOCKER_PREFIX}/digitaltwin:${TARGET_DOCKER_TAG}"
docker tag ${image} ${newimage}
docker push ${newimage}

0 comments on commit dbaadb4

Please sign in to comment.