Skip to content

Commit

Permalink
update ci func to use quay API
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb committed Jan 16, 2025
1 parent 4523a87 commit d1e6d86
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ci/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,21 @@ function run_build_image_stage() {

function wait_for_image() {
echo "Waiting for initial image build..."
sleep 180
sleep 0

local len=$(curl -k -XGET "https://quay.io/api/v1/repository/redhat-user-workloads/cost-mgmt-dev-tenant/koku/tag?filter_tag_name=like:${IMAGE_TAG}" -Ls | jq '.tags | length')

local count=0
local max=60 # Try for up to 30 minutes
until podman image search --limit 1000 --list-tags "${IMAGE}" | grep -q "${IMAGE_TAG}"; do
until [[ $len -gt 0 ]]; do
echo "${count}: Checking for image ${IMAGE}:${IMAGE_TAG}..."
sleep 30
((count+=1))
if [[ $count -gt $max ]]; then
echo "Failed to pull image"
exit 1
fi
len=$(curl -k -XGET "https://quay.io/api/v1/repository/redhat-user-workloads/cost-mgmt-dev-tenant/koku/tag?filter_tag_name=like:${IMAGE_TAG}" -Ls | jq '.tags | length')
done
}

Expand Down

0 comments on commit d1e6d86

Please sign in to comment.