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

Add automation to trigger automatic updates of the BuildKit image in our sample build strategies #1733

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
2 changes: 2 additions & 0 deletions .github/workflows/check-latest-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
include:
- image: gcr.io/kaniko-project/executor
latest-release-url: https://api.github.com/repos/GoogleContainerTools/kaniko/releases/latest
- image: moby/buildkit
latest-release-url: https://api.github.com/repos/moby/buildkit/releases/latest
- image: quay.io/containers/buildah
latest-release-url: https://quay.io/api/v1/repository/containers/buildah/tag/
steps:
Expand Down
6 changes: 5 additions & 1 deletion hack/check-latest-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function update() {
echo "[INFO] Processing directory ${DIRECTORY}"

# Search the image URL recursively and parse the current image tag
CURRENT_TAG="$( (grep --no-filename --recursive "${IMAGE}:" "${DIRECTORY}" || true) | head --lines=1 | sed -E "s#.*${IMAGE}:([v\.0-9]*).*?#\1#")"
CURRENT_TAG="$( (grep --no-filename --recursive "${IMAGE}:" "${DIRECTORY}" || true) | head --lines=1 | sed -E "s#.*${IMAGE}:([v\.0-9]*(-rootless)?).*?#\1#")"
if [ "${CURRENT_TAG}" == "" ]; then
echo "[INFO] No image reference found"
return
Expand All @@ -50,6 +50,10 @@ function update() {
fi
LATEST_TAG="$(curl --silent --retry 3 "${LATEST_RELEASE_URL}" | jq --raw-output "${QUERY}")"

if [[ ${IMAGE} == *buildkit* ]]; then
LATEST_TAG="${LATEST_TAG}-rootless"
fi

echo "[INFO] Determined latest tag ${LATEST_TAG}"

# Search and modify the image tag with the latest
Expand Down