Documentation ¶
Index ¶
- Variables
- func BranchName(r *git.Repository) string
- func Bump(currentVersion *version.Version, strategy Strategy) (*version.Version, error)
- func OutputJSON(base *Base) error
- func OutputVSO(base *Base) error
- func SemverTags(r *git.Repository) (*[]Tag, error)
- type Base
- func (b Base) BranchName() string
- func (b Base) BuildMetadata() int
- func (b *Base) Bump() error
- func (b Base) Commit() string
- func (b Base) CommitDate() string
- func (b Base) FullBuildMetaData() string
- func (b Base) FullSemver() string
- func (b Base) HeadTag() bool
- func (b Base) IsDevelopBranch() bool
- func (b Base) IsFeatureBranch() bool
- func (b Base) IsMasterBranch() bool
- func (b Base) Major() int
- func (b Base) MajorMinorPatch() string
- func (b Base) Minor() int
- func (b Base) Patch() int
- func (b Base) PreReleaseLabel() string
- func (b Base) PreReleaseNumber() string
- func (b Base) Semver() string
- func (b Base) String() string
- type BaseCollection
- type Outputer
- type Outputs
- type Strategy
- type Tag
- type TagCollection
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotATag = errors.New("not a tag")
)
Errors
var (
ErrOutputNotFound = errors.New("output not found")
)
Error conditions
Functions ¶
func BranchName ¶
func BranchName(r *git.Repository) string
BranchName returns the branch name which we're on
func SemverTags ¶
func SemverTags(r *git.Repository) (*[]Tag, error)
SemverTags returns only valid semver tags
Types ¶
type Base ¶
type Base struct { *version.Version Head *object.Commit Branch string Strategy Strategy Offset int Tag Tag }
Base is a (potential) base version
func (Base) CommitDate ¶
CommitDate returns the commit date of head
func (Base) FullBuildMetaData ¶
FullBuildMetaData returns branch and SHA details
func (Base) FullSemver ¶
FullSemver returns Semver with offset in case no tags are there
func (Base) HeadTag ¶
HeadTag returns true if the tag is on the branch head Typically this means we should not Bump() the version
func (Base) IsDevelopBranch ¶
IsDevelopBranch return true if we are on the develop branch
func (Base) IsFeatureBranch ¶
IsFeatureBranch returns true if we are on a feature branch
func (Base) IsMasterBranch ¶
IsMasterBranch returns true if we are on the master branch
func (Base) MajorMinorPatch ¶
MajorMinorPatch returns the primary semver string
func (Base) PreReleaseLabel ¶
PreReleaseLabel is determined by the branch name
func (Base) PreReleaseNumber ¶
PreReleaseNumber returns the number of commits since the Base
type BaseCollection ¶
type BaseCollection []*Base
BaseCollection implements the Sortable interface
func (BaseCollection) Len ¶
func (v BaseCollection) Len() int
func (BaseCollection) Less ¶
func (v BaseCollection) Less(i, j int) bool
func (BaseCollection) Swap ¶
func (v BaseCollection) Swap(i, j int)
type Outputs ¶
type Outputs struct {
// contains filtered or unexported fields
}
Outputs holds all the output plugins
func (*Outputs) Register ¶
Register registers a Outputer by name. This is expected to happen during app startup.
func (*Outputs) Registered ¶
Registered enumerates the names of all registered plugins.
type Tag ¶
Tag holds our representation of a Tag (both annoted and lightweight)
type TagCollection ¶
type TagCollection []*Tag
TagCollection implements the Sortable interface
func (TagCollection) Len ¶
func (v TagCollection) Len() int
func (TagCollection) Less ¶
func (v TagCollection) Less(i, j int) bool
func (TagCollection) Swap ¶
func (v TagCollection) Swap(i, j int)