Skip to content

Commit

Permalink
ci: provide feedback when running an image on the wrong host arch
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Jul 3, 2020
1 parent 5c876f3 commit 1149cf0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1149cf0

Please sign in to comment.