Files
warpbox-dev/scripts/run/dev.sh
Daniel Legt 42449b3322
All checks were successful
Build and Publish Docker Image / deploy (push) Successful in 1m38s
feat: add application versioning support to backend and UI
- Introduce APP_VERSION build argument and environment variable in Dockerfile.
- Load AppVersion from environment variables in the configuration loader.
- Pass the application version to the HTML renderer and expose it to templates via PageData.
- Update tests to verify the version is correctly rendered in the footer.
2026-05-31 20:21:37 +03:00

28 lines
631 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
ENV_FILE="${ROOT_DIR}/scripts/env/dev.env"
if [[ ! -f "${ENV_FILE}" ]]; then
echo "Missing ${ENV_FILE}. Create it from scripts/env/dev.env.example." >&2
exit 1
fi
set -a
source "${ENV_FILE}"
set +a
if [[ -z "${APP_VERSION:-}" ]]; then
APP_VERSION="$(git -C "${ROOT_DIR}" describe --tags --abbrev=0 2>/dev/null || printf 'dev')"
export APP_VERSION
fi
if [[ "${WARPBOX_DATA_DIR:-}" != /* ]]; then
export WARPBOX_DATA_DIR="${ROOT_DIR}/${WARPBOX_DATA_DIR:-data}"
fi
cd "${ROOT_DIR}/backend"
exec go run ./cmd/warpbox