Sentry.io integration. Vince integration. Region-scoped consent (denied-by-default in EU/EEA/UK/CH, granted elsewhere, DPDP-friendly notice)
31 lines
1.2 KiB
Makefile
31 lines
1.2 KiB
Makefile
COMMIT ?= $(shell git rev-parse --short HEAD)
|
|
|
|
# Analytics ids baked into the client bundle — read from the local .env
|
|
# (gitignored) and passed to docker build. Empty values disable the tool.
|
|
VITE_ENV_KEYS := VITE_GA4_MEASUREMENT_ID VITE_PLAUSIBLE_DOMAIN VITE_SENTRY_DSN
|
|
BUILD_ARGS := $(shell for k in VITE_GA4_MEASUREMENT_ID VITE_PLAUSIBLE_DOMAIN VITE_SENTRY_DSN; do \
|
|
v=$$(grep -E "^$$k=" .env 2>/dev/null | head -1 | cut -d= -f2-); \
|
|
[ -n "$$v" ] && printf -- '--build-arg %s=%s ' "$$k" "$$v"; \
|
|
done; true)
|
|
BUILD_ARGS += --build-arg VITE_SENTRY_RELEASE=$(COMMIT) --build-arg SENTRY_RELEASE=$(COMMIT)
|
|
|
|
.PHONY: build-production
|
|
build-production: ## Multi-arch build from HEAD; tags registry.tanshu.com/mozimo:<commit> + :main
|
|
@git archive --format=tar HEAD | docker buildx build \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag registry.tanshu.com/mozimo:$(COMMIT) \
|
|
--tag registry.tanshu.com/mozimo:main \
|
|
$(BUILD_ARGS) \
|
|
--push \
|
|
-
|
|
|
|
.PHONY: build-check
|
|
build-check: ## Multi-arch compile check from HEAD, nothing pushed
|
|
@git archive --format=tar HEAD | docker buildx build \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag mozimo:check \
|
|
--pull \
|
|
$(BUILD_ARGS) \
|
|
--progress=plain \
|
|
-
|