Documentation ¶
Index ¶
- Variables
- func ArtifactCommitMessage(service, artifactID, author string) string
- func BranchFromHead(ctx context.Context, repo *git.Repository, artifactFileName, svc string) (string, error)
- func BranchName(modifiedFiles []string, artifactFileName, svc string) (string, bool)
- func CommitterDetails() (string, string, error)
- func PolicyUpdateApplyCommitMessage(env, service, branch, policy string) string
- func PolicyUpdateDeleteCommitMessage(service string) string
- func ReleaseCommitMessage(env, service, artifactID string) string
- func RollbackCommitMessage(env, service, oldArtifactID, newArtifactID string) string
- func TempDir(prefix string) (string, func(), error)
- type Service
- func (*Service) Checkout(r *git.Repository, hash plumbing.Hash) error
- func (s *Service) Clone(ctx context.Context, destination string) (*git.Repository, error)
- func (s *Service) Commit(ctx context.Context, repo *git.Repository, ...) error
- func (s *Service) InitMasterRepo() (func(), error)
- func (*Service) LocateArtifact(r *git.Repository, artifactID string) (plumbing.Hash, error)
- func (*Service) LocateArtifacts(r *git.Repository, service string, n int) ([]plumbing.Hash, error)
- func (*Service) LocateEnvRelease(r *git.Repository, env, artifactID string) (plumbing.Hash, error)
- func (*Service) LocateRelease(r *git.Repository, artifactID string) (plumbing.Hash, error)
- func (*Service) LocateServiceRelease(r *git.Repository, env, service string) (plumbing.Hash, error)
- func (*Service) LocateServiceReleaseRollbackSkip(r *git.Repository, env, service string, n uint) (plumbing.Hash, error)
- func (s *Service) SyncMaster() error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ArtifactCommitMessage ¶ added in v0.0.4
ArtifactCommitMessage returns an artifact commit message.
func BranchFromHead ¶ added in v0.0.16
func BranchFromHead(ctx context.Context, repo *git.Repository, artifactFileName, svc string) (string, error)
BranchFromHead reutrns the branch name from the current HEAD commit.
It only handles files that originates from a build operation, ie. non-build commits cannot be extracted.
func BranchName ¶ added in v0.0.16
BranchName returns the branch name and a bool indicating one is found from a list of modified file paths.
It only handles files that originates from a build operation, ie. non-build commits cannot be extracted.
func CommitterDetails ¶
CommitterDetails returns name and email read for a Git configuration file.
Configuration files are read first in the local git repository (if available) and then read the global Git configuration.
func PolicyUpdateApplyCommitMessage ¶ added in v0.0.4
PolicyUpdateApplyCommitMessage returns an apply policy commit message.
func PolicyUpdateDeleteCommitMessage ¶ added in v0.0.4
PolicyUpdateDeleteCommitMessage returns a delete policy commit message.
func ReleaseCommitMessage ¶ added in v0.0.4
ReleaseCommitMessage returns an artifact release commit message.
func RollbackCommitMessage ¶ added in v0.0.10
RollbackCommitMessage returns an artifact rollback commit message.
Types ¶
type Service ¶ added in v0.0.27
type Service struct { SSHPrivateKeyPath string ConfigRepoURL string // contains filtered or unexported fields }
func (*Service) Clone ¶ added in v0.0.27
Clone returns a Git repository copy from the master repository.
func (*Service) InitMasterRepo ¶ added in v0.0.27
InitMasterRepo clones the configuration repository into a master directory.
func (*Service) LocateArtifact ¶ added in v0.0.27
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 (*Service) LocateArtifacts ¶ added in v0.0.33
LocateArtifacts traverses the git log to find artifact commits for a service.
It expects the commit to have a commit messages as the one returned by ArtifactCommitMessage.
func (*Service) LocateEnvRelease ¶ added in v0.0.27
LocateEnvRelease traverses the git log to find a release commit for a specified environment and artifactID.
It expects the commit to have a commit messages as the one returned by ReleaseCommitMessage.
func (*Service) LocateRelease ¶ added in v0.0.27
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 (*Service) LocateServiceRelease ¶ added in v0.0.27
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 (*Service) LocateServiceReleaseRollbackSkip ¶ added in v0.0.27
func (*Service) 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 (*Service) SyncMaster ¶ added in v0.0.27
SyncMaster pulls latest changes from master repo.