git

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNothingToCommit  = errors.New("nothing to commit")
	ErrReleaseNotFound  = errors.New("release not found")
	ErrArtifactNotFound = errors.New("artifact not found")
)

Functions

func ArtifactCommitMessage added in v0.0.4

func ArtifactCommitMessage(service, artifactID, author string) string

ArtifactCommitMessage returns an artifact commit message.

func Checkout

func Checkout(r *git.Repository, hash plumbing.Hash) error

func Clone

func Clone(ctx context.Context, repoURL, destination, sshPrivateKeyPath string) (*git.Repository, error)

func CloneDepth

func CloneDepth(ctx context.Context, repoURL, destination, sshPrivateKeyPath string, depth int) (*git.Repository, error)

func Commit

func Commit(ctx context.Context, repo *git.Repository, changesPath, authorName, authorEmail, committerName, committerEmail, msg, sshPrivateKeyPath string) error

func CommitterDetails

func CommitterDetails() (string, string, error)

func GlobalConfig

func GlobalConfig() (config.Config, error)

GlobalConfig returns the global Git configuration read from the user home directory.

func LocateArtifact added in v0.0.2

func LocateArtifact(r *git.Repository, artifactID string) (plumbing.Hash, error)

LocateArtifact traverses the git log to find an artifact commit with id artifactID.

It expects the commit to have a commit messages as the one returned by ArtifactCommitMessage.

func LocateRelease

func LocateRelease(r *git.Repository, artifactID string) (plumbing.Hash, error)

LocateRelease traverses the git log to find a release commit with id artifactID.

It expects the commit to have a commit messages as the one returned by ReleaseCommitMessage.

func LocateServiceRelease added in v0.0.10

func LocateServiceRelease(r *git.Repository, env, service string) (plumbing.Hash, error)

LocateServiceRelease traverses the git log to find a release commit for a specified service and environment.

It expects the commit to have a commit messages as the one returned by ReleaseCommitMessage.

func LocateServiceReleaseRollbackSkip added in v0.0.10

func LocateServiceReleaseRollbackSkip(r *git.Repository, env, service string, n uint) (plumbing.Hash, error)

LocateServiceReleaseRollbackSkip traverses the git log to find a release or rollback commit for a specified service and environment.

It expects the commit to have a commit messages as the one returned by ReleaseCommitMessage or RollbackCommitMessage.

func PolicyUpdateApplyCommitMessage added in v0.0.4

func PolicyUpdateApplyCommitMessage(env, service, branch, policy string) string

PolicyUpdateApplyCommitMessage returns an apply policy commit message.

func PolicyUpdateDeleteCommitMessage added in v0.0.4

func PolicyUpdateDeleteCommitMessage(service string) string

PolicyUpdateDeleteCommitMessage returns a delete policy commit message.

func ReleaseCommitMessage added in v0.0.4

func ReleaseCommitMessage(env, service, artifactID string) string

ReleaseCommitMessage returns an artifact release commit message.

func RollbackCommitMessage added in v0.0.10

func RollbackCommitMessage(env, service, oldArtifactID, newArtifactID string) string

RollbackCommitMessage returns an artifact rollback commit message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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