Skip to content

Commit

Permalink
Move latest tag on Quay using Robot account
Browse files Browse the repository at this point in the history
Signed-off-by: Jose R. Gonzalez <[email protected]>
  • Loading branch information
komish committed Jun 23, 2023
1 parent 1e12bbb commit 555c25d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 144 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,38 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check and link latest image in quay
id: link_image_in_qauy
- name: Wait for image build to complete
# Quay is configured to automatically build our image. This waits
# for it to complete before proceeding successfully.
id: wait_for_image_build
if: ${{ steps.check_version_updated.outputs.updated == 'true'}}
env:
QUAY_AUTH_TOKEN: ${{ secrets.QUAY_AUTH_TOKEN }}
run: |
# Check and link latest image to latest release if needed
ve1/bin/link-images --verifier-version=${{ steps.check_version_in_PR.outputs.PR_version }} --link-tag="latest"
run:
expectedImage=quay.io/redhat-certification/chart-verifier:${{ steps.check_version_in_PR.outputs.PR_version }}
for i in {1..30}; do
s=60
echo "Querying Quay for "${expectedImage}" in ${s} seconds..."
sleep $s
skopeo inspect docker://"${expectedImage}" && echo "Image Found!" && exit 0
done
echo "ERR Image not found in allotted time."
exit 1

- name: Login to Quay as Bot
id: login_as_bot
if: ${{ steps.wait_for_image_build.outcome == 'success'}}
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.QUAY_BOT_USERNAME }}
password: ${{ secrets.QUAY_BOT_TOKEN }}
registry: quay.io/redhat-certification

- name: Update latest tag
if: ${{ steps.login_as_bot.outcome == 'success'}}
id: update_latest_tag
# TODO: When we shift to a push-from-this-repo model (instead of Quay build model)
# we should transition this tag workflow to use the digest of the image built here in CI.
run: |
imageReference=quay.io/redhat-certification/chart-verifier
podman pull ${imageReference}:${{ steps.check_version_in_PR.outputs.PR_version }}
podman tag ${imageReference}:${{ steps.check_version_in_PR.outputs.PR_version }} ${imageReference}:latest
podman push ${imageReference}:latest
1 change: 0 additions & 1 deletion scripts/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ console_scripts =
check-auto-merge = checkautomerge.checkautomerge:main
build-and-test = buildandtest.buildandtest:main
check-user = owners.checkuser:main
link-images = quay.linkimages:main
sa-for-chart-testing = saforcharttesting.saforcharttesting:main
tar-file = release.tarfile_asset:main
Empty file removed scripts/src/quay/__init__.py
Empty file.
136 changes: 0 additions & 136 deletions scripts/src/quay/linkimages.py

This file was deleted.

0 comments on commit 555c25d

Please sign in to comment.