mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-09 05:19:32 +08:00
chore: allow install smoke previous override
This commit is contained in:
@@ -31,6 +31,7 @@ Use `pnpm` (Node 22+) from the repo root. Keep the working tree clean before tag
|
||||
- [ ] `pnpm run build` (last sanity check after tests)
|
||||
- [ ] `pnpm release:check` (verifies npm pack contents)
|
||||
- [ ] `pnpm test:install:smoke` (Docker install smoke test; required before release)
|
||||
- If the immediate previous npm release is known broken, set `CLAWDBOT_INSTALL_SMOKE_PREVIOUS=<last-good-version>` or `CLAWDBOT_INSTALL_SMOKE_SKIP_PREVIOUS=1` for the preinstall step.
|
||||
- [ ] (Optional) Installer E2E (Docker, runs `curl -fsSL https://clawd.bot/install.sh | bash`, onboards, then runs real tool calls):
|
||||
- `pnpm test:install:e2e:openai` (requires `OPENAI_API_KEY`)
|
||||
- `pnpm test:install:e2e:anthropic` (requires `ANTHROPIC_API_KEY`)
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
set -euo pipefail
|
||||
|
||||
INSTALL_URL="${CLAWDBOT_INSTALL_URL:-https://clawd.bot/install.sh}"
|
||||
SMOKE_PREVIOUS_VERSION="${CLAWDBOT_INSTALL_SMOKE_PREVIOUS:-}"
|
||||
SKIP_PREVIOUS="${CLAWDBOT_INSTALL_SMOKE_SKIP_PREVIOUS:-0}"
|
||||
|
||||
echo "==> Resolve npm versions"
|
||||
LATEST_VERSION="$(npm view clawdbot version)"
|
||||
PREVIOUS_VERSION="$(node - <<'NODE'
|
||||
if [[ -n "$SMOKE_PREVIOUS_VERSION" ]]; then
|
||||
PREVIOUS_VERSION="$SMOKE_PREVIOUS_VERSION"
|
||||
else
|
||||
PREVIOUS_VERSION="$(node - <<'NODE'
|
||||
const { execSync } = require("node:child_process");
|
||||
|
||||
const versions = JSON.parse(execSync("npm view clawdbot versions --json", { encoding: "utf8" }));
|
||||
@@ -16,11 +21,16 @@ const previous = versions.length >= 2 ? versions[versions.length - 2] : versions
|
||||
process.stdout.write(previous);
|
||||
NODE
|
||||
)"
|
||||
fi
|
||||
|
||||
echo "latest=$LATEST_VERSION previous=$PREVIOUS_VERSION"
|
||||
|
||||
echo "==> Preinstall previous (forces installer upgrade path)"
|
||||
npm install -g "clawdbot@${PREVIOUS_VERSION}"
|
||||
if [[ "$SKIP_PREVIOUS" == "1" ]]; then
|
||||
echo "==> Skip preinstall previous (CLAWDBOT_INSTALL_SMOKE_SKIP_PREVIOUS=1)"
|
||||
else
|
||||
echo "==> Preinstall previous (forces installer upgrade path)"
|
||||
npm install -g "clawdbot@${PREVIOUS_VERSION}"
|
||||
fi
|
||||
|
||||
echo "==> Run official installer one-liner"
|
||||
curl -fsSL "$INSTALL_URL" | bash
|
||||
|
||||
@@ -16,6 +16,8 @@ docker build \
|
||||
echo "==> Run installer smoke test (root): $INSTALL_URL"
|
||||
docker run --rm -t \
|
||||
-e CLAWDBOT_INSTALL_URL="$INSTALL_URL" \
|
||||
-e CLAWDBOT_INSTALL_SMOKE_PREVIOUS="${CLAWDBOT_INSTALL_SMOKE_PREVIOUS:-}" \
|
||||
-e CLAWDBOT_INSTALL_SMOKE_SKIP_PREVIOUS="${CLAWDBOT_INSTALL_SMOKE_SKIP_PREVIOUS:-0}" \
|
||||
-e CLAWDBOT_NO_ONBOARD=1 \
|
||||
-e DEBIAN_FRONTEND=noninteractive \
|
||||
"$SMOKE_IMAGE"
|
||||
|
||||
Reference in New Issue
Block a user