-
Notifications
You must be signed in to change notification settings - Fork 7
/
messages.go
29 lines (24 loc) · 961 Bytes
/
messages.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package commitinfo
import (
"fmt"
"github.com/lunarway/release-manager/internal/intent"
)
// ReleaseCommitMessage returns an artifact release commit message.
func ReleaseCommitMessage(env, service, artifactID string, intent intent.Intent, artifactAuthor, releaseAuthor PersonInfo) string {
return CommitInfo{
Environment: env,
Service: service,
ArtifactID: artifactID,
Intent: intent,
ArtifactCreatedBy: artifactAuthor,
ReleasedBy: releaseAuthor,
}.String()
}
// PolicyUpdateApplyCommitMessage returns an apply policy commit message.
func PolicyUpdateApplyCommitMessage(env, service, policy string) string {
return fmt.Sprintf("[%s] policy update: apply %s in '%s'", service, policy, env)
}
// PolicyUpdateDeleteCommitMessage returns a delete policy commit message.
func PolicyUpdateDeleteCommitMessage(service string) string {
return fmt.Sprintf("[%s] policy update: delete policies", service)
}