Skip to content

Commit

Permalink
Merge pull request #1733 from SaschaSchwarze0/sascha-update-buildkit
Browse files Browse the repository at this point in the history
Add automation to trigger automatic updates of the BuildKit image in our sample build strategies
  • Loading branch information
openshift-merge-bot[bot] authored Dec 5, 2024
2 parents 0e93da8 + 87a9d93 commit 5d37d9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 5d37d9b

Please sign in to comment.