34 lines
961 B
Go
34 lines
961 B
Go
// Package deploy delivers generated BIRD fragments to evobgp-agent / publishes signed bundles for evobgp-node.
|
|
package deploy
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
"os"
|
|
"strings"
|
|
"time"
|
|
|
|
"evobgp/internal/broker"
|
|
"evobgp/internal/config"
|
|
)
|
|
|
|
// Run blocks until ctx is cancelled. Reference deployment: worker after render, talks to agent API or shared volume.
|
|
func Run(ctx context.Context) {
|
|
cfg := config.Load()
|
|
broker.LogConnect(ctx, cfg.BrokerURL)
|
|
if d := strings.TrimSpace(os.Getenv("EVOBGP_BIRD_ACTIVE_DIR")); d != "" {
|
|
log.Printf("evobgp-deploy: EVOBGP_BIRD_ACTIVE_DIR=%q (apply handled by API jobs + birddeploy when set on API)", d)
|
|
}
|
|
t := time.NewTicker(60 * time.Second)
|
|
defer t.Stop()
|
|
log.Printf("evobgp-deploy: started (orchestration stub; two-phase apply runs in evobgp-api/evobgp-all job worker when EVOBGP_BIRD_ACTIVE_DIR is set)")
|
|
for {
|
|
select {
|
|
case <-ctx.Done():
|
|
log.Printf("evobgp-deploy: stopped")
|
|
return
|
|
case <-t.C:
|
|
}
|
|
}
|
|
}
|