@@ -71,10 +71,13 @@ build-image-infrastructure: package-infrastructure-images
7171 COMPOSE_DOCKER_CLI_BUILD=0 DOCKER_BUILDKIT=0 TAG=$(TAG ) \
7272 docker compose -f docker-build/infrastructure.yml build
7373
74+ # This uses $(MAKECMDGOALS) (all targets specified) and filters out the target itself ($@), passing the rest as arguments. The %: rule tells make to ignore any unrecognized "targets" (which are actually your service names).
75+ # Then you can call:
76+ # make build-image-geoserver wcs wfs
7477.PHONY : build-image-geoserver
7578build-image-geoserver : package-geoserver-images
7679 COMPOSE_DOCKER_CLI_BUILD=0 DOCKER_BUILDKIT=0 TAG=$(TAG ) \
77- docker compose -f docker-build/geoserver.yml build
80+ docker compose -f docker-build/geoserver.yml build $( filter-out $@ build-image build-image-multiplatform, $( MAKECMDGOALS ) )
7881
7982.PHONY : build-image-multiplatform
8083build-image-multiplatform : build-base-images-multiplatform build-image-infrastructure-multiplatform build-image-geoserver-multiplatform
@@ -97,10 +100,13 @@ build-image-infrastructure-multiplatform: package-infrastructure-images
97100 TAG=$(TAG ) \
98101 docker compose -f docker-build/infrastructure-multiplatform.yml build --push
99102
103+ # This uses $(MAKECMDGOALS) (all targets specified) and filters out the target itself ($@), passing the rest as arguments. The %: rule tells make to ignore any unrecognized "targets" (which are actually your service names).
104+ # Then you can call:
105+ # make build-image-geoserver-multiplatform wcs wfs
100106.PHONY : build-image-geoserver-multiplatform
101107build-image-geoserver-multiplatform : package-geoserver-images
102108 COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 TAG=$(TAG ) \
103- docker compose -f docker-build/geoserver-multiplatform.yml build --push
109+ docker compose -f docker-build/geoserver-multiplatform.yml build --push $( filter-out $@ build-image build-image-multiplatform, $( MAKECMDGOALS ) )
104110
105111.PHONY : package-base-images
106112package-base-images :
@@ -126,10 +132,19 @@ else
126132 @echo "Not re-packaging geoserver images, assuming the target/*-bin.jar files exist"
127133endif
128134
135+ .PHONY : pull-images
136+ pull-images :
137+ TAG=$$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout ) \
138+ docker compose \
139+ -f docker-build/geoserver-multiplatform.yml \
140+ -f docker-build/infrastructure-multiplatform.yml \
141+ pull --quiet
142+
129143.PHONY : sign-image
130144sign-image :
131145 @bash -c ' \
132- images=$$(docker images --format "{{.Repository}}@{{.Digest}}" | grep "geoserver-cloud-" ) ; \
146+ TAG=$$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout ) ; \
147+ images=$$(TAG=$$TAG docker compose -f docker-build/geoserver-multiplatform.yml -f docker-build/infrastructure-multiplatform.yml config --images ) ; \
133148 for image in $$ images; do \
134149 echo " Signing $$ image" ; \
135150 output=$$(cosign sign --yes --key env://COSIGN_KEY --recursive $$image 2>&1 ) ; \
@@ -144,7 +159,8 @@ sign-image:
144159.PHONY : verify-image
145160verify-image :
146161 @bash -c ' \
147- images=$$(docker images --format "{{.Repository}}@{{.Digest}}" | grep "geoserver-cloud-" ) ; \
162+ TAG=$$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout ) ; \
163+ images=$$(TAG=$$TAG docker compose -f docker-build/geoserver-multiplatform.yml -f docker-build/infrastructure-multiplatform.yml config --images ) ; \
148164 for image in $$ images; do \
149165 echo " Verifying $$ image" ; \
150166 output=$$(cosign verify --key env://COSIGN_PUB_KEY $$image 2>&1 ) ; \
@@ -204,3 +220,7 @@ run-acceptance-tests-jdbcconfig:
204220.PHONY : clean-acceptance-tests-jdbcconfig
205221clean-acceptance-tests-jdbcconfig :
206222 (cd compose/ && ./acceptance_jdbcconfig down -v)
223+
224+ # Prevent make from treating service names as targets when using $(MAKECMDGOALS) in build-image-geoserver/build-image-geoserver-multiplatform
225+ % :
226+ @:
0 commit comments