deploy-board-local.sh 1.6 KB

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. if [[ $# -ne 1 || "$1" != /opt/kangshifu-web ]]; then
  4. echo 'Usage: bash scripts/deploy-board-local.sh /opt/kangshifu-web' >&2
  5. exit 2
  6. fi
  7. : "${KSF_DEPLOY_AUTH_FILE:?Set this to the existing private application deployment JSON; never put a key on the command line}"
  8. cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
  9. umask 022
  10. node -e 'if(Number(process.versions.node.split(".")[0])<20)process.exit(1)'
  11. results_dir="$(mktemp -d /opt/ksf-board-local-20261111-results-XXXXXXXX)"
  12. node scripts/preflight-mime-mjs.mjs --origin https://kangshifu.fmode.cn --target-dir "$1" | tee "$results_dir/mime-preflight.json"
  13. node --test test/board-local-deploy.test.mjs test/mjs-mime-preflight.test.mjs | tee "$results_dir/deploy-tests.txt"
  14. node scripts/deploy-board-member-roster.mjs plan | tee "$results_dir/member-plan.json"
  15. node scripts/publish-board-local.mjs --target-dir "$1" | tee "$results_dir/frontend-plan.json"
  16. node scripts/deploy-board-member-roster.mjs apply | tee "$results_dir/member-apply.json"
  17. node scripts/publish-board-local.mjs --target-dir "$1" --apply | tee "$results_dir/frontend-apply.json"
  18. node scripts/publish-board-local.mjs --target-dir "$1" | tee "$results_dir/frontend-noop.json"
  19. node scripts/deploy-board-member-roster.mjs plan | tee "$results_dir/member-noop.json"
  20. node scripts/verify-board-local-public.mjs | tee "$results_dir/public-verification.json"
  21. node scripts/verify-modules.mjs https://kangshifu.fmode.cn/ --json | tee "$results_dir/module-verification.json"
  22. echo "Deployment and public read checks complete. Browser acceptance remains required. Receipts: $results_dir"