From e12827388d9cf39ce2afea8a256004a60c110ebf Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 29 Sep 2026 04:14:01 +0000 Subject: [PATCH 1/2] regenerate .image.json when TAG changes --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index ef059cfc..8f0f0dd9 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,11 @@ IMAGE_JSON=.image.json .image.json: images.json .scripts/images-with-extras < images.json jq '.[] | select(.tag == "$(TAG)") | [ . ]' | .scripts/images-with-extras | jq '.[]' > $@ +# Force .image.json to regenerate when it was generated for a different TAG +ifneq ($(shell jq -r '.tag' $(IMAGE_JSON) 2>/dev/null),$(TAG)) +.PHONY: $(IMAGE_JSON) +endif + # Extract configuration from selected image XDR_REPO = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "xdr") | .repo') XDR_SHA = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "xdr") | .sha') From 82594192260bf20e999bd3af65a32bfb849b1f41 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 29 Sep 2026 04:19:09 +0000 Subject: [PATCH 2/2] track TAG in a stamp file for .image.json --- .gitignore | 1 + Makefile | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 4070854d..e27a6c43 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /.image.json +/.image.tag diff --git a/Makefile b/Makefile index 8f0f0dd9..0d672f33 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,13 @@ TAG?=latest # Process images.json through the images-with-extras script IMAGE_JSON=.image.json -.image.json: images.json .scripts/images-with-extras +.image.json: images.json .scripts/images-with-extras .image.tag < images.json jq '.[] | select(.tag == "$(TAG)") | [ . ]' | .scripts/images-with-extras | jq '.[]' > $@ -# Force .image.json to regenerate when it was generated for a different TAG -ifneq ($(shell jq -r '.tag' $(IMAGE_JSON) 2>/dev/null),$(TAG)) -.PHONY: $(IMAGE_JSON) -endif +# Track TAG as a file so that .image.json regenerates when TAG changes +.image.tag: FORCE + @echo '$(TAG)' | cmp -s - $@ || echo '$(TAG)' > $@ +FORCE: # Extract configuration from selected image XDR_REPO = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "xdr") | .repo')