Documentation
¶
Overview ¶
Package git provides functionality for Git operations in Shipyard projects.
Index ¶
- func IsGitRepository(workingDir string) bool
- type GitClient
- func (g *GitClient) AddFile(filepath string) error
- func (g *GitClient) AddFiles(filepaths []string) error
- func (g *GitClient) Commit(message string) (string, error)
- func (g *GitClient) CreateTag(tagName, message string) error
- func (g *GitClient) GetCurrentBranch() (string, error)
- func (g *GitClient) GetCurrentCommit() (string, error)
- func (g *GitClient) GetLatestTag() (string, error)
- func (g *GitClient) GetTagsForPattern(pattern string) ([]string, error)
- func (g *GitClient) HasUncommittedChanges() (bool, error)
- func (g *GitClient) Push() error
- func (g *GitClient) PushTags() error
- func (g *GitClient) TagExists(tagName string) (bool, error)
- type GitOperations
- func (g *GitOperations) CommitShipmentChanges(filesToCommit []string, commitMessage string) (string, error)
- func (g *GitOperations) CreateShipmentCommitMessage(versions map[string]*semver.Version, consignmentSummaries []string) string
- func (g *GitOperations) CreateShipmentTags(versions map[string]*semver.Version, commitMessage string) (map[string]string, error)
- func (g *GitOperations) GenerateTagName(packageName string, version *semver.Version) string
- func (g *GitOperations) GetFilesToCommit(changelogPath string, packages []string) []string
- func (g *GitOperations) IsAvailable() bool
- func (g *GitOperations) PerformShipmentGitOperations(versions map[string]*semver.Version, changelogPath string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsGitRepository ¶
IsGitRepository checks if the current directory is a git repository
Types ¶
type GitClient ¶
type GitClient struct {
// contains filtered or unexported fields
}
GitClient provides git operations for shipyard using go-git
func NewGitClient ¶
NewGitClient creates a new git client
func (*GitClient) GetCurrentBranch ¶
GetCurrentBranch returns the current git branch
func (*GitClient) GetCurrentCommit ¶
GetCurrentCommit returns the current commit hash
func (*GitClient) GetLatestTag ¶
GetLatestTag returns the latest git tag
func (*GitClient) GetTagsForPattern ¶
GetTagsForPattern returns all tags matching a pattern
func (*GitClient) HasUncommittedChanges ¶
HasUncommittedChanges checks if there are uncommitted changes
type GitOperations ¶
type GitOperations struct {
// contains filtered or unexported fields
}
GitOperations provides high-level git operations for shipyard
func NewGitOperations ¶
func NewGitOperations(projectConfig *config.ProjectConfig) *GitOperations
NewGitOperations creates a new git operations manager
func NewGitOperationsWithDir ¶
func NewGitOperationsWithDir(projectConfig *config.ProjectConfig, workingDir string) *GitOperations
NewGitOperationsWithDir creates a new git operations manager with custom directory
func (*GitOperations) CommitShipmentChanges ¶
func (g *GitOperations) CommitShipmentChanges(filesToCommit []string, commitMessage string) (string, error)
CommitShipmentChanges commits shipment-related changes
func (*GitOperations) CreateShipmentCommitMessage ¶
func (g *GitOperations) CreateShipmentCommitMessage(versions map[string]*semver.Version, consignmentSummaries []string) string
CreateShipmentCommitMessage creates a commit message for a shipment
func (*GitOperations) CreateShipmentTags ¶
func (g *GitOperations) CreateShipmentTags(versions map[string]*semver.Version, commitMessage string) (map[string]string, error)
CreateShipmentTags creates git tags for a shipment
func (*GitOperations) GenerateTagName ¶
func (g *GitOperations) GenerateTagName(packageName string, version *semver.Version) string
GenerateTagName generates a git tag name for a package version
func (*GitOperations) GetFilesToCommit ¶
func (g *GitOperations) GetFilesToCommit(changelogPath string, packages []string) []string
GetFilesToCommit returns the list of files that should be committed for a shipment
func (*GitOperations) IsAvailable ¶
func (g *GitOperations) IsAvailable() bool
IsAvailable checks if git is available and we're in a git repository
func (*GitOperations) PerformShipmentGitOperations ¶
func (g *GitOperations) PerformShipmentGitOperations(versions map[string]*semver.Version, changelogPath string, consignmentSummaries []string, autoCommit, autoPush bool) error
PerformShipmentGitOperations performs all git operations for a shipment