Skip to content

Commit

Permalink
use more robust image selection process #93
Browse files Browse the repository at this point in the history
Co-authored-by: Stephan Schroevers <[email protected]>
Co-authored-by: Hervé Boutemy <[email protected]>
  • Loading branch information
hboutemy and Stephan202 committed Nov 6, 2022
1 parent f2558a3 commit 0b5d8be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
13 changes: 12 additions & 1 deletion bin/update-statistics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
6 changes: 3 additions & 3 deletions doc/buildspec-stats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0b5d8be

Please sign in to comment.