Skip to content

Part 4: Update the Snapshot

Install pnpm into the snapshot:

src/Golden.ts
export const Golden = Boat.Snapshot("Golden", {
run: ["git clone --depth 1 https://github.com/sindresorhus/is ~/repo"],
run: ["git clone --depth 1 https://github.com/sindresorhus/is ~/repo", "npm install -g pnpm"],
});
Terminal window
pnpm alchemy deploy

The commands changed, so Alchemy runs them all again in a fresh sandbox and saves the result under the same name. The Worker is unchanged and isn’t redeployed.

Terminal window
curl -X POST "$URL/run" -d 'pnpm --version'

A sandbox has its own copy of the disk it started from. Users who already have a sandbox keep it, with their changes and without pnpm. Sandboxes started after the deploy get the new base. To move a user onto it, delete their sandbox; their next request starts a new one from Golden.

Part 5 tests it.