nativeGit

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Dir_RWX_RX_R = 0754
View Source
const File_RW_RW_R = 0664

Variables

This section is empty.

Functions

func Branch

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

func CloneToTmpFs

func CloneToTmpFs(rootPath string, 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, commit *object.Commit, env string, app string) (bool, error)

func NativePush added in v0.5.3

func NativePush(repoPath string, privateKeyPath string, branch string) error

func NativeRevert

func NativeRevert(repoPath string, sha string) error

func NewCommitDirIterFromIter added in v0.5.2

func NewCommitDirIterFromIter(dir string, commitIter object.CommitIter, r *git.Repository) object.CommitIter

NewCommitPathIterFromIter returns a commit iterator which performs diffTree between successive trees returned from the commit iterator from the argument. The purpose of this is to find the commits that explain how the files that match the path came to be. If checkParent is true then the function double checks if potential parent (next commit in a path) is one of the parents in the tree (it's used by `git log --all`). pathFilter is a function that takes path of file as argument and returns true if we want it

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(
	cacheRoot string,
	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