mirror of
https://github.com/maxkratz/docker-maven.git
synced 2024-09-16 18:58:51 +00:00
d6d849139e
Some checks failed
amazoncorretto-17-windowsservercore / build (push) Has been cancelled
amazoncorretto-17 / build (push) Has been cancelled
amazoncorretto-21-al2023 / build (push) Has been cancelled
amazoncorretto-21-debian / build (push) Has been cancelled
amazoncorretto-8-al2023 / build (push) Has been cancelled
amazoncorretto-21 / build (push) Has been cancelled
amazoncorretto-8-debian / build (push) Has been cancelled
amazoncorretto-11-al2023 / build (push) Has been cancelled
amazoncorretto-11-debian / build (push) Has been cancelled
amazoncorretto-11-windowsservercore / build (push) Has been cancelled
amazoncorretto-11 / build (push) Has been cancelled
amazoncorretto-17-al2023 / build (push) Has been cancelled
amazoncorretto-17-debian / build (push) Has been cancelled
amazoncorretto-8-windowsservercore / build (push) Has been cancelled
amazoncorretto-8 / build (push) Has been cancelled
azulzulu-11-alpine / build (push) Has been cancelled
azulzulu-11-debian / build (push) Has been cancelled
azulzulu-11-windowsservercore / build (push) Has been cancelled
azulzulu-11 / build (push) Has been cancelled
azulzulu-17-alpine / build (push) Has been cancelled
azulzulu-17-debian / build (push) Has been cancelled
azulzulu-21-alpine / build (push) Has been cancelled
azulzulu-21-debian / build (push) Has been cancelled
azulzulu-21 / build (push) Has been cancelled
azulzulu-8 / build (push) Has been cancelled
eclipse-temurin-11-alpine / build (push) Has been cancelled
eclipse-temurin-11-focal / build (push) Has been cancelled
azulzulu-17-windowsservercore / build (push) Has been cancelled
azulzulu-17 / build (push) Has been cancelled
azulzulu-8-alpine / build (push) Has been cancelled
azulzulu-8-debian / build (push) Has been cancelled
eclipse-temurin-11 / build (push) Has been cancelled
eclipse-temurin-17-alpine / build (push) Has been cancelled
eclipse-temurin-17-focal / build (push) Has been cancelled
eclipse-temurin-17 / build (push) Has been cancelled
eclipse-temurin-21 / build (push) Has been cancelled
eclipse-temurin-22-alpine / build (push) Has been cancelled
eclipse-temurin-22-jammy / build (push) Has been cancelled
eclipse-temurin-22 / build (push) Has been cancelled
eclipse-temurin-8-alpine / build (push) Has been cancelled
eclipse-temurin-8-focal / build (push) Has been cancelled
eclipse-temurin-8 / build (push) Has been cancelled
graalvm-community-17 / build (push) Has been cancelled
ibm-semeru-11-focal / build (push) Has been cancelled
eclipse-temurin-21-alpine / build (push) Has been cancelled
eclipse-temurin-21-jammy / build (push) Has been cancelled
graalvm-community-21 / build (push) Has been cancelled
ibm-semeru-17-focal / build (push) Has been cancelled
ibm-semeru-21-jammy / build (push) Has been cancelled
ibmjava-8 / build (push) Has been cancelled
libericaopenjdk-11-alpine / build (push) Has been cancelled
libericaopenjdk-11-debian / build (push) Has been cancelled
libericaopenjdk-17-alpine / build (push) Has been cancelled
libericaopenjdk-17-debian / build (push) Has been cancelled
libericaopenjdk-8-alpine / build (push) Has been cancelled
libericaopenjdk-8-debian / build (push) Has been cancelled
microsoft-openjdk-11-ubuntu / build (push) Has been cancelled
microsoft-openjdk-17-ubuntu / build (push) Has been cancelled
microsoft-openjdk-21-ubuntu / build (push) Has been cancelled
openjdk-11-windowsservercore / build (push) Has been cancelled
openjdk-8-windowsservercore / build (push) Has been cancelled
openjdk-11-nanoserver / build (push) Has been cancelled
openjdk-8-nanoserver / build (push) Has been cancelled
oracle-graalvm-17 / build (push) Has been cancelled
oracle-graalvm-21 / build (push) Has been cancelled
sapmachine-11 / build (push) Has been cancelled
sapmachine-17 / build (push) Has been cancelled
sapmachine-21 / build (push) Has been cancelled
sapmachine-22 / build (push) Has been cancelled
73 lines
2.3 KiB
Bash
Executable file
73 lines
2.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
. common.sh
|
|
|
|
OFFICIAL_IMAGES_DIR=../../docker/official-images
|
|
|
|
from_linux=eclipse-temurin-17
|
|
|
|
pattern="# common for all images"
|
|
|
|
# we need gnu-sed on macos
|
|
if prefix="$(brew --prefix gnu-sed 2>&1)" && [ -d "${prefix}/libexec/gnubin" ]; then
|
|
PATH="${prefix}/libexec/gnubin:$PATH"
|
|
fi
|
|
|
|
for dir in "${all_dirs[@]}"; do
|
|
if [[ "$dir" == *"windows"* ]] || [[ "$dir" == *"nanoserver"* ]]; then
|
|
from=amazoncorretto-17-windowsservercore
|
|
if [[ "$dir" != "$from" ]]; then
|
|
cp $from/mvn-entrypoint.ps1 "$dir/"
|
|
cp $from/settings-docker.xml "$dir/"
|
|
fi
|
|
else
|
|
from=$from_linux
|
|
if [[ "$dir" != "$from" ]]; then
|
|
# remove everything after the 'common for all images' line
|
|
sed "/^${pattern}$/q" "$dir/Dockerfile" | sponge "$dir/Dockerfile"
|
|
# copy from the main Dockerfile template the common lines
|
|
tail +2 Dockerfile-template >>"$dir/Dockerfile"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
# Generate GihHub action workflows
|
|
./github-action-generation.sh
|
|
|
|
# Download windows jdks, update hash and JAVA_HOME
|
|
find . -iname Dockerfile -exec grep -Hl "ARG uri=" {} \; | while read -r file; do
|
|
uri=$(grep "ARG uri=" "$file" | sed -e 's/ARG uri=//')
|
|
zip=$(grep "ARG zip=" "$file" | sed -e 's/ARG zip=//')
|
|
hash=$(grep "ARG hash=" "$file" | sed -e 's/ARG hash=//')
|
|
if ! [ -f "/tmp/$zip" ]; then
|
|
echo "Downloading: $uri/$zip"
|
|
curl -sSLf -o "/tmp/$zip" "$uri/$zip"
|
|
fi
|
|
IFS=" " read -r -a new_hash <<<"$(sha256sum "/tmp/$zip")"
|
|
echo "$file $uri/$zip $hash ${new_hash[0]}"
|
|
sed -i -e "s/ARG hash=.*/ARG hash=${new_hash[0]}/" "$file"
|
|
echo "Extracting JAVA_HOME from $zip"
|
|
if ! java_home="$( (unzip -t "/tmp/$zip" || true) | grep -m 1 "testing: " | sed -e 's#.*testing: \(.*\)/.*#\1#')"; then
|
|
echo >&2 "Failed to extract JAVA_HOME"
|
|
exit 1
|
|
fi
|
|
echo "Found JAVA_HOME for $zip: $java_home"
|
|
sed -i -e "s#JAVA_HOME=C.*#JAVA_HOME=C:/ProgramData/${java_home}#" "$file"
|
|
done
|
|
|
|
echo "Generating stackbrew"
|
|
./generate-stackbrew-library.sh >"${OFFICIAL_IMAGES_DIR}/library/maven"
|
|
|
|
echo "Running naughty"
|
|
pushd "${OFFICIAL_IMAGES_DIR}" >/dev/null
|
|
naughty_output=$(./naughty-from.sh maven)
|
|
if [ -n "${naughty_output}" ]; then
|
|
printf "Naughty errors:\n%s\n" "${naughty_output}" >&2
|
|
exit 1
|
|
fi
|
|
popd >/dev/null
|
|
|
|
echo Done, you can submit a PR now to https://github.com/docker-library/official-images
|