Documentation
¶
Index ¶
- Variables
- func Checkout(repoPath string, event protocol.EventMsg) error
- func EnsureRepo(reposDir, repoName, cloneURL string) (string, error)
- func Run(ctx context.Context, cfg Config)
- func RunHook(ctx context.Context, repoPath, hook string, event protocol.EventMsg) error
- func RunHookWithOutput(ctx context.Context, repoPath, hook string, event protocol.EventMsg) (string, error)
- func StartAutoUpdater(ctx context.Context)
- type Config
- type EventHooks
- type EventicConfig
- type HookSet
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is set at build time via -ldflags "-X main.version=...". It is copied from the main package at startup.
Functions ¶
func EnsureRepo ¶
EnsureRepo clones the repo if it doesn't exist, or fetches if it does.
func RunHookWithOutput ¶
func RunHookWithOutput(ctx context.Context, repoPath, hook string, event protocol.EventMsg) (string, error)
RunHookWithOutput executes a hook and returns its combined output.
func StartAutoUpdater ¶ added in v0.2.0
StartAutoUpdater runs a background loop that checks for new releases every 5 minutes. When a newer version is found it replaces the running binary and exits so systemd (or the parent supervisor) can restart the service.
Types ¶
type Config ¶
type Config struct {
Relay string `yaml:"relay"`
Token string `yaml:"token"`
ClientID string `yaml:"client_id"`
ReposDir string `yaml:"repos_dir"`
Subscribe []string `yaml:"subscribe"`
AutoUpdate bool `yaml:"auto-update"`
GlobalHooks struct {
Pre string `yaml:"pre"`
Post string `yaml:"post"`
} `yaml:"global-hooks"`
}
type EventHooks ¶
EventHooks defines pre/post hooks for a specific event or event.action.
type EventicConfig ¶
type EventicConfig struct {
Hooks struct {
Pre string `yaml:"pre"`
Post string `yaml:"post"`
} `yaml:"hooks"`
Events map[string]EventHooks `yaml:"events"`
}
EventicConfig is the in-repo .eventic.yaml format.
Example:
hooks:
pre: "echo preparing..."
post: "echo done"
events:
push:
post: "bruce install .deploy/deploy.yml"
pull_request:
post: "make lint"
pull_request.opened:
post: "claude -p 'Review this PR' --headless"
pull_request.synchronize:
post: "make test"
release.published:
post: "/opt/scripts/notify-release.sh"
workflow_run.completed:
post: "/opt/scripts/on-build-failure.sh"
issues.opened:
post: "claude -p 'Triage this issue' --headless"
check_suite.completed:
post: "/opt/scripts/check-status.sh"
deployment_status:
post: "/opt/scripts/deploy-status.sh"
type HookSet ¶
type HookSet struct {
Pre string // global pre hook — runs for every event
Post string // global post hook — runs for every event
EventPre string // event-specific pre hook
EventPost string // event-specific post hook
}
HookSet holds all hooks resolved for a single event.
func DiscoverHooks ¶
DiscoverHooks checks the repo for .eventic.yaml or .deploy/deploy.yml and resolves global + event-specific hooks for the given event. globalPre and globalPost are fallback hooks from the client config that are used when a repo has no hooks of its own.