Skip to content

feat: Builder system with plugin support #2

@nfebe

Description

@nfebe

Summary

Introduce a “builder” concept so each app directory can define pre-deployment steps. Builders can be built-in or plugin-based. Some apps may use ready images, while others will be built from source (e.g., GitHub) using a builder.

Why

Certain apps require preparation before running—compiling assets, generating keys, running migrations, packaging binaries, etc. Builders standardize this workflow in FlatRun.

Requirements

  • Builder Logic
    Encapsulate steps for specific app types. Examples:

    • npm run build / npm run dist → JS frontends
    • php artisan key:generate → Laravel
    • go build → Go projects
    • composer install → PHP apps
  • Detection

    • Explicit config in app.yml (e.g., builder: "npm")
    • Auto-detect from files (package.json, composer.json, etc.)
  • Plugin Support

    • Allow custom builders via modules or external hooks
    • Interface:
      • Detect(appDir string) bool
      • Build(appDir string) error
      • Optional: Prepare(appDir string), PostBuild(appDir string)
  • Execution & Deployment Types

    • Run in sandboxed environment
    • Clear logs via Agent UI/API
    • Failures block deployment unless overridden
    • Support dry-run mode to preview commands
    • Deployment types:
      • Ready compose files → use existing Docker images
      • Build from source and generate compose files → use a builder to generate deployment artifacts

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions