diff --git a/.gitlab-ci/container/baremetal_build.sh b/.gitlab-ci/container/baremetal_build.sh index 02181176c87..e4605085bdf 100644 --- a/.gitlab-ci/container/baremetal_build.sh +++ b/.gitlab-ci/container/baremetal_build.sh @@ -7,16 +7,13 @@ set -o xtrace # Fetch the arm-built rootfs image and unpack it in our x86_64 container (saves # network transfer, disk usage, and runtime on test jobs) -S3_PATH="https://${S3_HOST}/${S3_KERNEL_BUCKET}" - -if curl -L --retry 3 -f --retry-delay 10 -s --head "${S3_PATH}/${FDO_UPSTREAM_REPO}/${LAVA_DISTRIBUTION_TAG}/lava-rootfs.tar.zst"; then - ARTIFACTS_URL="${S3_PATH}/${FDO_UPSTREAM_REPO}/${LAVA_DISTRIBUTION_TAG}" -else - ARTIFACTS_URL="${S3_PATH}/${S3_PROJECT_PATH}/${LAVA_DISTRIBUTION_TAG}" -fi +# shellcheck disable=SC2034 # S3_BASE_PATH is used in find_s3_project_artifact +S3_BASE_PATH="${S3_HOST}/${S3_KERNEL_BUCKET}" +ARTIFACTS_PATH="${LAVA_DISTRIBUTION_TAG}/lava-rootfs.tar.zst" +ARTIFACTS_URL="$(find_s3_project_artifact "${ARTIFACTS_PATH}")" curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ - "${ARTIFACTS_URL}"/lava-rootfs.tar.zst -o rootfs.tar.zst + "${ARTIFACTS_URL}" -o rootfs.tar.zst mkdir -p /rootfs-"$arch" tar -C /rootfs-"$arch" '--exclude=./dev/*' --zstd -xf rootfs.tar.zst rm rootfs.tar.zst