fix(frontend): dynamic year + git commit hash in APP_VERSION
- Footer.svelte: replace hardcoded '2025' with new Date().getFullYear() - build.sh: append git short hash to APP_VERSION for all bundle commands (bundle, bundle:embeddings, bundle:light). Format: '0.5.2+6f029903'. Previously only the tag was passed (e.g. '0.5.2'), and .git was not available in Docker context so vite.config.js fell back to '0.0.0'. Verified: frontend assets contain '0.5.2+6f029903', getFullYear() replaces hardcoded 2025.
This commit is contained in:
21
build.sh
21
build.sh
@@ -217,13 +217,18 @@ bundle_release() {
|
|||||||
local frontend_tag="superset-tools-frontend:${tag}"
|
local frontend_tag="superset-tools-frontend:${tag}"
|
||||||
local agent_tag="superset-tools-agent:${tag}"
|
local agent_tag="superset-tools-agent:${tag}"
|
||||||
|
|
||||||
|
# Git commit hash for APP_VERSION (e.g. "0.5.2+58d06fb2")
|
||||||
|
local git_commit
|
||||||
|
git_commit="$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
|
||||||
|
local app_version="${tag}+${git_commit}"
|
||||||
|
|
||||||
mkdir -p "$DIST_ROOT"
|
mkdir -p "$DIST_ROOT"
|
||||||
|
|
||||||
echo "[bundle] Building backend image ${backend_tag}..."
|
echo "[bundle] Building backend image ${backend_tag}..."
|
||||||
docker build -f docker/backend.Dockerfile -t "${backend_tag}" .
|
docker build -f docker/backend.Dockerfile -t "${backend_tag}" .
|
||||||
|
|
||||||
echo "[bundle] Building frontend image ${frontend_tag}..."
|
echo "[bundle] Building frontend image ${frontend_tag}..."
|
||||||
docker build --build-arg "APP_VERSION=${tag}" -f docker/frontend.Dockerfile -t "${frontend_tag}" .
|
docker build --build-arg "APP_VERSION=${app_version}" -f docker/frontend.Dockerfile -t "${frontend_tag}" .
|
||||||
|
|
||||||
echo "[bundle] Building agent image ${agent_tag}..."
|
echo "[bundle] Building agent image ${agent_tag}..."
|
||||||
docker build -f docker/Dockerfile.agent -t "${agent_tag}" .
|
docker build -f docker/Dockerfile.agent -t "${agent_tag}" .
|
||||||
@@ -403,10 +408,15 @@ bundle_light() {
|
|||||||
local tag="$1"
|
local tag="$1"
|
||||||
local image_tag="superset-tools:${tag}"
|
local image_tag="superset-tools:${tag}"
|
||||||
|
|
||||||
|
# Git commit hash for APP_VERSION (e.g. "0.5.2+58d06fb2")
|
||||||
|
local git_commit
|
||||||
|
git_commit="$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
|
||||||
|
local app_version="${tag}+${git_commit}"
|
||||||
|
|
||||||
mkdir -p "$DIST_ROOT"
|
mkdir -p "$DIST_ROOT"
|
||||||
|
|
||||||
echo "[bundle:light] Building all-in-one image ${image_tag}..."
|
echo "[bundle:light] Building all-in-one image ${image_tag}..."
|
||||||
docker build -f docker/all-in-one.Dockerfile -t "${image_tag}" .
|
docker build --build-arg "APP_VERSION=${app_version}" -f docker/all-in-one.Dockerfile -t "${image_tag}" .
|
||||||
|
|
||||||
echo "[bundle:light] Exporting .tar.xz..."
|
echo "[bundle:light] Exporting .tar.xz..."
|
||||||
docker save "${image_tag}" | xz -T0 -3 > "${DIST_ROOT}/superset-tools.${tag}.tar.xz"
|
docker save "${image_tag}" | xz -T0 -3 > "${DIST_ROOT}/superset-tools.${tag}.tar.xz"
|
||||||
@@ -518,13 +528,18 @@ bundle_embeddings() {
|
|||||||
local frontend_tag="superset-tools-frontend:${tag}-embeddings"
|
local frontend_tag="superset-tools-frontend:${tag}-embeddings"
|
||||||
local agent_tag="superset-tools-agent:${tag}-embeddings"
|
local agent_tag="superset-tools-agent:${tag}-embeddings"
|
||||||
|
|
||||||
|
# Git commit hash for APP_VERSION (e.g. "0.5.2+58d06fb2")
|
||||||
|
local git_commit
|
||||||
|
git_commit="$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
|
||||||
|
local app_version="${tag}+${git_commit}"
|
||||||
|
|
||||||
mkdir -p "$DIST_ROOT"
|
mkdir -p "$DIST_ROOT"
|
||||||
|
|
||||||
echo "[bundle:embeddings] Building backend image ${backend_tag}..."
|
echo "[bundle:embeddings] Building backend image ${backend_tag}..."
|
||||||
docker build -f docker/backend.Dockerfile -t "${backend_tag}" .
|
docker build -f docker/backend.Dockerfile -t "${backend_tag}" .
|
||||||
|
|
||||||
echo "[bundle:embeddings] Building frontend image ${frontend_tag}..."
|
echo "[bundle:embeddings] Building frontend image ${frontend_tag}..."
|
||||||
docker build --build-arg "APP_VERSION=${tag}" -f docker/frontend.Dockerfile -t "${frontend_tag}" .
|
docker build --build-arg "APP_VERSION=${app_version}" -f docker/frontend.Dockerfile -t "${frontend_tag}" .
|
||||||
|
|
||||||
echo "[bundle:embeddings] Building agent image ${agent_tag} (WITH_EMBEDDINGS=true)..."
|
echo "[bundle:embeddings] Building agent image ${agent_tag} (WITH_EMBEDDINGS=true)..."
|
||||||
docker build \
|
docker build \
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<footer class="bg-surface-card border-t p-4 mt-8 text-center text-text-muted text-sm">
|
<footer class="bg-surface-card border-t p-4 mt-8 text-center text-text-muted text-sm">
|
||||||
© 2025 {$t.common.brand} <span class="font-mono">v{__APP_VERSION__}</span>
|
© {new Date().getFullYear()} {$t.common.brand} <span class="font-mono">v{__APP_VERSION__}</span>
|
||||||
</footer>
|
</footer>
|
||||||
<!-- #endregion Footer -->
|
<!-- #endregion Footer -->
|
||||||
|
|||||||
Reference in New Issue
Block a user