From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 27 Jun 2024 03:02:52 +0000 (-0700) Subject: Chore: display docker tag in UI for ci test builds (#7083) X-Git-Tag: v2.11.0~1^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b1498cc6d35e63f0b6d90b16adf6494a0df1a1d;p=thirdparty%2Fpaperless-ngx.git Chore: display docker tag in UI for ci test builds (#7083) --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15fcc24b34..baea9eff24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/Dockerfile b/Dockerfile index bb32a9817b..a0120cdd40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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