Skip to content

Commit

Permalink
Fix wrong docker prefix in image push process
Browse files Browse the repository at this point in the history
Signed-off-by: marcel <wagmarcel@web.de>
  • Loading branch information
wagmarcel committed Jan 25, 2024
1 parent acee7bc commit ce1d0cd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@ on:
- 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
runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_PREFIX: ${{ secrets.DOCKER_PREFIX }}
SELF_HOSTED_RUNNER: true
steps:
- uses: actions/checkout@v2
- name: Build the Docker images
run: docker-compose build
- 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
echo Selected tag ${TARGET_DOCKER_TAG}
# Tag and push passed "k3d-iff.localhost:12345" with release tag
images=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep ":${TARGET_DOCKER_TAG}")
echo I will push the following images: ${images}
for image in $images; do
newimage=$(echo $image | sed -r "s/k3d-iff.localhost:12345/${DOCKER_PREFIX}/g");
newimage=$(echo $image | sed -r "s/k3d-iff.localhost:12345/docker.io/g");
echo I will push image ${image} as ${newimage}
docker tag ${image} ${newimage};
docker push ${newimage};
done
Expand Down

0 comments on commit ce1d0cd

Please sign in to comment.