Skip to content

Commit

Permalink
Add automation to trigger automatic updates of the BuildKit image in …
Browse files Browse the repository at this point in the history
…our sample build strategies

Signed-off-by: Sascha Schwarze <[email protected]>
  • Loading branch information
SaschaSchwarze0 committed Nov 16, 2024
1 parent 64cfbe5 commit 87a9d93
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 87a9d93

Please sign in to comment.