Documentation
¶
Index ¶
- type Repository
- func (repo *Repository) CompileIgnoreRegexes() error
- func (repo *Repository) FindCommitModifiedFiles(commit *gogit.Commit) error
- func (repo *Repository) FindRelevantCommits() error
- func (repo *Repository) FindUnpushedModifiedFiles() error
- func (repo *Repository) ReadConfigFile() error
- func (repo *Repository) ReadGitModifiedFiles(scanner *bufio.Scanner)
- func (repo Repository) SaveConfigToFile() error
- func (repo Repository) UpdateGitLastPushRef() error
- type S3Uploader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct { GitRepo *gogit.Repository HeadCommit *gogit.Commit LastPushCommit *gogit.Commit UnpushedFiles mapset.Set Config repoConfig IgnoreRegexes []*regexp.Regexp // contains filtered or unexported fields }
Repository represents a git-s3-push enabled git repository
func OpenRepository ¶
func OpenRepository() (*Repository, error)
OpenRepository opens and initialises a 'git-s3-push' enabled git repository
func (*Repository) CompileIgnoreRegexes ¶
func (repo *Repository) CompileIgnoreRegexes() error
CompileIgnoreRegexes compiles the regexes in the Ignore configuration directive
func (*Repository) FindCommitModifiedFiles ¶
func (repo *Repository) FindCommitModifiedFiles(commit *gogit.Commit) error
FindCommitModifiedFiles finds files modified in given commit
func (*Repository) FindRelevantCommits ¶
func (repo *Repository) FindRelevantCommits() error
FindRelevantCommits calls git to find commits not pushed to S3
func (*Repository) FindUnpushedModifiedFiles ¶
func (repo *Repository) FindUnpushedModifiedFiles() error
FindUnpushedModifiedFiles finds files that have been modified since last push to S3
func (*Repository) ReadConfigFile ¶
func (repo *Repository) ReadConfigFile() error
ReadConfigFile reads .git_s3_push configuration file from repo
func (*Repository) ReadGitModifiedFiles ¶
func (repo *Repository) ReadGitModifiedFiles(scanner *bufio.Scanner)
ReadGitModifiedFiles reads the git output describe files modified since last S3 push
func (Repository) SaveConfigToFile ¶
func (repo Repository) SaveConfigToFile() error
SaveConfigToFile marshals the current configuration to JSON and saves it to .git_s3_push
func (Repository) UpdateGitLastPushRef ¶
func (repo Repository) UpdateGitLastPushRef() error
UpdateGitLastPushRef sets the git-s3-push branch to the latest commit pushed
type S3Uploader ¶
type S3Uploader struct {
// contains filtered or unexported fields
}
S3Uploader manages S3 uploads to a specific bucket
func InitS3Uploader ¶
func InitS3Uploader(config repoConfig) (*S3Uploader, error)
InitS3Uploader initializes a new S3Uploader
func (S3Uploader) Close ¶ added in v0.2.0
func (uploader S3Uploader) Close()
Close cleans up the uploader
func (S3Uploader) UploadFile ¶
func (uploader S3Uploader) UploadFile(path string) error
UploadFile uploads a file to S3