From 1149cf04de68f45a596c5a9479a525a2efb88214 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 23 Jun 2020 12:08:16 +0200 Subject: [PATCH] ci: provide feedback when running an image on the wrong host arch --- src/ci/docker/run.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 56fe57d32deb..44504f6a938b 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -123,6 +123,28 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then - else echo Invalid image: $image + + # Check whether the image exists for other architectures + for arch_dir in "${script_dir}"/host-*; do + # Avoid checking non-directories and the current host architecture directory + if ! [[ -d "${arch_dir}" ]]; then + continue + fi + if [[ "${arch_dir}" = "${docker_dir}" ]]; then + continue + fi + + arch_name="$(basename "${arch_dir}" | sed 's/^host-//')" + if [[ -f "${arch_dir}/${image}/Dockerfile" ]]; then + echo "Note: the image exists for the ${arch_name} host architecture" + elif [[ -f "${arch_dir}/disabled/${image}/Dockerfile" ]]; then + echo "Note: the disabled image exists for the ${arch_name} host architecture" + else + continue + fi + echo "Note: the current host architecture is $(uname -m)" + done + exit 1 fi