Skip to content

Commit

Permalink
Check if the release image was created.
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Dec 12, 2023
1 parent f6566b2 commit 2d814a7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
git tag ${{ github.event.inputs.name }}
git push origin ${{ github.event.inputs.name }}
- name: Check if image was build
run: |
outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}

Expand Down
30 changes: 30 additions & 0 deletions scripts/image_exists.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

TIMEOUT=${1:-600}
INTERVAL=${2:-20}
TAG=${3:-latest}
IMAGE=${4:-europe-docker.pkg.dev/kyma-project/prod/nats-manager}

start_time=$(date +%s)
end_time=$((start_time + TIMEOUT))

while true; do
docker manifest inspect $IMAGE:$TAG
# Check the exit status
if [ $? -eq 0 ]; then
echo "Image found."
exit 0
else
echo "Image not found, yet."
fi

current_time=$(date +%s)

# Check if the TIMEOUT has been reached
if [ $current_time -ge $end_time ]; then
echo "TIMEOUT reached. Image was not found in time."
exit 1
fi

sleep $INTERVAL
done

0 comments on commit 2d814a7

Please sign in to comment.