-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-renaissance-in-podman.sh
executable file
·61 lines (50 loc) · 1.6 KB
/
run-renaissance-in-podman.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -ueo pipefail
source ./version.rc
indent() {
sed 's#.*# &#'
}
get_image_ids_and_labels() {
podman image ls \
--format '{{ .ID }} {{ .Repository }}:{{ .Tag }}' \
"${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION_TAG}-*" "$@"
}
images_filter="${images:-.}"
jvm_args="${jvm_args:-}"
renaissance_jar="${1:-}"
shift
if ! [ -f "$renaissance_jar" ]; then
echo "Unable to find Renaissance JAR '$renaissance_jar'. Terminating." >&2
exit 1
fi
if [ "$#" -eq 0 ]; then
set -- -r 1 -c test all
fi
get_image_ids_and_labels | grep -e "$images_filter" | (
failed_images=""
counter=0
while read image_id image_label; do
echo ">>> $image_label ($image_id)"
echo " -> java $jvm_args -jar renaissance.jar $*"
if podman run --rm --volume "$renaissance_jar:/renaissance.jar:ro" "$image_id" \
/bin/bash -c "java $jvm_args -jar /renaissance.jar $*" 2>&1 | indent; then
echo " -> $image_label ($image_id) looks okay."
else
echo " !!"
echo " !! Failed Renaissance run on $image_label ($image_id), see above."
echo " !!"
echo " !!"
failed_images="$failed_images $image_label"
fi
counter=$(( counter + 1 ))
done
echo ">>> Finished testing $counter images matching ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION_TAG}-* ..."
if [ -z "$failed_images" ]; then
echo " -> Everything looks good."
else
echo " -> Issues found with following images:$failed_images."
fi
if [ -n "$failed_images" ]; then
exit 2
fi
)