crosscode script: deploy, status, install, adopt (Events 2.2.0, plan §4-5)

One script for installing, updating and moving church installs, replacing
hope-events' scripts/deploy.sh and install.sh:

- deploy <church> [events] / --every-church, with --version, --main, --check
  and --allow-local-changes: checks every product first (files changed by
  hand, Node, release requirements from WHATS-NEW.md headings), then each
  product in order with backup, checkout, install, migrate, build, PM2 reload
  and a /health version check; a failure rolls that product back and stops.
- status [<church>]: checked-out and latest release, /health, and the old
  folder kept after adopt.
- install <church> --products events --domain <address>: a new church under
  /var/www/sites/<church>, writing church.env.
- adopt <church> --events-dir <old> builds the monorepo checkout next to the
  running install and switches PM2 over; adopt --undo goes back to it.

Product hooks live in scripts/products/events.sh. shellcheck (lint:scripts)
and 47 bats tests (test:scripts) are part of npm run check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 19:17:06 +02:00
co-authored by Claude Opus 5.5
parent f174285711
commit c442fe0d42
16 changed files with 3111 additions and 7 deletions
+5 -1
View File
@@ -13,9 +13,11 @@
"scripts": {
"build": "npm run build --workspaces --if-present",
"test": "npm test --workspaces --if-present",
"test:scripts": "bats scripts/tests",
"typecheck": "npm run typecheck --workspaces --if-present",
"lint": "eslint .",
"check": "npm run lint && npm run typecheck && npm test && npm run build"
"lint:scripts": "shellcheck -x scripts/crosscode scripts/products/events.sh",
"check": "npm run lint && npm run lint:scripts && npm run typecheck && npm test && npm run test:scripts && npm run build"
},
"engines": {
"node": ">=20"
@@ -26,9 +28,11 @@
"@playwright/test": "^1.64.0",
"@types/jest": "^30.0.0",
"@types/node": "^20.19.43",
"bats": "^1.13.0",
"concurrently": "^9.2.1",
"eslint": "^10.13.0",
"jest": "^30.5.2",
"shellcheck": "^4.1.0",
"ts-jest": "^29.4.15",
"tsup": "^9.0.0",
"typescript": "^5.9.3",