From 349a92bdb71b8da54a7204e9876d3fa66f47681b Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 6 Feb 2023 13:45:39 -0700 Subject: [PATCH] install-deps.sh: Fail when downloading apt repos More specifically, if we get e.g. a 504 while attempting to download a .list file, fail the build and log the status code. Signed-off-by: Zack Cerza --- install-deps.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install-deps.sh b/install-deps.sh index 3762b3de035..4eb757f6b7d 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -134,7 +134,8 @@ function install_pkg_on_ubuntu { fi if test -n "$missing_pkgs"; then local shaman_url="https://shaman.ceph.com/api/repos/${project}/master/${sha1}/ubuntu/${codename}/repo" - $SUDO curl --silent --location $shaman_url --output /etc/apt/sources.list.d/$project.list + in_jenkins && echo -n "CI_DEBUG: Downloading $shaman_url ... " + $SUDO curl --silent --fail --write-out "%{http_code}" --location $shaman_url --output /etc/apt/sources.list.d/$project.list $SUDO env DEBIAN_FRONTEND=noninteractive apt-get update -y -o Acquire::Languages=none -o Acquire::Translation=none || true $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install --allow-unauthenticated -y $missing_pkgs fi -- 2.39.5