nativeGit

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branch

func Branch(repo *git.Repository, ref string) error

func CloneToTmpFs

func CloneToTmpFs(repoName string, privateKeyPath string) (string, *git.Repository, error)

func Commit

func Commit(repo *git.Repository, message string) (string, error)

func CommitFilesToGit

func CommitFilesToGit(
	repo *git.Repository,
	files map[string]string,
	env string,
	app string,
	message string,
	releaseString string,
) (string, error)

func Content

func Content(repo *git.Repository, path string) (string, error)

Content returns the content of a file

func DelDir

func DelDir(repo *git.Repository, path string) error

func DeleteCommit

func DeleteCommit(c *object.Commit) bool

func Envs

func Envs(
	repo *git.Repository,
) ([]string, error)

func Folder

func Folder(repo *git.Repository, path string) (map[string]string, error)

Folder returns the file contents of a folder (non-recursive)

func HasBeenReverted

func HasBeenReverted(repo *git.Repository, sha string, env string, app string) (bool, error)

func NativeRevert

func NativeRevert(repoPath string, sha string) error

func NothingToCommit

func NothingToCommit(repo *git.Repository) (bool, error)

func Push

func Push(repo *git.Repository, privateKeyPath string) error

func Releases

func Releases(
	repo *git.Repository,
	app, env string,
	since, until *time.Time,
	limit int,
	gitRepo string,
) ([]*dx.Release, error)

func RollbackCommit

func RollbackCommit(c *object.Commit) bool

func StageFolder

func StageFolder(repo *git.Repository, folder string) error

func Status

func Status(
	repo *git.Repository,
	app, env string,
	perf *prometheus.HistogramVec,
) (map[string]*dx.Release, error)

func TmpFsCleanup

func TmpFsCleanup(path string) error

Types

type GitopsRepoCache

type GitopsRepoCache struct {
	// contains filtered or unexported fields
}

func NewGitopsRepoCache

func NewGitopsRepoCache(
	gitopsRepo string,
	gitopsRepoDeployKeyPath string,
	stopCh chan struct{},
) (*GitopsRepoCache, error)

func (*GitopsRepoCache) CleanupWrittenRepo

func (r *GitopsRepoCache) CleanupWrittenRepo(path string) error

func (*GitopsRepoCache) InstanceForRead

func (r *GitopsRepoCache) InstanceForRead() *git.Repository

func (*GitopsRepoCache) InstanceForWrite

func (r *GitopsRepoCache) InstanceForWrite() (*git.Repository, string, error)

func (*GitopsRepoCache) Invalidate

func (r *GitopsRepoCache) Invalidate()

func (*GitopsRepoCache) Run

func (r *GitopsRepoCache) Run()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL