Documentation ¶
Index ¶
- Variables
- func CommitterDetails() (string, string, error)
- func TempDir(ctx context.Context, tracer tracing.Tracer, prefix string) (string, func(context.Context), error)
- func TempDirAsync(ctx context.Context, tracer tracing.Tracer, prefix string) (string, func(context.Context), error)
- type GitConfig
- type Service
- func (s *Service) Checkout(ctx context.Context, rootPath string, hash plumbing.Hash) error
- func (s *Service) Clone(ctx context.Context, destination string) (*git.Repository, error)
- func (s *Service) Commit(ctx context.Context, rootPath, changesPath, msg string) error
- func (s *Service) InitMasterRepo(ctx context.Context) (func(context.Context), error)
- func (s *Service) LocateEnvRelease(ctx context.Context, r *git.Repository, env, artifactID string) (plumbing.Hash, error)
- func (s *Service) LocateRelease(ctx context.Context, r *git.Repository, artifactID string) (plumbing.Hash, error)
- func (s *Service) LocateServiceRelease(ctx context.Context, r *git.Repository, env, service string) (plumbing.Hash, error)
- func (s *Service) LocateServiceReleaseRollbackSkip(ctx context.Context, r *git.Repository, env, service string, n uint) (plumbing.Hash, error)
- func (s *Service) MasterPath() string
- func (s *Service) SignedCommit(ctx context.Context, ...) error
- func (s *Service) SyncMaster(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CommitterDetails ¶
CommitterDetails returns name and email read for a Git configuration file.
Fetching the configuration values are delegated to the git CLI and follows precedence rules defined by Git.
func TempDir ¶ added in v0.0.26
func TempDir(ctx context.Context, tracer tracing.Tracer, prefix string) (string, func(context.Context), error)
TempDir returns a temporary directory with provided prefix. The first return argument is the path. The second is a close function to remove the path.
func TempDirAsync ¶ added in v0.0.44
func TempDirAsync(ctx context.Context, tracer tracing.Tracer, prefix string) (string, func(context.Context), error)
TempDirSync returns a temporary directory with provided prefix. The first return argument is the path. The second is a close function to remove the path asynchronously.
Types ¶
type Service ¶ added in v0.0.27
type Service struct { Tracer tracing.Tracer SSHPrivateKeyPath string ConfigRepoURL string Config *GitConfig ArtifactFileName 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) LocateEnvRelease ¶ added in v0.0.27
func (s *Service) LocateEnvRelease(ctx context.Context, r *git.Repository, env, artifactID string) (plumbing.Hash, error)
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
func (s *Service) LocateRelease(ctx context.Context, 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 (*Service) LocateServiceRelease ¶ added in v0.0.27
func (s *Service) LocateServiceRelease(ctx context.Context, 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 (*Service) LocateServiceReleaseRollbackSkip ¶ added in v0.0.27
func (s *Service) LocateServiceReleaseRollbackSkip(ctx context.Context, r *git.Repository, env, service string, n uint) (plumbing.Hash, error)
LocateServiceReleaseRollbackSkip traverses the git log to find the nth 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.