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+58d06fb2'.
  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+58d06fb2', getFullYear() replaces
hardcoded 2025.
This commit is contained in:
2026-07-07 12:29:46 +03:00
parent 58d06fb287
commit 7c4843987b
2 changed files with 19 additions and 4 deletions

View File

@@ -217,13 +217,18 @@ bundle_release() {
local frontend_tag="superset-tools-frontend:${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"
echo "[bundle] Building backend image ${backend_tag}..."
docker build -f docker/backend.Dockerfile -t "${backend_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}..."
docker build -f docker/Dockerfile.agent -t "${agent_tag}" .
@@ -403,10 +408,15 @@ bundle_light() {
local tag="$1"
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"
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..."
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 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"
echo "[bundle:embeddings] Building backend image ${backend_tag}..."
docker build -f docker/backend.Dockerfile -t "${backend_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)..."
docker build \

View File

@@ -9,6 +9,6 @@
</script>
<footer class="bg-surface-card border-t p-4 mt-8 text-center text-text-muted text-sm">
&copy; 2025 {$t.common.brand} <span class="font-mono">v{__APP_VERSION__}</span>
&copy; {new Date().getFullYear()} {$t.common.brand} <span class="font-mono">v{__APP_VERSION__}</span>
</footer>
<!-- #endregion Footer -->