From 0b5d8be9f78fc84b60c11804102f68a0dc89f632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sun, 6 Nov 2022 16:52:39 +0100 Subject: [PATCH] use more robust image selection process #93 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stephan Schroevers Co-authored-by: Hervé Boutemy --- bin/update-statistics.sh | 13 ++++++++++++- doc/buildspec-stats.txt | 6 +++--- rebuild.sh | 11 +++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/bin/update-statistics.sh b/bin/update-statistics.sh index 92f0c4cbbd..24414e6b7f 100755 --- a/bin/update-statistics.sh +++ b/bin/update-statistics.sh @@ -55,6 +55,17 @@ mvnImage() { *) mvnImage=maven:${mvnVersion}-openjdk-${jdk}-slim esac + if ! docker pull -q ${mvnImage} > /dev/null 2>&1 + then + for image in maven:{${mvnVersion},3}-eclipse-temurin-${jdk}-alpine + do + if docker pull -q ${image} > /dev/null 2>&1 + then + mvnImage=${image} + break + fi + done + fi # check image existence echo -n -e "checking image ${mvnImage} \r" @@ -67,7 +78,7 @@ do mvnImage $val echo "$val $mvnImage" >> doc/buildspec-stats.txt done -echo +echo " " rm tmp-tool-jdk cat doc/buildspec-stats.txt \ No newline at end of file diff --git a/doc/buildspec-stats.txt b/doc/buildspec-stats.txt index 607f69b490..c9829aea4f 100644 --- a/doc/buildspec-stats.txt +++ b/doc/buildspec-stats.txt @@ -29,13 +29,13 @@ mvn 15 maven:3.6.3-openjdk-15-slim mvn 16 maven:3.6.3-openjdk-16-slim mvn 17 maven:3.6.3-openjdk-17-slim mvn 18 maven:3-openjdk-18-slim -mvn 19 maven:3.6.3-openjdk-19-slim +mvn 19 maven:3-eclipse-temurin-19-alpine mvn-3.5.4 8 maven:3.5.4-jdk-8-slim mvn-3.8.5 8 maven:3.8.5-jdk-8-slim mvn-3.8.5 11 maven:3.8.5-openjdk-11-slim mvn-3.8.5 17 maven:3.8.5-openjdk-17-slim mvn-3.8.6 8 maven:3.8.6-jdk-8-slim mvn-3.8.6 11 maven:3.8.6-openjdk-11-slim -mvn-3.8.6 17 maven:3.8.6-openjdk-17-slim +mvn-3.8.6 17 maven:3.8.6-eclipse-temurin-17-alpine mvn-3.8.6 18 maven:3.8.6-openjdk-18-slim -mvn-3.8.6 19 maven:3.8.6-openjdk-19-slim +mvn-3.8.6 19 maven:3.8.6-eclipse-temurin-19-alpine diff --git a/rebuild.sh b/rebuild.sh index a9835d5d2f..aa1d9e1658 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -122,6 +122,17 @@ mvnBuildDocker() { *) mvnImage=maven:${mvnVersion}-eclipse-temurin-${jdk}-alpine esac + if ! docker pull -q ${mvnImage} > /dev/null 2>&1 + then + for image in maven:{${mvnVersion},3}-eclipse-temurin-${jdk}-alpine + do + if docker pull -q ${image} > /dev/null 2>&1 + then + mvnImage=${image} + break + fi + done + fi echo "Rebuilding using Docker image ${mvnImage}" local docker_command="docker run -it --rm --name rebuild-central -v $PWD:/var/maven/app -v $base:/var/maven/.m2 -v $base/.sbt:/var/maven/.sbt -v $base/.npm:/.npm -v $base/.bnd:/.bnd -u $(id -u ${USER}):$(id -g ${USER}) -e MAVEN_CONFIG=/var/maven/.m2 -w /var/maven/app"