From ecccaffacd635c384f58ee4f63fa1757a6adb8aa Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 17 Sep 2024 11:14:55 +1000 Subject: [PATCH 1/2] Metadata --- .github/workflows/docker-image.yml | 2 ++ Dockerfile | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index ec8b534..9b046b1 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -50,6 +50,8 @@ jobs: org.opencontainers.image.title=Cmfive org.opencontainers.image.description=Cmfive in a docker image org.opencontainers.image.vendor=2pisoftware + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.version=${{ github.ref }} # Login to GHCR - name: Login to GitHub Container Registry diff --git a/Dockerfile b/Dockerfile index 85051a9..a3b3744 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # ========================================================================== -# ## Cmfive docker image ## +# ## Cosine docker image ## # ========================================================================== -# This image provides a fully working cmfive instance +# This image provides a fully working Cosine instance # It provides the following build arguments: # - CORE_BRANCH: The branch to clone from the cmfive-core repository @@ -29,16 +29,20 @@ RUN apk --no-cache add \ ARG BUILT_IN_CORE_BRANCH=main RUN git clone --depth 1 https://github.com/2pisoftware/cmfive-core.git -b $BUILT_IN_CORE_BRANCH +# Get the repo metadata +RUN cd /cmfive-core && \ + git log -1 --pretty=format:"CORE_HASH=\"%H\"%nCORE_COMMIT_MSG=\"%s\"%nCORE_REF=\"%D\"" > /.core-metadata + # Compile the theme RUN cd /cmfive-core/system/templates/base && \ npm ci && \ npm run production # -------------------------------------------------------------------------- -# == Cmfive stage == +# == Cosine stage == # -------------------------------------------------------------------------- -# This stage builds the final cmfive image +# This stage builds the final Cosine image # Use the Alpine Linux base image FROM alpine:3.19 @@ -125,6 +129,12 @@ COPY --chown=cmfive:cmfive \ /cmfive-core/system/ \ composer/vendor/2pisoftware/cmfive-core/system/ +# Metadata for core +COPY --chown=cmfive:cmfive \ + --from=core \ + /.core-metadata \ + /.core-metadata + # Link system RUN ln -s composer/vendor/2pisoftware/cmfive-core/system/ system From d9570153060822a092bc0a6df94f293f3a15db08 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 17 Sep 2024 11:33:17 +1000 Subject: [PATCH 2/2] Revert field overrides --- .github/workflows/docker-image.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9b046b1..ec8b534 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -50,8 +50,6 @@ jobs: org.opencontainers.image.title=Cmfive org.opencontainers.image.description=Cmfive in a docker image org.opencontainers.image.vendor=2pisoftware - org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.version=${{ github.ref }} # Login to GHCR - name: Login to GitHub Container Registry