Deployment runbook

Services, releases and checks

Last verified 8 August 2026 · source-backed

The deployed platform is a group of independent Git repositories and systemd services behind Nginx. Deploy one component at a time and verify its integration boundaries.

Current services

ServiceDirectory or executableBind
Mivama Portal/home/frappe/mivama-portal127.0.0.1:3110
Frappe web/home/frappe/frappe/frappe-bench127.0.0.1:8011
Frappe Socket.IObench runtime127.0.0.1:9001
AI Studio web/home/frappe/websitebuilder.wiaryle.com127.0.0.1:3200
Hosting runner/opt/mivama/runner/mivama_runner.pyoutbound pull
Migration gatewaymivama-migration-gateway.servicenarrow runtime endpoint
Migration workermivama-migration-worker.serviceoutbound pull/local host
Studio worker/opt/mivama/studio-workerlocal host and outbound
Documentation/var/www/docs.wiaryle.com127.0.0.1:3120
Mivama UI Storybook/var/www/mivama-ui → /var/www/mivama-ui-storybook/currentStatic Nginx route /ui/

Portal deploy

  1. Inspect Git status and preserve unrelated changes.
  2. Pull or apply the intended commit.
  3. Install dependency changes when package lock changed.
  4. Run the production Next build.
  5. Restart mivama-portal.service.
  6. Verify service log, loopback health and public login/API.

Mivama Core deploy

  1. Inspect app changes, especially DocType JSON, patches and hooks.
  2. Back up the Frappe site when schema/accounting behavior changes.
  3. Run bench migrate for the correct site.
  4. Build assets only when required.
  5. Restart/reload bench processes.
  6. Confirm scheduler and workers can import the updated methods.
  7. Exercise a read-only Portal call and inspect errors.

Runner/Ansible changes also require installing the reviewed runner/playbook release under /opt/mivama with correct permissions, then restarting its systemd service. Source commit and installed runtime must match.

Studio deploy

Build the monorepo according to its package scripts, migrate the Studio database if the schema changed, deploy both web and worker code, then restart web and privileged worker. Verify Core shared-secret calls, one launch redemption and a read-only workspace status.

Nginx and TLS

Application upstreams bind to loopback. Nginx owns public TLS, Host and forwarding headers, request size/timeouts appropriate to each surface. Always run nginx -t before reload. Certificates are issued/renewed by Certbot; the HTTP challenge path must remain reachable.

The /ui/ location is not a Next.js instruction page. It aliases the current atomic Storybook release built from the complete mivama-digital/mivama-ui checkout. mivama-ui-docs-sync.timer checks origin/main every five minutes. When the commit changes, its oneshot service performs locked dependency installation and Storybook build in a temporary release directory, verifies index.html and iframe.html, then atomically switches current. A failed build leaves the previous release online.

Release verification

Use a small proportional check:

  • systemd unit is active and not restart-looping;
  • loopback endpoint responds;
  • public hostname serves the expected certificate and status;
  • one main navigation route renders;
  • application journal has no new fatal exception.

Do not run destructive migration/provisioning flows as a deployment smoke test.