mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
build: stamp the version in the stage that ships it
The release workflow has never published. Every run since v1.1.19 built
cleanly and then died on its own smoke gate:
image stamps <unset> but is published as v1.1.23
The gate was right. GIT_TAG and GIT_COMMIT_SHA were declared as ARG/ENV
only in the `builder` stage, and ENV does not cross a stage boundary, so
they reached the compiled bundle and never the runtime image. The footer
resolves at container start, not at build time — make_envs_script.sh
iterates the live process environment into window.__envs and
configs/app/ui.ts reads frontendVersion from there — so with nothing set
in the final stage, every image ever published reported no version.
`crane config ghcr.io/luxfi/explore:v1.1.23` confirms it: no
NEXT_PUBLIC_GIT_TAG in the config at all, and the deployed ConfigMaps do
not supply one either.
Declare both in the runner stage, after the copies so a new commit
invalidates only the ENV layer.
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
+12
@@ -152,6 +152,18 @@ COPY ./configs/envs ./configs/envs
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
# The build stamp has to be declared HERE, in the final stage. ENV does not
|
||||
# cross stage boundaries, so the copies in the builder above reach the compiled
|
||||
# bundle and nothing else, and the footer reads this at container start, not at
|
||||
# build time: make_envs_script.sh iterates the running process environment into
|
||||
# window.__envs, and configs/app/ui.ts serves frontendVersion out of that. Left
|
||||
# to the builder alone, every image ever published reported no version at all.
|
||||
# Last, so a new commit invalidates only this layer and not the copies above.
|
||||
ARG GIT_COMMIT_SHA
|
||||
ENV NEXT_PUBLIC_GIT_COMMIT_SHA=$GIT_COMMIT_SHA
|
||||
ARG GIT_TAG
|
||||
ENV NEXT_PUBLIC_GIT_TAG=$GIT_TAG
|
||||
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
|
||||
USER nextjs
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@luxfi/explore",
|
||||
"version": "1.1.23",
|
||||
"version": "1.1.24",
|
||||
"private": false,
|
||||
"homepage": "https://github.com/luxfi/explore#readme",
|
||||
"engines": {
|
||||
|
||||
Reference in New Issue
Block a user