From ec21f6dcc17920830dbd07142aea0776933f9c93 Mon Sep 17 00:00:00 2001 From: Giacomo Debidda Date: Thu, 10 Oct 2024 15:07:04 +0200 Subject: [PATCH] set latest container image tag on every push --- .github/workflows/ci-cd.yaml | 2 ++ bb.edn | 13 +++++++------ docs/release-body.md | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 804df80..25d8e09 100755 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -184,6 +184,8 @@ jobs: uses: docker/metadata-action@v5.5.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=true annotations: | annotation[linux/amd64].org.opencontainers.image.revision=${{ github.sha }} annotation.org.opencontainers.image.revision=${{ github.sha }} diff --git a/bb.edn b/bb.edn index 8f0d38b..c53ad23 100644 --- a/bb.edn +++ b/bb.edn @@ -19,7 +19,9 @@ (def app-version (:version project)) (def jar (format "target/%s-%s.jar" app-name (:version project))) (def registry-namespace "jackdbd") - (def image-tag (format "ghcr.io/%s/%s:%s" registry-namespace app-name app-version))) + (def image-tag (format "ghcr.io/%s/%s:%s" registry-namespace app-name app-version)) + (def remote-image-version "latest") + (def remote-image-tag (format "ghcr.io/%s/%s:%s" registry-namespace app-name remote-image-version))) build:bb-uber {:doc "Build Babashka uberjar (see: https://book.babashka.org/#_uberjar)" @@ -119,14 +121,13 @@ (shell cmd))} container:dive - {:doc "Inspect the container image layers with dive" + {:doc "Inspect layers of a local container image (with dive)" ;; :depends [container:build] :task (shell (format "dive %s" image-tag))} container:inspect - {:doc "Inspect container image layers with skopeo" - ;; :depends [container:build] - :task (shell (format "skopeo inspect docker://%s" image-tag))} + {:doc "Inspect a container image hosted on Container Registry (with skopeo)" + :task (shell (format "skopeo inspect docker://%s" remote-image-tag))} container:push {:doc "Push container image to GitHub Container Registry" @@ -141,7 +142,7 @@ :task (shell (format "trivy image --severity MEDIUM,HIGH,CRITICAL -f table %s" image-tag))} container:tags - {:doc "List all tags for the container image with skopeo" + {:doc "List all available tags for a container image hosted on Container Registry (with skopeo)" :task (shell (format "skopeo list-tags docker://ghcr.io/%s/%s" registry-namespace app-name))} -graph:gen diff --git a/docs/release-body.md b/docs/release-body.md index 3103201..8a1b025 100644 --- a/docs/release-body.md +++ b/docs/release-body.md @@ -21,7 +21,7 @@ java -jar fosdem-dl-0.1.0-RC.1-standalone.jar Visit [this page](https://github.com/jackdbd/fosdem-dl/pkgs/container/fosdem-dl) to see the list of container images, then pull the one you want. For example: ```sh -docker pull ghcr.io/jackdbd/fosdem-dl:0.1.0-rc.1 +docker pull ghcr.io/jackdbd/fosdem-dl:latest ``` ## Binary [TODO]