Skip to content

Commit 4192592

Browse files
committed
check-remote-image-existence.sh: exit 1 if any image does not exist
Signed-off-by: Norio Nomura <[email protected]>
1 parent 302ec8d commit 4192592

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hack/check-remote-image-existence.sh

+4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ set -eu -o pipefail
44
# Get the directory of the script
55
script_dir=$(dirname "$0")
66

7+
result=0
78
for template in $(realpath "${script_dir}"/../examples/*.yaml "${script_dir}"/./test-templates/*.yaml|sort -u); do
89
for location in $(yq eval '.images[].location' "${template}"); do
910
if [[ "${location}" == http* ]]; then
1011
response=$(curl -L -s -I -o /dev/null -w "%{http_code}" "${location}")
1112
if [[ ${response} != "200" ]]; then
1213
line=$(grep -n "${location}" "${template}" | cut -d ':' -f 1)
1314
echo "::error file=${template},line=${line}::response: ${response} for ${location}"
15+
result=1
1416
else
1517
echo "response: ${response} for ${location}"
1618
fi
1719
fi
1820
done
1921
done
22+
23+
exit "${result}"

0 commit comments

Comments
 (0)