]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Chore: display docker tag in UI for ci test builds (#7083)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Thu, 27 Jun 2024 03:02:52 +0000 (20:02 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2024 03:02:52 +0000 (03:02 +0000)
.github/workflows/ci.yml
Dockerfile

index 15fcc24b34817068ce31933bff17609d0e2ab8d9..baea9eff24704778d6b70834d8b42035e12ede48 100644 (file)
@@ -406,6 +406,8 @@ jobs:
           push: ${{ github.event_name != 'pull_request' }}
           tags: ${{ steps.docker-meta.outputs.tags }}
           labels: ${{ steps.docker-meta.outputs.labels }}
+          build-args: |
+            PNGX_TAG_VERSION=${{ steps.docker-meta.outputs.version }}
           # Get cache layers from this branch, then dev
           # This allows new branches to get at least some cache benefits, generally from dev
           cache-from: |
index bb32a9817b7bc30febbf58f04402fb55ff1b9406..a0120cdd40b16a4d5091dd906177326cb174d4f9 100644 (file)
@@ -13,6 +13,16 @@ WORKDIR /src/src-ui
 RUN set -eux \
   && npm update npm -g \
   && npm ci
+
+ARG PNGX_TAG_VERSION=
+# Add the tag to the environment file if its a tagged dev build
+RUN set -eux && \
+case "${PNGX_TAG_VERSION}" in \
+  dev|fix*|feature*) \
+    sed -i -E "s/version: '([0-9\.]+)'/version: '\1 #${PNGX_TAG_VERSION}'/g" /src/src-ui/src/environments/environment.prod.ts \
+    ;; \
+esac
+
 RUN set -eux \
   && ./node_modules/.bin/ng build --configuration production