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 ef059cfc..0d672f33 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,14 @@ 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 '.[]' > $@ +# 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') XDR_SHA = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "xdr") | .sha')