From 185933a3a341cf09c69c44b387489cdc2f2dcec4 Mon Sep 17 00:00:00 2001 From: Toni Saario Date: Wed, 3 Sep 2025 11:50:08 +0300 Subject: [PATCH] Cache maven dependencies for californium build The fetching from 3rd party repos has become very flaky. To avoid mirrors throttling us and other flaky issues cache the dependencies and set -o to enable offline mode. This seems to also speed up the step considerably. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I01663e60baa44ab828d8880ab8b346034a50b60e Reviewed-by: Jukka Jokiniva --- .../common/shared/testserver/californium/Dockerfile | 5 +++-- .../common/shared/testserver/docker_images.sh | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/coin/provisioning/common/shared/testserver/californium/Dockerfile b/coin/provisioning/common/shared/testserver/californium/Dockerfile index 81d27f9b..14ba2e04 100644 --- a/coin/provisioning/common/shared/testserver/californium/Dockerfile +++ b/coin/provisioning/common/shared/testserver/californium/Dockerfile @@ -4,12 +4,13 @@ RUN apt-get update && apt-get -y install $packages # Get californium-based CoAP test server WORKDIR /root/src -ADD californium-*.tar.gz . +ADD californium-3.8.0.tar.gz . RUN mv californium-* californium WORKDIR /root/src/californium ADD qt_changes.patch ./ RUN patch -p1 < qt_changes.patch -RUN mvn clean install -q -DskipTests +ADD californium-m2deps-3.8.0.tar.gz /root +RUN mvn clean install -o -q -DskipTests WORKDIR / EXPOSE 5683/udp 5684/udp diff --git a/coin/provisioning/common/shared/testserver/docker_images.sh b/coin/provisioning/common/shared/testserver/docker_images.sh index e4782a72..68d57633 100755 --- a/coin/provisioning/common/shared/testserver/docker_images.sh +++ b/coin/provisioning/common/shared/testserver/docker_images.sh @@ -60,6 +60,16 @@ DownloadURL \ 24f8ca393f26c922739462e4586b8ced1ff75f99bfa795defa34a967b5a4a5a0 \ californium-3.8.0.tar.gz mv californium-3.8.0.tar.gz "$SERVER_PATH/californium/" +# Download cached maven dependencies for californium. +# The dependency archive is built by +# "mvn dependency:go-offline -DskipTests -Dos.detected.classifier=linux-x86_64" +# and archived from /root/.m2 +DownloadURL \ + http://ci-files01-hki.ci.qt.io/input/docker/californium-m2deps-3.8.0.tar.gz \ + http://ci-files01-hki.ci.qt.io/input/docker/californium-m2deps-3.8.0.tar.gz \ + e2fade7dde3cca02bb910eed99a5d8b5cb8ff945240c65bf06ce50411d70d3f2 \ + californium-m2deps-3.8.0.tar.gz +mv californium-m2deps-3.8.0.tar.gz "$SERVER_PATH/californium/" echo 'Building the docker images...'