mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 14:02:56 +09:00
PR #2711 switched PR builds to push only :pr-<N>-<sha> tags (PUBLISH_FLOATING=0) to stop concurrent-push 409 conflicts, but left --cache-from pointing at $(REGISTRY)/<img>:latest. PR builds set REGISTRY to the per-CI registry (iad.ocir.io) and never publish :latest there, so every PR build's registry cache lookup 404s and rebuilds cold. Add a CACHE_REGISTRY knob (default ghcr.io/cozystack/cozystack, where release builds do publish :latest) and point every --cache-from at it. Push targets ($(REGISTRY)) and the unique per-PR tags are unchanged, so the #2711 anti-conflict behaviour is preserved while PR builds regain a warm cache from the last release. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
40 lines
1.2 KiB
Makefile
40 lines
1.2 KiB
Makefile
NAME=cozystack-platform
|
|
NAMESPACE=cozy-system
|
|
|
|
include ../../../hack/common-envs.mk
|
|
|
|
test:
|
|
helm unittest .
|
|
|
|
show:
|
|
cozyhr show --namespace $(NAMESPACE) $(NAME)
|
|
|
|
apply:
|
|
cozyhr apply --namespace $(NAMESPACE) $(NAME)
|
|
|
|
reconcile: apply
|
|
|
|
diff:
|
|
cozyhr diff --namespace $(NAMESPACE) $(NAME)
|
|
|
|
# Strip the platform.cozystack.io/no-delete label from every guarded object so
|
|
# `helm uninstall cozy-platform` (and ad-hoc deletes of protected resources)
|
|
# is no longer denied by the deletion-protection VAP. After this runs, the
|
|
# cluster has no guardrail until the next `helm upgrade` re-stamps the label.
|
|
# Intended for teardown / disaster-recovery, not routine use.
|
|
unprotect:
|
|
hack/unprotect.sh
|
|
|
|
image: image-migrations
|
|
|
|
image-migrations:
|
|
docker buildx build images/migrations \
|
|
$(call image-tags,platform-migrations,v$(COZYSTACK_VERSION)) \
|
|
--cache-from type=registry,ref=$(CACHE_REGISTRY)/platform-migrations:latest \
|
|
--cache-to type=inline \
|
|
--metadata-file images/migrations.json \
|
|
$(BUILDX_ARGS)
|
|
IMAGE="$(REGISTRY)/platform-migrations:$(IMAGE_TAG)@$$(yq -e -o json -r '.["containerimage.digest"]' images/migrations.json)" \
|
|
yq --inplace '.migrations.image = strenv(IMAGE)' values.yaml
|
|
rm -f images/migrations.json
|