#!/usr/bin/env bash
#
# RETIRED 2026-09-18. This script does not deploy anything any more.
#
# What it used to do is `cargo xtask refresh-front` in the sibling checkout
# `monetize-impl`, in Rust, under test — build, ship over SSH, stage, swap
# atomically, restart, verify, and print the way back. This file only ever
# existed because the transport was `ssh` and `scp`; that half is now
# `nornir_git::ssh` (russh), so the law's "pure Rust 100%, no shelling" has
# nothing left to concede to.
#
# The two guards this script had and the Rust verb did not are ported, with
# tests that can be driven red:
#
# * `gunnar-ui-server --check-env`, run against the STAGED binary on the box
# before anything moves — missing keys, a surviving REPLACE-ME, a
# GUNNAR_UI_DIR that does not go through `current`, and the one refusal that
# needs the artifact and the configuration in the same room,
# `lifecycle::Refusal::ConfiguredToSellButCannot`.
# → monetize-impl/deploy/front/src/plan.rs (`check_env`),
# .../src/verify.rs (`check_env_gate`)
#
# * the wasm marker. A `metered` deploy must carry `/increase/offer` in
# `dist/*_bg.wasm`, because a wasm has no `--version` and a UI word gets
# rewritten. MEASURED 2026-09-18: trunk had never been given `--features`,
# so the front served a metered server beside a COMMUNITY bundle for weeks
# and no customer could buy room. The Rust verb now hands trunk the same
# word as cargo AND asks the bundle afterwards.
# → .../src/verify.rs (`money_panel_gate`), .../src/build.rs (`bundle_gate`,
# `trunk_args`), .../src/artefact.rs (`CONSOLE_BUNDLE.features`)
cat >&2 <<'MSG'
deploy/deploy.sh is retired. The console is deployed from the monetize-impl
checkout, in Rust:
cd ../monetize-impl
cargo xtask refresh-front --only console --host 95.111.204.164
--only console gunnar-ui-server + the wasm bundle, and nothing of
monetize's — what this script used to do
--dry-run build, gate, survey the box, change nothing
--no-build ship what is already built (every artifact gate still runs)
--rollback <stamp> point /opt/gunnar-ui/current back at a release
95.111.204.164 is the front, and it is also the verb's own default since
2026-09-18, so --host can be left off. Say it when in doubt: the default has
named a box that no longer existed twice, and a deploy aimed at a dead address
fails as a network timeout, which is the failure nobody reads as "wrong target".
Two things the Rust verb deliberately does NOT do, and this script did:
* it never runs `gunnar-ui-server --install`, because that rewrites
/etc/gunnar-ui.env and that file is on the verb's never-touch list. The
unit already names `current`, so a swap + restart is enough; run --install
by hand on the box when `lifecycle`'s declaration changes.
* it never prunes releases/. Keeping them all is what makes
`--rollback <stamp>` work for any stamp, and it is what fills a disk.
`gunnar_ui_server::release::prune` is the code to call when it matters.
deploy/README.md has the rest.
MSG
exit 2