Skip to content
Closed
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
18 changes: 18 additions & 0 deletions .github/workflows/publish-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ jobs:
egress-policy: audit

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Verify container image exists
run: |
VERSION=${GITHUB_REF#refs/tags/}
ORG_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f1)
IMAGE="ghcr.io/${ORG_NAME}/ratify-gatekeeper-provider:${VERSION}"
Comment on lines +21 to +25
echo "Checking if image exists: ${IMAGE}"
MAX_RETRIES=30
RETRY_INTERVAL=60
for i in $(seq 1 $MAX_RETRIES); do
if docker buildx imagetools inspect "${IMAGE}" > /dev/null 2>&1; then
echo "Image ${IMAGE} found!"
exit 0
fi
echo "Attempt ${i}/${MAX_RETRIES}: Image not found yet, retrying in ${RETRY_INTERVAL}s..."
sleep $RETRY_INTERVAL
done
echo "ERROR: Image ${IMAGE} not found after ${MAX_RETRIES} attempts"
exit 1
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
with:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/publish-dev-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,33 @@ jobs:
sed -i '/^ repository:/c\ repository: ghcr.io/ratify-project/ratify-dev' charts/ratify/values.yaml
sed -i '/^ crdRepository:/c\ crdRepository: ghcr.io/ratify-project/ratify-crds-dev' charts/ratify/values.yaml
sed -i '/^ tag:/c\ tag: ${{ steps.prepare.outputs.version }}' charts/ratify/values.yaml
- name: Verify container images exist
run: |
IMAGES=(
"${{ steps.prepare.outputs.crdref }}:${{ steps.prepare.outputs.version }}"
"${{ steps.prepare.outputs.baseref }}:${{ steps.prepare.outputs.version }}"
"${{ steps.prepare.outputs.ref }}:${{ steps.prepare.outputs.version }}"
)
MAX_ATTEMPTS=5
BASE_SLEEP_SECONDS=5
for IMAGE in "${IMAGES[@]}"; do
echo "Checking if image exists: ${IMAGE}"
for ATTEMPT in $(seq 1 "${MAX_ATTEMPTS}"); do
if docker buildx imagetools inspect "${IMAGE}" > /dev/null 2>&1; then
echo "Image ${IMAGE} found!"
break
fi

if [ "${ATTEMPT}" -eq "${MAX_ATTEMPTS}" ]; then
echo "ERROR: Image ${IMAGE} not found after ${MAX_ATTEMPTS} attempts!"
exit 1
fi

SLEEP_SECONDS=$((BASE_SLEEP_SECONDS * ATTEMPT))
echo "Image ${IMAGE} not available yet (attempt ${ATTEMPT}/${MAX_ATTEMPTS}); retrying in ${SLEEP_SECONDS}s..."
sleep "${SLEEP_SECONDS}"
done
done
- name: helm package
run: |
helm package ./charts/ratify --version ${{ steps.prepare.outputs.semversion }}
Expand Down
Loading