ci: harden external test tool bootstrap
All checks were successful
CI / verify (push) Successful in 11m0s
All checks were successful
CI / verify (push) Successful in 11m0s
This commit is contained in:
@@ -79,19 +79,37 @@ case "$arch" in
|
|||||||
*) echo "Unsupported MinIO architecture: ${arch}" >&2; exit 1 ;;
|
*) echo "Unsupported MinIO architecture: ${arch}" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
MINIO_BIN="${MINIO_BIN:-${WORK_DIR}/minio}"
|
default_minio_bin="${WORK_DIR}/minio"
|
||||||
MC_BIN="${MC_BIN:-${WORK_DIR}/mc}"
|
default_mc_bin="${WORK_DIR}/mc"
|
||||||
|
if command -v minio >/dev/null 2>&1; then
|
||||||
|
default_minio_bin="$(command -v minio)"
|
||||||
|
fi
|
||||||
|
if command -v mc >/dev/null 2>&1; then
|
||||||
|
default_mc_bin="$(command -v mc)"
|
||||||
|
fi
|
||||||
|
MINIO_BIN="${MINIO_BIN:-${default_minio_bin}}"
|
||||||
|
MC_BIN="${MC_BIN:-${default_mc_bin}}"
|
||||||
|
|
||||||
|
download_tool() {
|
||||||
|
local url=$1
|
||||||
|
local output=$2
|
||||||
|
local partial="${output}.part"
|
||||||
|
curl --fail --silent --show-error --location \
|
||||||
|
--retry 10 --retry-all-errors --retry-delay 2 --connect-timeout 20 \
|
||||||
|
--continue-at - --output "$partial" "$url"
|
||||||
|
mv "$partial" "$output"
|
||||||
|
chmod +x "$output"
|
||||||
|
}
|
||||||
|
|
||||||
if [[ ! -x "$MINIO_BIN" ]]; then
|
if [[ ! -x "$MINIO_BIN" ]]; then
|
||||||
curl --fail --silent --show-error --location --retry 3 \
|
download_tool \
|
||||||
"https://dl.min.io/server/minio/release/linux-${minio_arch}/minio" \
|
"https://dl.min.io/server/minio/release/linux-${minio_arch}/minio" \
|
||||||
--output "$MINIO_BIN"
|
"$MINIO_BIN"
|
||||||
chmod +x "$MINIO_BIN"
|
|
||||||
fi
|
fi
|
||||||
if [[ ! -x "$MC_BIN" ]]; then
|
if [[ ! -x "$MC_BIN" ]]; then
|
||||||
curl --fail --silent --show-error --location --retry 3 \
|
download_tool \
|
||||||
"https://dl.min.io/client/mc/release/linux-${minio_arch}/mc" \
|
"https://dl.min.io/client/mc/release/linux-${minio_arch}/mc" \
|
||||||
--output "$MC_BIN"
|
"$MC_BIN"
|
||||||
chmod +x "$MC_BIN"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export IMAGEFORGE_TEST_S3_ENDPOINT="${IMAGEFORGE_TEST_S3_ENDPOINT:-http://127.0.0.1:19000}"
|
export IMAGEFORGE_TEST_S3_ENDPOINT="${IMAGEFORGE_TEST_S3_ENDPOINT:-http://127.0.0.1:19000}"
|
||||||
|
|||||||
Reference in New Issue
Block a user