[multipass] add fallback url to pull from iiab/factory/install.txt
This commit is contained in:
parent
6bb6366f0e
commit
f67ddfe0a7
|
|
@ -149,7 +149,7 @@ fi
|
|||
|
||||
# Default module
|
||||
if [[ "${#modules[@]}" -eq 0 ]]; then
|
||||
modules=("code")
|
||||
modules=("")
|
||||
fi
|
||||
|
||||
# If no --pr provided, take from env IIAB_PR (space-separated)
|
||||
|
|
@ -174,6 +174,7 @@ fi
|
|||
|
||||
LOGROOT="${LOGROOT:-iiab_multipass_runs_$(date +%Y%m%d)}"
|
||||
mkdir -p "$LOGROOT"
|
||||
echo "[INFO] Logging files stored at: $LOGROOT"
|
||||
|
||||
stamp() { date +%H%M%S; }
|
||||
|
||||
|
|
@ -332,7 +333,6 @@ run_install_txt() {
|
|||
log="$LOGROOT/${vm}.install.${t}.log"
|
||||
rc="$LOGROOT/${vm}.install.${t}.rc"
|
||||
|
||||
echo "[INFO] Logging files stored at: $LOGROOT"
|
||||
echo "[INFO] install.txt in $vm (log $(basename "$log")) ..."
|
||||
|
||||
local modules_str pr_str
|
||||
|
|
@ -392,8 +392,22 @@ run_install_txt() {
|
|||
fi
|
||||
|
||||
echo "--- install.txt ---"
|
||||
echo "curl -fsSL https://iiab.io/install.txt | bash -s -- ${install_args[*]}"
|
||||
curl -fsSL https://iiab.io/install.txt | bash -s -- "${install_args[@]}"
|
||||
INSTALL_PRIMARY="https://iiab.io/install.txt"
|
||||
INSTALL_FALLBACK="https://raw.githubusercontent.com/iiab/iiab-factory/refs/heads/master/install.txt"
|
||||
CURL="curl -fsSL --retry 5 --retry-delay 2 --connect-timeout 15"
|
||||
|
||||
tmp_install="$(mktemp)"
|
||||
if $CURL "$INSTALL_PRIMARY" -o "$tmp_install"; then
|
||||
:
|
||||
else
|
||||
echo "Warning: failed to fetch $INSTALL_PRIMARY"
|
||||
echo "Falling back to $INSTALL_FALLBACK"
|
||||
$CURL "$INSTALL_FALLBACK" -o "$tmp_install"
|
||||
fi
|
||||
|
||||
echo "bash -s -- ${install_args[*]} < \"$tmp_install\""
|
||||
bash -s -- "${install_args[@]}" < "$tmp_install"
|
||||
rm -f "$tmp_install"
|
||||
|
||||
echo "--- install done ---"
|
||||
' >"$log" 2>&1
|
||||
|
|
@ -502,7 +516,12 @@ pipeline_parallel_stagger() {
|
|||
sleep $((i * STAGGER))
|
||||
launch_one "$vm"
|
||||
run_install_txt "$vm"
|
||||
resume_iiab "$vm" 1
|
||||
# Only Ubuntu tends to reboot during install; Debian often doesn't.
|
||||
local waitflag=1
|
||||
if [[ "${VM_IMAGE[$vm]}" == "$DEBIAN13_IMAGE_URL" ]]; then
|
||||
waitflag=0
|
||||
fi
|
||||
resume_iiab "$vm" "$waitflag"
|
||||
) &
|
||||
pids+=("$!")
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in New Issue