Files
AutoDeploy/docs/superpowers/plans/2026-07-03-local-auto-deploy.md
2026-07-14 16:31:23 +08:00

2.1 KiB

Local Auto Deploy Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Turn the local deployment flow from a partly executable command preview into an automatic local deploy runner.

Architecture: Keep plan generation in deploy_tool/deployer.py, but make deployment steps typed so commands that need runtime context can run without shell placeholders. The runner will build backend and frontend, copy frontend artifacts to the output directory, import SQL through stdin, locate the built jar, and start the backend process.

Tech Stack: Python standard library, unittest, subprocess, pathlib, shutil.


Task 1: Deployment Step Model

Files:

  • Modify: deploy_tool/deployer.py

  • Test: tests/test_deployer.py

  • Add tests showing SQL import steps no longer contain shell redirection and backend start no longer contains jar placeholders.

  • Add fields to DeploymentStep for kind and optional artifact metadata.

  • Update build_deployment_plan to emit executable step metadata.

  • Run python -m unittest tests.test_deployer.

Task 2: Automatic Runner

Files:

  • Modify: deploy_tool/deployer.py

  • Test: tests/test_deployer.py

  • Add tests for latest jar discovery under target or build/libs.

  • Add tests for frontend artifact copy from dist or build.

  • Add tests with an injected process runner to verify SQL stdin and backend startup command.

  • Implement helper functions and dependency injection points for process execution.

  • Run python -m unittest tests.test_deployer.

Task 3: GUI Wording and Verification

Files:

  • Modify: deploy_tool/gui.py

  • Test: python -m unittest discover -s tests

  • Update the confirmation text from partial execution to automatic local deployment.

  • Run python -m unittest discover -s tests.

  • Run python -m py_compile main.py @((Get-ChildItem -LiteralPath .\deploy_tool -Filter *.py).FullName).