Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookConfig ¶
type HookConfig struct {
Name string `yaml:"name"`
Type string `yaml:"type"` // "builtin" or "command"
Command string `yaml:"command"` // for type=command
WorkingDir string `yaml:"working_dir"` // optional working directory
Args []string `yaml:"args"` // arguments for the command
Config map[string]string `yaml:"config"` // configuration for builtin hooks
Required bool `yaml:"required"` // whether failure should block operation
}
HookConfig represents a single hook configuration
type HookContext ¶
type HookContext struct {
Branch string
Environment string
UserEmail string
UserName string
BaseBranch string
}
HookContext provides context to hook execution
type HookExecutor ¶
type HookExecutor struct {
// contains filtered or unexported fields
}
HookExecutor handles hook execution
func NewHookExecutor ¶
func NewHookExecutor(config *HooksConfig) *HookExecutor
NewHookExecutor creates a new hook executor
func (*HookExecutor) ExecuteHooks ¶
func (he *HookExecutor) ExecuteHooks(ctx context.Context, hookType HookType, hookCtx HookContext) []HookResult
ExecuteHooks executes hooks of a specific type
type HookResult ¶
type HookResult struct {
Hook HookConfig
Success bool
Output string
Error error
}
HookResult represents the result of hook execution
type HooksConfig ¶
type HooksConfig struct {
PrePromote []HookConfig `yaml:"pre-promote"`
PostPromote []HookConfig `yaml:"post-promote"`
PreRelease []HookConfig `yaml:"pre-release"`
PostRelease []HookConfig `yaml:"post-release"`
}
HookConfig represents the complete hook configuration
func LoadConfig ¶
func LoadConfig(meta *metadata.Metadata) (*HooksConfig, error)
LoadConfig loads hook configuration from metadata
Click to show internal directories.
Click to hide internal directories.