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>
24 lines
846 B
Makefile
24 lines
846 B
Makefile
NAME=lineage-controller-webhook
|
|
NAMESPACE=cozy-system
|
|
|
|
include ../../../hack/common-envs.mk
|
|
include ../../../hack/package.mk
|
|
|
|
.PHONY: test
|
|
|
|
image: image-lineage-controller-webhook
|
|
|
|
test:
|
|
helm unittest .
|
|
|
|
image-lineage-controller-webhook:
|
|
docker buildx build -f images/lineage-controller-webhook/Dockerfile ../../.. \
|
|
$(call image-tags,lineage-controller-webhook,v$(COZYSTACK_VERSION)) \
|
|
--cache-from type=registry,ref=$(CACHE_REGISTRY)/lineage-controller-webhook:latest \
|
|
--cache-to type=inline \
|
|
--metadata-file images/lineage-controller-webhook.json \
|
|
$(BUILDX_ARGS)
|
|
IMAGE="$(REGISTRY)/lineage-controller-webhook:$(IMAGE_TAG)@$$(yq e '."containerimage.digest"' images/lineage-controller-webhook.json -o json -r)" \
|
|
yq -i '.lineageControllerWebhook.image = strenv(IMAGE)' values.yaml
|
|
rm -f images/lineage-controller-webhook.json
|