Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConfig ¶
FindConfig searches for cidx TOML config files in common locations
Types ¶
type Action ¶
type Action struct {
Description string `toml:"description"`
Image string `toml:"image"`
Command string `toml:"command"`
Entrypoint []string `toml:"entrypoint"` // Override container entrypoint
Workdir string `toml:"workdir"`
Volumes []string `toml:"volumes"`
Env map[string]string `toml:"env"`
AutoPush bool `toml:"auto_push"`
PushTags bool `toml:"push_tags"`
WatchWorkflow bool `toml:"watch_workflow"`
}
Action represents an automated workflow configuration
type BranchConfig ¶
type BranchConfig struct {
StaleDays int `toml:"stale_days"` // Days before a branch is considered stale (default: 30)
NamingPattern string `toml:"naming_pattern"` // Regex pattern for valid branch names
AutoCleanup bool `toml:"auto_cleanup"` // Cleanup merged branches after PR merge
Protected []string `toml:"protected"` // Branches that should never be deleted
}
BranchConfig defines branch management settings
type Config ¶
type Config struct {
Phases map[string]Phase `toml:",inline"`
Pipelines map[string]Pipeline `toml:"pipelines"`
Actions map[string]Action `toml:"actions"`
Branch BranchConfig `toml:"branch"`
Release ReleaseConfig `toml:"release"`
Tag TagConfig `toml:"tag"`
Provider ProviderConfig `toml:"provider"`
Overrides map[string]map[string]interface{} `toml:",inline"`
Workspace string // Auto-detected or from env
}
Config represents the complete CIDX configuration
type ContainerConfig ¶
type ContainerConfig struct {
Name string
Phase string
Image string
Command string
Entrypoint []string // Override container entrypoint
Workdir string
Volumes []string
Env map[string]string
ConfigFiles []string
Privileged bool // Requires root privileges
}
ContainerConfig represents a fully resolved container configuration after merging preset + overrides
type Phase ¶
type Phase struct {
Containers []string `toml:"containers"`
}
Phase defines containers for a specific phase
type Pipeline ¶
type Pipeline struct {
Phases []string `toml:"phases"`
}
Pipeline defines a sequence of phases to execute
type ProviderConfig ¶ added in v1.2.1
type ProviderConfig struct {
// Type is the provider type: "github", "gitlab", or "" (auto-detect)
Type string `toml:"type"`
// URL is the base URL for self-hosted instances (e.g., "https://gitlab.mycompany.com")
URL string `toml:"url"`
}
ProviderConfig defines git remote provider settings (GitHub, GitLab)
type ReleaseConfig ¶ added in v1.2.1
type ReleaseConfig struct {
// MainBranch is the branch where releases are created (default: "main")
MainBranch string `toml:"main_branch"`
// AllowReleaseFromAnyBranch allows creating releases from any branch (default: false)
// When false, releases can only be created from MainBranch
AllowReleaseFromAnyBranch bool `toml:"allow_release_from_any_branch"`
// RequirePrepare requires running 'release prepare' before 'release create' (default: false)
// When true, releases cannot be created without prepared notes
RequirePrepare bool `toml:"require_prepare"`
// AutoCleanup automatically removes .cidx/release-* files after successful release (default: true)
AutoCleanup bool `toml:"auto_cleanup"`
// Editor is the command to open release notes for editing (default: $EDITOR or "vim")
Editor string `toml:"editor"`
// NotesTemplate is a custom template for release notes (optional)
NotesTemplate string `toml:"notes_template"`
}
ReleaseConfig defines release workflow settings
func DefaultReleaseConfig ¶ added in v1.2.1
func DefaultReleaseConfig() ReleaseConfig
DefaultReleaseConfig returns a ReleaseConfig with sensible defaults
func (*ReleaseConfig) GetEditor ¶ added in v1.2.1
func (r *ReleaseConfig) GetEditor() string
GetEditor returns the editor command with fallback to $EDITOR or "vim"
func (*ReleaseConfig) GetMainBranch ¶ added in v1.2.1
func (r *ReleaseConfig) GetMainBranch() string
GetMainBranch returns the main branch name with fallback to "main"
type TagConfig ¶ added in v1.2.1
type TagConfig struct {
// Prefix for version tags (default: "v")
// Examples: "v" → v1.2.3, "" → 1.2.3, "release-" → release-1.2.3
Prefix string `toml:"prefix"`
// Pattern is a regex pattern for valid tag names (optional)
// Default allows semver with optional prefix: ^v?\d+\.\d+\.\d+.*$
Pattern string `toml:"pattern"`
// UseCommitizen uses commitizen to determine next version (default: true)
// When true: runs "cz bump --dry-run" to get suggested version
// When false: increments patch version from last tag
UseCommitizen bool `toml:"use_commitizen"`
// AutoPush automatically pushes tags after creation (default: true)
AutoPush bool `toml:"auto_push"`
// SignTags signs tags with GPG (default: false)
SignTags bool `toml:"sign_tags"`
// RequireAnnotated requires annotated tags with message (default: true)
// When true: creates annotated tags with -a -m flags
// When false: allows lightweight tags
RequireAnnotated bool `toml:"require_annotated"`
// ProtectedTags is a list of tag patterns that cannot be deleted
// Supports glob patterns: ["v1.*", "release-*"]
ProtectedTags []string `toml:"protected_tags"`
// LinkedToRelease indicates if tags trigger release workflow (default: true)
// When true: pushing a tag triggers the release pipeline
LinkedToRelease bool `toml:"linked_to_release"`
}
TagConfig defines tag workflow settings
func DefaultTagConfig ¶ added in v1.2.1
func DefaultTagConfig() TagConfig
DefaultTagConfig returns a TagConfig with sensible defaults
type ValidationResult ¶
ValidationResult contains validation results