Add profile that pre-pulls test container images

This commit is contained in:
Chris Eager authored and Chris Eager committed 2026-10-14 11:16:01 -04:00
1 parent ff642c1ae5
commit 9e6b142189
2 files changed
+42 -2

No files matched your search

+1 -1
View File
@@ -69,4 +69,4 @@ jobs:
cp service/target/jib-extra/usr/lib/libfdb_c.so /usr/lib/libfdb_c.x86_64.so
ldconfig
- name: Build with Maven
run: ./mvnw -e -B clean verify -DfoundationDb.serviceContainerNamePrefix=foundationdb
run: ./mvnw -e -B -Pprepull-testcontainers-images clean verify -DfoundationDb.serviceContainerNamePrefix=foundationdb
+41 -1
View File
@@ -94,7 +94,7 @@
<testcontainers.version>2.0.5</testcontainers.version>
<webauthn4j.version>0.31.11.RELEASE</webauthn4j.version>
<!-- images to use in tests via testcontainers -->
<!-- Images to use in tests via testcontainers. See also: prepull-testcontainers-images <profile> -->
<dynamodb.image>amazon/dynamodb-local:3.3.1@sha256:ff89bd48ff32cd8d9be5fee8873b65b8854dc408f1afe881be6eb00247bc0dab</dynamodb.image>
<localstack.image>localstack/localstack:4.14@sha256:3ebc37595918b8accb852f8048fef2aff047d465167edd655528065b07bc364a</localstack.image>
<redis.image>redis:7.4-alpine@sha256:6ab0b6e7381779332f97b8ca76193e45b0756f38d4c0dcda72dbb3c32061ab99</redis.image>
@@ -430,6 +430,46 @@
</file>
</activation>
</profile>
<profile>
<!-- Starts pulling Testcontainers images in the background, reducing test blocks. This is primarily useful in CI,
where images are less likely to be cached.-->
<id>prepull-testcontainers-images</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<!-- Run once for the whole reactor, rather than once per module -->
<inherited>false</inherited>
<executions>
<execution>
<id>prepull-testcontainers-images</id>
<phase>initialize</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sh</executable>
<arguments>
<argument>-c</argument>
<!-- Images are pulled one at a time to limit contention with the build. If any fails, then exit status
is non-zero, so failure is logged. -->
<argument>status=0; for image in "$@"; do docker pull -q "$image" || status=1; done; exit $status</argument>
<argument>sh</argument>
<argument>${redis-cluster.image}</argument>
<argument>${redis.image}</argument>
<argument>${dynamodb.image}</argument>
<argument>${localstack.image}</argument>
</arguments>
<async>true</async>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>