Skip to content

Commit

Permalink
ci: fix watch-dependencies workflow to bump docker image tags
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Apr 26, 2023
1 parent 91cf9f8 commit b5aa67b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/watch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ jobs:
matrix:
include:
- name: docker
registry: registry.hub.docker.com
registry: docker.io
repository: library/docker
values_path: dind.daemonset.image.tag
tag_prefix: ""
tag_suffix: -dind
- name: podman
registry: quay.io
repository: podman/stable
values_path: pink.daemonset.image.tag
tag_prefix: v
tag_suffix: ""

# FIXME: After docker-image-cleaner 1.0.0 is released, we can enable
# this. So far, there isn't any available stable release, and
Expand All @@ -55,15 +59,14 @@ jobs:
- name: Get latest tag of ${{ matrix.registry }}/${{ matrix.repository }}
id: latest
# The skopeo image helps us list tags consistently from different docker
# registries. We use jq to filter out tags of the x.y or x.y.z format
# with the optional v prefix or version_startswith filter, and then sort
# based on the numerical x, y, and z values. Finally, we pick the last
# value in the list.
#
# registries. We identify the latest docker image tag based on the
# version numbers of format x.y.z included in a pattern with an optional
# prefix and suffix, like the tags "v4.5.0" (v prefix) and "23.0.4-dind"
# (-dind suffix).
run: |
latest_tag=$(
docker run --rm quay.io/skopeo/stable list-tags docker://${{ matrix.registry }}/${{ matrix.repository }} \
| jq -r '[.Tags[] | select(. | match("^v?\\d+\\.\\d+\\.\\d+$") | .string)] | sort_by(split(".") | map(ltrimstr("v") | tonumber)) | last'
| jq -r '[.Tags[] | select(. | match("^${{ matrix.tag_prefix }}\\d+\\.\\d+\\.\\d+${{ matrix.tag_suffix }}$") | .string)] | sort_by(split(".") | map(ltrimstr("${{ matrix.tag_prefix }}") | rtrimstr("${{ matrix.tag_suffix }}") | tonumber)) | last'
)
echo "tag=$latest_tag" >> $GITHUB_OUTPUT
Expand Down
8 changes: 4 additions & 4 deletions helm-chart/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ dind:
initContainers: []
daemonset:
image:
name: docker
tag: 20.10.12-dind
name: docker.io/library/docker
tag: "20.10.12-dind" # ref: https://hub.docker.com/_/docker/tags
pullPolicy: ""
pullSecrets: []
# Additional command line arguments to pass to dockerd
Expand All @@ -292,7 +292,7 @@ pink:
daemonset:
image:
name: quay.io/podman/stable
tag: v4.3.1
tag: "v4.3.1" # ref: https://quay.io/repository/podman/stable
pullPolicy: ""
pullSecrets: []
lifecycle: {}
Expand All @@ -306,7 +306,7 @@ imageCleaner:
enabled: true
image:
name: quay.io/jupyterhub/docker-image-cleaner
tag: 1.0.0-beta.3
tag: "1.0.0-beta.3"
pullPolicy: ""
pullSecrets: []
# delete an image at most every 5 seconds
Expand Down

0 comments on commit b5aa67b

Please sign in to comment.