diff --git a/ct/bookorbit.sh b/ct/bookorbit.sh index 500ae374d..9a12774f9 100644 --- a/ct/bookorbit.sh +++ b/ct/bookorbit.sh @@ -48,7 +48,12 @@ function update_script() { $STD corepack prepare "pnpm@${PNPM_VERSION}" --activate $STD pnpm install --frozen-lockfile - $STD pnpm --filter client run build-only + # vite's bundler (rolldown) crashes at random on some builds, rolldown#10860. + for attempt in 1 2 3; do + $STD pnpm --filter client run build-only && break + [[ $attempt -eq 3 ]] && { msg_error "Client build failed three times"; exit 1; } + msg_warn "Client build failed (attempt $attempt), retrying" + done $STD pnpm --filter server run build cp -r /opt/bookorbit/client/dist /opt/bookorbit/server/public mkdir -p /opt/bookorbit/server/migrations diff --git a/install/bookorbit-install.sh b/install/bookorbit-install.sh index 14e574fe1..074d23fdf 100644 --- a/install/bookorbit-install.sh +++ b/install/bookorbit-install.sh @@ -33,7 +33,12 @@ PNPM_VERSION=$(jq -r '.packageManager | ltrimstr("pnpm@")' /opt/bookorbit/packag $STD corepack prepare "pnpm@${PNPM_VERSION}" --activate $STD pnpm install --frozen-lockfile -$STD pnpm --filter client run build-only +# vite's bundler (rolldown) crashes at random on some builds, rolldown#10860. +for attempt in 1 2 3; do + $STD pnpm --filter client run build-only && break + [[ $attempt -eq 3 ]] && { msg_error "Client build failed three times"; exit 1; } + msg_warn "Client build failed (attempt $attempt), retrying" +done $STD pnpm --filter server run build cp -r /opt/bookorbit/client/dist /opt/bookorbit/server/public mkdir -p /opt/bookorbit/server/migrations