Skip to content

Git Branches & Deployments (DEV / PROD)

You do not manually upload files or build apps over SSH on the VPS. Pushing or merging to the tracked Git branches triggers vps-deployer (:9000) automatically.

How Code Reaches DEV, PROD & Live Docs πŸ”„ Hybrid Sync (Layout Preserved)
How Code Reaches DEV, PROD & Live Docs How Code Reaches DEV, PROD & Live Docs
How Code Reaches DEV, PROD & Live Docs
How Code Reaches DEV, PROD & Live Docs How Code Reaches DEV, PROD & Live Docs

Branch β†’ Environment Mapping

Git BranchTarget EnvironmentWhat Happens Automatically
develop or devDEV (dev-*.planovi.app)vps-deployer pulls into /opt/vps-apps/<repo>/dev, runs service build hook, reloads Nginx, posts status to Google Chat.
mainPROD (*.planovi.app)vps-deployer pulls into /opt/vps-apps/<repo>/prod, runs service build hook, reloads Nginx, posts status to Google Chat, and triggers docs-sync to update the Rolling Docs PR.
Feature branches (feat/*, fix/*)NoneOpen a PR into develop (or dev for planovi-converter) first, verify on DEV, then merge to main.

What vps-deployer Builds Automatically Per Repo

RepositoryAutomated Post-Deploy BuildCritical Gotchas to Know
planovi-flutter-appReads .fvmrc (3.44.8) β†’ validates & injects /opt/vps-apps/flutter-app/{dev,prod}.public.env β†’ compiles flutter build web --release.Deploy aborts if .fvmrc is missing or if *.public.env contains any secret key (SERVICE_ROLE, SECRET, PASSWORD, API_KEY).
planovi-backendRuns rsync -av --delete supabase/functions/ β†’ /opt/vps-stack/supabase/functions-{dev,prod} β†’ restarts supabase-edge-runtime-{dev,prod}.SQL migrations are NOT auto-applied by vps-deployer β€” apply DB migrations intentionally against DEV first, then PROD.
planovi-converterRebuilds converters-api-{dev,prod} container β†’ rebuilds mTLS ingress β†’ compiles Flutter admin/ web panel β†’ compiles & signs ARM firmware (planovi-firmware-builder).Takes ~2–4 minutes because it compiles both Flutter Web and ARM C/C++ firmware.
planovi-microservicesBind-mounted directly into php-app container β†’ reloads Nginx DNS cache.Instant deploy (~5 seconds).
planovi-webpageBind-mounted directly into php-app container β†’ reloads Nginx DNS cache.Instant deploy (~5 seconds).
planovi-docsConnected directly to Cloudflare Pages (not vps-deployer).Every PR gets a Cloudflare Pages Preview URL; merging to main publishes live to docs.planovi.app in ~1 minute.

Auto-Rollback & Notifications

  • Before pulling new code, vps-deployer snapshots old_commit = git rev-parse HEAD.
  • If any step fails (Dart compile error, invalid .fvmrc, broken Docker build), vps-deployer automatically executes git reset --hard <old_commit> and posts the extracted error lines directly to Google Chat.
  • Only one deploy runs at a time (_deploy_lock), so concurrent pushes queue safely.

Documentation (Latest = PROD), DEV vs PROD & Versioning Rules

There is one documentation portal (docs.planovi.app / dev-docs.planovi.app), and Latest always reflects PROD (main) β€” never half-finished experiments from develop / dev:

  • DEV pushes (develop / dev) deploy to dev-*.planovi.app and do not trigger docs-sync. Environment differences (dev-* domains, *-dev containers, *_DEV secrets) are documented side-by-side inside this portal.
  • PROD pushes (main) trigger docs-sync asynchronously, which runs run-sync β†’ check-secrets β†’ astro build and opens/updates a single Rolling PR (docs/auto-sync β†’ main) in PA-IDEAS/planovi-docs. Cloudflare Pages attaches a live Preview URL to every PR for review before 1-click merge.

Developer Rules for Commits, Releases & Tagging

  1. Tag Only main (Never develop or Feature Branches):
    • docs-sync reads production checkouts (/opt/vps-apps/*/prod + /opt/vps-stack), so Git release tags must always point to a commit already merged and deployed on main.
  2. Use vMAJOR.MINOR Format for Milestone Releases (v1.0, v1.1, v2.0):
    • vps-deployer forwards refs/tags/v* webhooks directly to docs-sync (without re-running an app deploy) to freeze an immutable version snapshot (/repos/<repo>/vXY/) + auto-generated Release Notes.
    • Tag milestones, not tiny fixes: create a new tag when closing a milestone, changing BR-* business rules, shipping a major module, changing API/DB contracts, or releasing new mobile/firmware versions. Avoid tagging routine typos or CSS hotfixes so the version switcher stays clean.
  3. Follow the 3-Step Release Order (Prevent Stale Snapshots):
    1. Merge code to main β†’ vps-deployer deploys PROD β†’ docs-sync updates the Rolling PR (docs/auto-sync) in planovi-docs.
    2. Review & merge docs/auto-sync (updating any changed BR-* business rules if needed) so Latest reflects the new behavior.
    3. Push the release tag on main to freeze the updated docs into the immutable version snapshot:
      Terminal window
      git checkout main && git pull
      git tag -a v1.1 -m "Release v1.1: concise summary of changes"
      git push origin v1.1
  4. Use Conventional Commits (feat(scope):, fix(scope):, refactor(scope):):
    • snapshot.mjs pulls commit subjects directly into each version’s Release Notes, and docs-sync uses commit history to identify affected business rules. When changing a BR-* rule, include a 1-sentence why in the PR description.
  5. Single Source of Truth & Secret Hygiene:
    • Never create local docs/ directories inside service repositories β€” all docs live in PA-IDEAS/planovi-docs.
    • Never commit real secret values in .env.example or code (all secrets live in PA Management β†’ Loginy and /opt/vps-stack/.env; docs-sync blocks PRs if check-secrets detects a leak).
  6. Excalidraw+ Diagrams Hygiene:
    • Feel free to rearrange and polish layouts in the Planovi collection inside Excalidraw+ β€” the 6-hour periodic sync pulls your manual layout into planovi-docs without overwriting it.
    • Keep the [PLANOVI] title prefix on managed scenes so docs-sync stays matched to diagrams/manifest.json.

Roadmap Note (Global Platform Versioning): Currently each repository versions its own documentation tab independently (vX.Y tags per repo). In a future phase, global platform-level release snapshots will automatically capture and link historical versions across all repositories together whenever a platform milestone is cut.