githelper

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 Envs added in v0.2.0

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

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 RemoteHasChanges added in v0.3.1

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

func RollbackCommit

func RollbackCommit(c *object.Commit) bool

func StageFolder

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

func Status added in v0.2.0

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 RepoCache added in v0.3.1

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

func NewRepoCache added in v0.3.1

func NewRepoCache(
	gitopsRepo string,
	gitopsRepoDeployKeyPath string,
	stopCh chan struct{},
) (*RepoCache, error)

func (*RepoCache) InstanceForRead added in v0.3.1

func (w *RepoCache) InstanceForRead() *git.Repository

func (*RepoCache) Invalidate added in v0.3.1

func (w *RepoCache) Invalidate()

func (*RepoCache) Run added in v0.3.1

func (w *RepoCache) Run()

Jump to

Keyboard shortcuts

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