Documentation ¶
Index ¶
- Variables
- type ManagedGitRepo
- type Service
- func (s *Service) CheckoutBranch() pipeline.ActionFunc
- func (s *Service) CloneGitRepository() pipeline.ActionFunc
- func (s *Service) Commit() pipeline.ActionFunc
- func (s *Service) CreateOrUpdatePr(config *cfg.PullRequestConfig) pipeline.ActionFunc
- func (s *Service) Diff() pipeline.ActionFunc
- func (s *Service) DirExists(path string) bool
- func (s *Service) EnabledCheckout() pipeline.Predicate
- func (s *Service) EnabledCommit() pipeline.Predicate
- func (s *Service) EnabledPr() pipeline.Predicate
- func (s *Service) EnabledPush() pipeline.Predicate
- func (s *Service) EnabledReset() pipeline.Predicate
- func (s *Service) Fetch() pipeline.ActionFunc
- func (s *Service) GetDefaultBranch() pipeline.ActionFunc
- func (s *Service) Pull() pipeline.ActionFunc
- func (s *Service) PushToRemote() pipeline.ActionFunc
- func (s *Service) ResetRepository() pipeline.ActionFunc
Constants ¶
This section is empty.
Variables ¶
var (
GitBin = "git"
)
var (
// ManagedReposFileName is the base file name where managed git repositories config is searched.
ManagedReposFileName = "managed_repos.yml"
)
Functions ¶
This section is empty.
Types ¶
type ManagedGitRepo ¶
type ManagedGitRepo struct {
Name string
}
ManagedGitRepo is the representation of the managed git repos in the config file.
type Service ¶
Service represents a git repository that comes with utility methods
func NewServicesFromFile ¶
func NewServicesFromFile(config *cfg.Configuration) []*Service
NewServicesFromFile parses a config file with managed git repositories and provides a Service for each.
func (*Service) CheckoutBranch ¶
func (s *Service) CheckoutBranch() pipeline.ActionFunc
CheckoutBranch invokes git to checkout the configured commit branch.
func (*Service) CloneGitRepository ¶
func (s *Service) CloneGitRepository() pipeline.ActionFunc
CloneGitRepository invokes git to clone the repository.
func (*Service) Commit ¶
func (s *Service) Commit() pipeline.ActionFunc
Commit invokes git to stage all files and commit to the current branch.
func (*Service) CreateOrUpdatePr ¶
func (s *Service) CreateOrUpdatePr(config *cfg.PullRequestConfig) pipeline.ActionFunc
CreateOrUpdatePr creates a PR if it doesn't exist or updates if the remote branch exists already.
func (*Service) Diff ¶
func (s *Service) Diff() pipeline.ActionFunc
Diff invokes git to show the changes between HEAD and previous commit.
func (*Service) EnabledCheckout ¶
EnabledCheckout returns true if the git branch should be checked out.
func (*Service) EnabledCommit ¶
EnabledCommit returns true if commits are enabled.
func (*Service) EnabledPush ¶
EnabledPush returns true if git pushes are enabled.
func (*Service) EnabledReset ¶
EnabledReset returns true if git reset is enabled.
func (*Service) Fetch ¶
func (s *Service) Fetch() pipeline.ActionFunc
Fetch invokes git to fetch remote references.
func (*Service) GetDefaultBranch ¶
func (s *Service) GetDefaultBranch() pipeline.ActionFunc
GetDefaultBranch invokes git and parses the output to determine the default branch in origin.
func (*Service) Pull ¶
func (s *Service) Pull() pipeline.ActionFunc
Pull invokes git to pull the latest commits from origin.
func (*Service) PushToRemote ¶
func (s *Service) PushToRemote() pipeline.ActionFunc
PushToRemote invokes git to push the commits to origin.
func (*Service) ResetRepository ¶
func (s *Service) ResetRepository() pipeline.ActionFunc
ResetRepository invokes git to reset the git repository to discard local changes.