Documentation ¶
Index ¶
- Constants
- Variables
- func LocateRelease(validator func(CommitInfo) bool) conditionFunc
- func PolicyUpdateApplyCommitMessage(env, service, policy string) string
- func PolicyUpdateDeleteCommitMessage(service string) string
- func ReleaseCommitMessage(env, service, artifactID string, intent intent.Intent, ...) string
- type CommitInfo
- type ConventionalCommitInfo
- type Field
- type PersonInfo
Constants ¶
View Source
const ( FieldService = "Service" FieldEnvironment = "Environment" FieldArtifactID = "Artifact-ID" FieldArtifactReleasedBy = "Artifact-released-by" FieldArtifactCreatedBy = "Artifact-created-by" )
View Source
const ( FieldReleaseIntent = "Release-intent" FieldRollbackOfArtifactId = "Rollback-of-artifact-id" FieldReleaseOfBranch = "Release-of-branch" FieldPromotedFromEnvironment = "Promoted-from-environment" )
Variables ¶
View Source
var (
ErrNoMatch = fmt.Errorf("no match")
)
Functions ¶
func LocateRelease ¶
func LocateRelease(validator func(CommitInfo) bool) conditionFunc
func PolicyUpdateApplyCommitMessage ¶
PolicyUpdateApplyCommitMessage returns an apply policy commit message.
func PolicyUpdateDeleteCommitMessage ¶
PolicyUpdateDeleteCommitMessage returns a delete policy commit message.
func ReleaseCommitMessage ¶
func ReleaseCommitMessage(env, service, artifactID string, intent intent.Intent, artifactAuthor, releaseAuthor PersonInfo) string
ReleaseCommitMessage returns an artifact release commit message.
Types ¶
type CommitInfo ¶
type CommitInfo struct { ArtifactID string ArtifactCreatedBy PersonInfo ReleasedBy PersonInfo Service string Environment string Intent intent.Intent }
func ParseCommitInfo ¶
func ParseCommitInfo(commitMessage string) (CommitInfo, error)
ParseCommitInfo takes a full git commit message in the ConventionalCommit format and tries to extract release information from it It will extract it using conventional commit fields first, but if the correct fields isn't there it will fallback to parsing message for backward compatability reasons. The following backward-compatibility actions are done in the parsing (if not found in the fields!):
- If `artifact` is written in title, the commit info is considered a "no match"
- If `rollback` is written in title, the Intent is considered to be rollback intent, as well as the PreviousArtifactID is attempted to be extracted
- Environment and Service name is extracted from the `[<env>/<service>]`-brackets in the title
- User email in title is interpreted as releaser
func (CommitInfo) String ¶
func (i CommitInfo) String() string
type ConventionalCommitInfo ¶
func ParseConventionalCommit ¶
func ParseConventionalCommit(commitMessage string) (ConventionalCommitInfo, error)
func (ConventionalCommitInfo) Field ¶
func (i ConventionalCommitInfo) Field(name string) string
func (ConventionalCommitInfo) HasField ¶ added in v0.9.1
func (i ConventionalCommitInfo) HasField(name string) bool
func (*ConventionalCommitInfo) SetField ¶
func (i *ConventionalCommitInfo) SetField(name string, value string)
func (ConventionalCommitInfo) String ¶
func (i ConventionalCommitInfo) String() string
type PersonInfo ¶
func NewPersonInfo ¶
func NewPersonInfo(name, email string) PersonInfo
func ParsePerson ¶
func ParsePerson(personInfo string) (PersonInfo, error)
func (PersonInfo) String ¶
func (i PersonInfo) String() string
Click to show internal directories.
Click to hide internal directories.