From f01c6e5ce0a335e73bd297b43f3c14d69b7b202b Mon Sep 17 00:00:00 2001 From: George Adams Date: Thu, 2 Nov 2023 08:33:58 +0000 Subject: [PATCH] fixup test --- .../image-name.sh | 10 ----- .../tests/dotted-environment-variables/run.sh | 44 +------------------ 2 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 .test/tests/dotted-environment-variables/image-name.sh diff --git a/.test/tests/dotted-environment-variables/image-name.sh b/.test/tests/dotted-environment-variables/image-name.sh deleted file mode 100644 index 184297030..000000000 --- a/.test/tests/dotted-environment-variables/image-name.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e - -# usage: ./image-name.sh librarytest/something some/image:some-tag -# output: librarytest/something:some-image-some-tag - -base="$1"; shift -tag="$1"; shift - -echo "$base:$(echo "$tag" | sed 's![:/]!-!g')" diff --git a/.test/tests/dotted-environment-variables/run.sh b/.test/tests/dotted-environment-variables/run.sh index 268a44e4f..151f96ef6 100755 --- a/.test/tests/dotted-environment-variables/run.sh +++ b/.test/tests/dotted-environment-variables/run.sh @@ -1,49 +1,7 @@ #!/usr/bin/env bash -## Copied from https://github.com/docker-library/official-images/blob/master/test/tests/run-java-in-container.sh - set -Eeuo pipefail -testDir="$(readlink -f "$(dirname "$BASH_SOURCE")")" -runDir="$(dirname "$(readlink -f "$BASH_SOURCE")")" - image="$1" -# do a little extra work to try and find a suitable JDK image (when "xyzjava:1.2.3-jre" first builds, "xyzjava:1.2.3-jdk" isn't published yet :D) -tryJdks=( - # ideally, we'd just swap the current JRE image to JDK, but that might not exist yet (see above) - "${image/jre/jdk}" -) -jdk= -for potentialJdk in "${tryJdks[@]}"; do - if docker run --rm --pull=missing "$potentialJdk" javac -help &> /dev/null; then - jdk="$potentialJdk" - break - fi -done -if [ -z "$jdk" ]; then - echo >&2 "error: failed to find a suitable JDK image for '$image'!" - exit 1 -fi -if [ "$jdk" != "${tryJdks[0]}" ]; then - echo >&2 "warning: using '$jdk' instead of '${tryJdks[0]}' (results may vary!)" -fi - -# if possible, use "--release" in case $jdk and $image have mismatching Java versions -javac='javac' -if docker run --rm "$jdk" javac --help 2>&1 | grep -q -- '--release'; then - javac='javac --release 8' -fi - -newImage="$("$runDir/image-name.sh" librarytest/java-hello-world "$image")" -"$runDir/docker-build.sh" "$testDir" "$newImage" <