mirror of
https://github.com/geoserver/geoserver-cloud.git
synced 2025-12-08 20:16:08 +00:00
Build geoserver apps docker images in parallel
This commit is contained in:
parent
efbe292174
commit
df79d3c103
18
.github/workflows/build-and-push.yaml
vendored
18
.github/workflows/build-and-push.yaml
vendored
@ -71,7 +71,7 @@ jobs:
|
||||
infrastructure-images:
|
||||
needs: base-images
|
||||
if: github.repository == 'geoserver/geoserver-cloud'
|
||||
name: Build and Push Infrastructure Images
|
||||
name: Build infrastructure images
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
@ -118,9 +118,14 @@ jobs:
|
||||
geoserver-images:
|
||||
needs: base-images
|
||||
if: github.repository == 'geoserver/geoserver-cloud'
|
||||
name: Build and Push GeoServer Images
|
||||
name: Build GeoServer image
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# matches app folder names in src/apps/geoserver/* and docker compose service names
|
||||
app: [ 'wms', 'wfs', 'wcs', 'wps', 'gwc', 'restconfig', 'webui' ]
|
||||
steps:
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
@ -151,11 +156,11 @@ jobs:
|
||||
|
||||
- name: Package GeoServer apps
|
||||
run: |
|
||||
make package-geoserver-images
|
||||
./mvnw clean package -DskipTests -T1C -ntp -am -pl src/apps/geoserver/${{ matrix.app }}
|
||||
|
||||
- name: Build and push GeoServer images
|
||||
run: |
|
||||
make build-image-geoserver-multiplatform
|
||||
REPACKAGE=false make build-image-geoserver-multiplatform ${{ matrix.app }}
|
||||
|
||||
- name: Clean up Maven project artifacts
|
||||
run: |
|
||||
@ -188,10 +193,7 @@ jobs:
|
||||
|
||||
- name: Pull all images
|
||||
run: |
|
||||
TAG=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||
for image in config discovery gateway gwc rest wcs webui wfs wms wps; do
|
||||
docker pull geoservercloud/geoserver-cloud-$image:$TAG
|
||||
done
|
||||
make pull-images
|
||||
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@v3.5.0
|
||||
|
||||
34
Makefile
34
Makefile
@ -71,10 +71,13 @@ build-image-infrastructure: package-infrastructure-images
|
||||
COMPOSE_DOCKER_CLI_BUILD=0 DOCKER_BUILDKIT=0 TAG=$(TAG) \
|
||||
docker compose -f docker-build/infrastructure.yml build
|
||||
|
||||
# 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).
|
||||
# Then you can call:
|
||||
# make build-image-geoserver wcs wfs
|
||||
.PHONY: build-image-geoserver
|
||||
build-image-geoserver: package-geoserver-images
|
||||
COMPOSE_DOCKER_CLI_BUILD=0 DOCKER_BUILDKIT=0 TAG=$(TAG) \
|
||||
docker compose -f docker-build/geoserver.yml build
|
||||
docker compose -f docker-build/geoserver.yml build $(filter-out $@ build-image build-image-multiplatform,$(MAKECMDGOALS))
|
||||
|
||||
.PHONY: build-image-multiplatform
|
||||
build-image-multiplatform: build-base-images-multiplatform build-image-infrastructure-multiplatform build-image-geoserver-multiplatform
|
||||
@ -97,15 +100,18 @@ build-image-infrastructure-multiplatform: package-infrastructure-images
|
||||
TAG=$(TAG) \
|
||||
docker compose -f docker-build/infrastructure-multiplatform.yml build --push
|
||||
|
||||
# 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).
|
||||
# Then you can call:
|
||||
# make build-image-geoserver-multiplatform wcs wfs
|
||||
.PHONY: build-image-geoserver-multiplatform
|
||||
build-image-geoserver-multiplatform: package-geoserver-images
|
||||
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 TAG=$(TAG) \
|
||||
docker compose -f docker-build/geoserver-multiplatform.yml build --push
|
||||
docker compose -f docker-build/geoserver-multiplatform.yml build --push $(filter-out $@ build-image build-image-multiplatform,$(MAKECMDGOALS))
|
||||
|
||||
.PHONY: package-base-images
|
||||
package-base-images:
|
||||
ifeq ($(REPACKAGE), true)
|
||||
./mvnw clean package -DskipTests -T1C -nsu -am -pl src/apps/base-images/jre,src/apps/base-images/spring-boot,src/apps/base-images/spring-boot3,src/apps/base-images/geoserver
|
||||
./mvnw clean package -DskipTests -T1C -ntp -am -pl src/apps/base-images/jre,src/apps/base-images/spring-boot,src/apps/base-images/spring-boot3,src/apps/base-images/geoserver
|
||||
else
|
||||
@echo "Not re-packaging base images, assuming the target/*-bin.jar files exist"
|
||||
endif
|
||||
@ -113,7 +119,7 @@ endif
|
||||
.PHONY: package-infrastructure-images
|
||||
package-infrastructure-images:
|
||||
ifeq ($(REPACKAGE), true)
|
||||
./mvnw clean package -DskipTests -T1C -nsu -am -pl src/apps/infrastructure/config,src/apps/infrastructure/discovery,src/apps/infrastructure/gateway
|
||||
./mvnw clean package -DskipTests -T1C -ntp -am -pl src/apps/infrastructure/config,src/apps/infrastructure/discovery,src/apps/infrastructure/gateway
|
||||
else
|
||||
@echo "Not re-packaging infra images, assuming the target/*-bin.jar files exist"
|
||||
endif
|
||||
@ -121,15 +127,24 @@ endif
|
||||
.PHONY: package-geoserver-images
|
||||
package-geoserver-images:
|
||||
ifeq ($(REPACKAGE), true)
|
||||
./mvnw clean package -DskipTests -T1C -nsu -am -pl src/apps/geoserver/gwc,src/apps/geoserver/restconfig,src/apps/geoserver/wcs,src/apps/geoserver/webui,src/apps/geoserver/wfs,src/apps/geoserver/wms,src/apps/geoserver/wcs,src/apps/geoserver/wps
|
||||
./mvnw clean package -DskipTests -T1C -ntp -am -pl src/apps/geoserver/gwc,src/apps/geoserver/restconfig,src/apps/geoserver/wcs,src/apps/geoserver/webui,src/apps/geoserver/wfs,src/apps/geoserver/wms,src/apps/geoserver/wcs,src/apps/geoserver/wps
|
||||
else
|
||||
@echo "Not re-packaging geoserver images, assuming the target/*-bin.jar files exist"
|
||||
endif
|
||||
|
||||
.PHONY: pull-images
|
||||
pull-images:
|
||||
TAG=$$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) \
|
||||
docker compose \
|
||||
-f docker-build/geoserver-multiplatform.yml \
|
||||
-f docker-build/infrastructure-multiplatform.yml \
|
||||
pull --quiet
|
||||
|
||||
.PHONY: sign-image
|
||||
sign-image:
|
||||
@bash -c '\
|
||||
images=$$(docker images --format "{{.Repository}}@{{.Digest}}" | grep "geoserver-cloud-"); \
|
||||
TAG=$$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout); \
|
||||
images=$$(TAG=$$TAG docker compose -f docker-build/geoserver-multiplatform.yml -f docker-build/infrastructure-multiplatform.yml config --images); \
|
||||
for image in $$images; do \
|
||||
echo "Signing $$image"; \
|
||||
output=$$(cosign sign --yes --key env://COSIGN_KEY --recursive $$image 2>&1); \
|
||||
@ -144,7 +159,8 @@ sign-image:
|
||||
.PHONY: verify-image
|
||||
verify-image:
|
||||
@bash -c '\
|
||||
images=$$(docker images --format "{{.Repository}}@{{.Digest}}" | grep "geoserver-cloud-"); \
|
||||
TAG=$$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout); \
|
||||
images=$$(TAG=$$TAG docker compose -f docker-build/geoserver-multiplatform.yml -f docker-build/infrastructure-multiplatform.yml config --images); \
|
||||
for image in $$images; do \
|
||||
echo "Verifying $$image"; \
|
||||
output=$$(cosign verify --key env://COSIGN_PUB_KEY $$image 2>&1); \
|
||||
@ -204,3 +220,7 @@ run-acceptance-tests-jdbcconfig:
|
||||
.PHONY: clean-acceptance-tests-jdbcconfig
|
||||
clean-acceptance-tests-jdbcconfig:
|
||||
(cd compose/ && ./acceptance_jdbcconfig down -v)
|
||||
|
||||
# Prevent make from treating service names as targets when using $(MAKECMDGOALS) in build-image-geoserver/build-image-geoserver-multiplatform
|
||||
%:
|
||||
@:
|
||||
|
||||
@ -19,7 +19,7 @@ services:
|
||||
condition: service_healthy
|
||||
gwc:
|
||||
condition: service_healthy
|
||||
rest:
|
||||
restconfig:
|
||||
condition: service_healthy
|
||||
#webui:
|
||||
# condition: service_started
|
||||
@ -89,7 +89,7 @@ services:
|
||||
memory: 512M
|
||||
healthcheck:
|
||||
retries: 20
|
||||
rest:
|
||||
restconfig:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
||||
@ -53,7 +53,7 @@ services:
|
||||
volumes: *geoserver_volumes
|
||||
depends_on: *gs-dependencies
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
environment: *geoserver_environment
|
||||
volumes: *geoserver_volumes
|
||||
depends_on: *gs-dependencies
|
||||
|
||||
@ -54,7 +54,7 @@ services:
|
||||
volumes: *geoserver_volumes
|
||||
depends_on: *gs-dependencies
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
environment: *geoserver_environment
|
||||
volumes: *geoserver_volumes
|
||||
depends_on: *gs-dependencies
|
||||
|
||||
@ -24,7 +24,7 @@ services:
|
||||
environment: *geoserver_environment
|
||||
depends_on: *gs-dependencies
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
environment: *geoserver_environment
|
||||
depends_on: *gs-dependencies
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ services:
|
||||
cpus: '4.0'
|
||||
memory: 2G
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
extends:
|
||||
file: templates.yml
|
||||
service: gstemplate
|
||||
|
||||
@ -20,7 +20,7 @@ services:
|
||||
wcs:
|
||||
ports:
|
||||
- 9103:8080
|
||||
rest:
|
||||
restconfig:
|
||||
ports:
|
||||
- 9105:8080
|
||||
webui:
|
||||
|
||||
@ -80,7 +80,7 @@ services:
|
||||
condition: service_healthy
|
||||
required: true
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
environment:
|
||||
SPRING_PROFILES_INCLUDE: "standalone"
|
||||
depends_on:
|
||||
|
||||
2
config
2
config
@ -1 +1 @@
|
||||
Subproject commit b8089b73e94341c90ea8da28e08461bbd7e762e6
|
||||
Subproject commit 352ebfb33250903dc55b4961c614d17dac2e8110
|
||||
@ -31,7 +31,7 @@ services:
|
||||
build:
|
||||
context: ../src/apps/geoserver/wps/
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
extends:
|
||||
file: templates.yml
|
||||
service: multi-platform
|
||||
@ -55,4 +55,4 @@ services:
|
||||
build:
|
||||
context: ../src/apps/geoserver/gwc/
|
||||
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ services:
|
||||
build:
|
||||
context: ../src/apps/geoserver/wps/
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
extends:
|
||||
file: templates.yml
|
||||
service: current-platform
|
||||
@ -55,4 +55,4 @@ services:
|
||||
build:
|
||||
context: ../src/apps/geoserver/gwc/
|
||||
|
||||
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
image: geoservercloud/geoserver-cloud-rest:2.27.2.0
|
||||
extends:
|
||||
service: geoserver_template
|
||||
|
||||
@ -157,7 +157,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
image: geoservercloud/geoserver-cloud-rest:2.27.2.0
|
||||
extends:
|
||||
service: geoserver_template
|
||||
|
||||
@ -262,7 +262,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
|
||||
rest:
|
||||
restconfig:
|
||||
image: geoservercloud/geoserver-cloud-rest:2.27.2.0
|
||||
extends:
|
||||
service: geoserver_template
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user