completed phase 2b

This commit is contained in:
2026-05-11 20:10:45 +02:00
parent 83d96d0a1e
commit 4002a3b84d
20 changed files with 1566 additions and 50 deletions
+16 -1
View File
@@ -17,6 +17,7 @@ import (
"github.com/forgeo/forgebucket/internal/api"
"github.com/forgeo/forgebucket/internal/config"
"github.com/forgeo/forgebucket/internal/db"
"github.com/forgeo/forgebucket/internal/domain/ci"
gitdomain "github.com/forgeo/forgebucket/internal/domain/git"
"github.com/forgeo/forgebucket/internal/events"
"github.com/forgeo/forgebucket/internal/models/migrations"
@@ -43,6 +44,10 @@ func main() {
gitdomain.SetRepoRoot(cfg.RepoRoot)
if err := os.MkdirAll(cfg.ArtifactRoot, 0755); err != nil {
log.Fatalf("artifact root: %v", err)
}
bus, err := events.New(cfg.NATSUrl)
if err != nil {
log.Fatalf("events: %v", err)
@@ -58,7 +63,17 @@ func main() {
SameSite: http.SameSiteLaxMode,
}
handler := api.New(cfg, engine, store, bus, web.FS())
// Start CI orchestrator and runner manager in background goroutines.
ciCtx, ciCancel := context.WithCancel(context.Background())
defer ciCancel()
orchestrator := ci.NewOrchestrator(engine, bus)
go orchestrator.Start(ciCtx)
runnerMgr := ci.NewRunnerManager(engine, bus, cfg, 4)
go runnerMgr.Start(ciCtx)
handler := api.New(cfg, engine, store, bus, cfg.ArtifactRoot, web.FS())
srv := &http.Server{
Addr: fmt.Sprintf(":%s", cfg.Port),