Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move latest tag on Quay using Robot account #361

Merged
merged 1 commit into from
Jun 23, 2023
Merged
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
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.