Phase 25: templates as stack folders (0.31.0)
Templates are now stack-shaped folders (compose.yaml + .env.example +
template.json) instead of DB rows + manifest.json + {{VAR}} rendering.
Pull copies the folder into a new stack; custom templates persist under
DATA_DIR/templates. Adds POST /api/templates/from-stack and a one-time
startup migration for pre-0.31 DB templates (drops the template table).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
34cb215266
commit
1609b8bcc3
+8
-2
@@ -35,7 +35,7 @@ from routers import (
|
||||
volumes,
|
||||
ws,
|
||||
)
|
||||
from services import schedule_service, update_service
|
||||
from services import schedule_service, template_service, update_service
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger("stackpilot")
|
||||
@@ -50,6 +50,12 @@ async def lifespan(app: FastAPI):
|
||||
stacks.sync_discovered_stacks(session)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
logger.warning("Stack discovery failed: %s", exc)
|
||||
try:
|
||||
moved = template_service.migrate_legacy_db_templates()
|
||||
if moved:
|
||||
logger.info("Migrated %d custom template(s) from the database to folders", moved)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
logger.warning("Legacy template migration failed: %s", exc)
|
||||
update_task = asyncio.create_task(update_service.background_loop())
|
||||
schedule_task = asyncio.create_task(schedule_service.scheduler_loop())
|
||||
logger.info("StackPilot backend ready on port %s", settings.PORT)
|
||||
@@ -58,7 +64,7 @@ async def lifespan(app: FastAPI):
|
||||
schedule_task.cancel()
|
||||
|
||||
|
||||
app = FastAPI(title="StackPilot", version="0.30.0", lifespan=lifespan)
|
||||
app = FastAPI(title="StackPilot", version="0.31.0", lifespan=lifespan)
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
|
||||
Reference in New Issue
Block a user