Merge "Remove all refs to carbon from AR jobs"
[releng/builder.git] / jjb / packaging / build-rpm.sh
index e5066a498036564a9aac8333529ed9d1f4b3e3b5..3911cc15ac45880cbfafe51527b68b91fa63e565 100644 (file)
@@ -14,6 +14,18 @@ PYTHON="rpm_build/bin/python"
 $PYTHON -m pip install --upgrade pip
 $PYTHON -m pip install -r "$WORKSPACE/packaging/packages/requirements.txt"
 
+# Verify artifact at DOWNLOAD_URL exists
+# shellcheck disable=SC2154
+url_status=$(curl --silent --head --location --output /dev/null --write-out \
+  '%{http_code}' "$DOWNLOAD_URL")
+if [[ $url_status = 2* ]]; then
+  echo "Artifact at DOWNLOAD_URL exists"
+else
+  echo "Artifact at DOWNLOAD_URL does not exist"
+  exit 1
+fi
+
+
 # Packaging logic needs a tarball, but can repackage a zip into tar.gz
 # if needed. All builds except multipatch-test publish both a tar.gz and zip.
 # Autorelease passes DOWNLOAD_URL to zip, others typically use tar.gz.