feat: show dev-<sha> version string in nav for dev builds
Production images continue to display the semver (v1.x.x). Dev images built by CI now receive BUILD_VERSION=dev-<7-char-sha> via a Docker ARG, and app.js skips the v prefix for non-semver strings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,8 +7,13 @@ COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY . .
|
||||
RUN awk -F'"' '/"version"/{printf "const VERSION = \"%s\";\n", $4; exit}' \
|
||||
package.json > js/version.js
|
||||
ARG BUILD_VERSION=""
|
||||
RUN if [ -n "$BUILD_VERSION" ]; then \
|
||||
printf 'const VERSION = "%s";\n' "$BUILD_VERSION" > js/version.js; \
|
||||
else \
|
||||
awk -F'"' '/"version"/{printf "const VERSION = \"%s\";\n", $4; exit}' \
|
||||
package.json > js/version.js; \
|
||||
fi
|
||||
|
||||
RUN mkdir -p /app/data && chown -R app:app /app
|
||||
USER app
|
||||
|
||||
Reference in New Issue
Block a user