Skip to content

Commit

Permalink
Use a patched ogccite/ets-ogcapi-features10 Docker image with additio…
Browse files Browse the repository at this point in the history
…nal fixes

Use a patched version of `ogccite/ets-ogcapi-features10:1.8-SNAPSHOT-teamengine-5.4.1`.

Currently, we require the following pull request to be applied:
[Fix global crs codes lookup in discovery collections crs tests](opengeospatial/ets-ogcapi-features10#255)
to the test suite.

This may happen again, hence we're introducing a build step to generate
the required `ogccite/ets-ogcapi-features10` image out of the
`geoserver/ets-ogcapi-features10` fork, using a branch named `geoserver/integration`.

The procedure to maintain that branch is to rebase on top of the upstream
master branch as required, and apply the additional branches with `git merge --no-ff`.
  • Loading branch information
groldan committed Nov 17, 2024
1 parent 564a275 commit f182e56
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 7 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/cite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,25 @@ jobs:
name: geoserver-war
path: build/cite/geoserver/

- name: Build ogccite/geoserver:${{ matrix.suite }} docker image
working-directory: build/cite
run: make build suite=${{ matrix.suite }}

- name: Print services and images used for the ${{ matrix.suite }} test run
# in case there's a jq syntax error
continue-on-error: true
working-directory: build/cite
run: make print-docker-compose-services suite=${{ matrix.suite }}
run: make print-services suite=${{ matrix.suite }}

- name: Pull teamengine and other required images
working-directory: build/cite
continue-on-error: true
run: make pull suite=${{ matrix.suite }}

- name: Build ogccite/geoserver:${{ matrix.suite }} docker image
working-directory: build/cite
run: make build-geoserver-image suite=${{ matrix.suite }}

- name: Build the ETS docker image
working-directory: build/cite
run: make build-ets-image suite=${{ matrix.suite }}

# optional, used to print out a human readable summary of test failures from the testng results xml
- name: Install the optional xmlstarlet utility
run: |
Expand Down
27 changes: 26 additions & 1 deletion build/cite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,42 @@ war: ## Build the geoserver.war file to use for testing and place it in ./g
@$(MAKE) build-war
@$(MAKE) copy-war

# calls build-ets-image and build-geoserver-image
# the CI job may call them independently for the sake of using separate job steps
.PHONY: build
build: ## suite=<suite> Build the GeoServer Docker Image for the Environment.
ifndef suite
@echo "Error: suite is not specified. Please specify the suite to build the GeoServer Docker image for."
@$(MAKE) help
@exit 1
endif
@$(MAKE) build-ets-image
@$(MAKE) build-geoserver-image

# preparing the geoserver image is performed with docker-compose build including $suite/compose-override.yml
.PHONY: build-geoserver-image
build-geoserver-image:
ifndef suite
@echo "Error: suite is not specified. Please specify the suite to build the GeoServer Docker image for."
@exit 1
endif
@echo Building the GeoServer Docker Image for the $(suite) test suite
@docker compose -f compose.yml -f ./$(suite)/compose.override.yml \
build --no-cache --build-arg SOURCE_FILE=${war_url} geoserver

# If there's a $suite/build-ets.sh file calls it, otherwise exists silently
.PHONY: build-ets-image
build-ets-image:
ifndef suite
@echo "Error: suite is not specified. Please specify the suite to build the GeoServer Docker image for."
@exit 1
endif
@if [ -f "$(suite)/build-ets.sh" ]; then \
(cd $(suite) && ./build-ets.sh); \
else \
echo "$(suite) has no special script to build the ETS docker image."; \
fi

.PHONY: test
test: ## suite=<suite> Run the Test Suite with teamengine and GeoServer on docker compose.
ifndef suite
Expand Down Expand Up @@ -282,7 +307,7 @@ print-logs:

# Used in CI/CD to print which services and images are going to be run
# Requires `jq`, comes pre-installed in github actions `ubuntu-latest`
.PHONY: print-docker-compose-services
.PHONY: print-services
print-services: ### suite=<suite> Print the service names and docker images used for a given suite
ifndef suite
@echo "Error: suite is not specified."
Expand Down
1 change: 1 addition & 0 deletions build/cite/ogcapi-features10/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ets-ogcapi-features10
13 changes: 13 additions & 0 deletions build/cite/ogcapi-features10/build-ets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# build the ets-ogcapi-features10 Docker image from the
# (at the time of writing, ogccite/ets-ogcapi-features10:1.8-SNAPSHOT-teamengine-5.4.1)
# from the geoserver's fork `geoserver/integration` branch, which applies
# patches to the ets that have not yet being released upstream

echo "Building the ogccite/ets-ogcapi-features10 docker image from the geoserver/integration branch"
rm -rf ets-ogcapi-features10
git clone https://github.com/geoserver/ets-ogcapi-features10.git
cd ets-ogcapi-features10
git checkout geoserver/integration && mvn clean install -Pdocker -DskipTests -ntp
cd ..
3 changes: 2 additions & 1 deletion build/cite/ogcapi-features10/compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ services:
# see https://github.com/opengeospatial/teamengine-docker
# there's ogccite/teamengine-production and ogccite/teamengine-beta
# that we could use to migrate the other OWS tests to newer teamengine images
image: ogccite/ets-ogcapi-features10:1.7.1-teamengine-5.4.1
# image: ogccite/ets-ogcapi-features10:1.7.1-teamengine-5.4.1
image: ogccite/ets-ogcapi-features10:1.8-SNAPSHOT-teamengine-5.4.1
healthcheck:
test: "curl -f http://localhost:8080/teamengine/ || exit 1"
interval: 15s
Expand Down

0 comments on commit f182e56

Please sign in to comment.