Documentation
¶
Index ¶
- func CloneRepo(ctx context.Context, client git.Git, url gitproviders.RepoURL, branch string) (func(), string, error)
- func CommitAndPush(ctx context.Context, client git.Git, commitMsg string, logger logger.Logger, ...) error
- type RepoWriter
- type RepoWriterSvc
- func (rw *RepoWriterSvc) CloneRepo(ctx context.Context, branch string) (func(), string, error)
- func (rw *RepoWriterSvc) CommitAndPush(ctx context.Context, commitMsg string, filters ...func(string) bool) error
- func (rw *RepoWriterSvc) CreatePullRequest(ctx context.Context, info gitproviders.PullRequestInfo) error
- func (rw *RepoWriterSvc) GetDefaultBranch(ctx context.Context) (string, error)
- func (rw *RepoWriterSvc) Remove(ctx context.Context, path string) error
- func (rw *RepoWriterSvc) Write(ctx context.Context, path string, content []byte) error
- func (rw *RepoWriterSvc) WriteAndMerge(ctx context.Context, repoDir, commitMsg string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneRepo ¶
func CloneRepo(ctx context.Context, client git.Git, url gitproviders.RepoURL, branch string) (func(), string, error)
CloneRepo uses the git client to clone the reop from the URL and branch. It clones into a temp directory and returns a function to use by the caller for cleanup. The temp directory is also returned.
Types ¶
type RepoWriter ¶
type RepoWriter interface {
CreatePullRequest(ctx context.Context, info gitproviders.PullRequestInfo) error
WriteAndMerge(ctx context.Context, repoDir, commitMsg string, manifests []automation.AutomationManifest) error
CloneRepo(ctx context.Context, branch string) (func(), string, error)
GetDefaultBranch(ctx context.Context) (string, error)
CommitAndPush(ctx context.Context, commitMsg string, filters ...func(string) bool) error
Write(ctx context.Context, path string, content []byte) error
Remove(ctx context.Context, path string) error
}
func NewRepoWriter ¶
func NewRepoWriter(url gitproviders.RepoURL, gitProvider gitproviders.GitProvider, gitClient git.Git, logger logger.Logger) RepoWriter
type RepoWriterSvc ¶
type RepoWriterSvc struct {
URL gitproviders.RepoURL
GitProvider gitproviders.GitProvider
GitClient git.Git
Logger logger.Logger
}
func (*RepoWriterSvc) CommitAndPush ¶
func (*RepoWriterSvc) CreatePullRequest ¶
func (rw *RepoWriterSvc) CreatePullRequest(ctx context.Context, info gitproviders.PullRequestInfo) error
func (*RepoWriterSvc) GetDefaultBranch ¶
func (rw *RepoWriterSvc) GetDefaultBranch(ctx context.Context) (string, error)
func (*RepoWriterSvc) Remove ¶
func (rw *RepoWriterSvc) Remove(ctx context.Context, path string) error
func (*RepoWriterSvc) WriteAndMerge ¶
func (rw *RepoWriterSvc) WriteAndMerge(ctx context.Context, repoDir, commitMsg string, manifests []automation.AutomationManifest) error
Click to show internal directories.
Click to hide internal directories.