show revision when version is not available

feature/slack_msg_formatting
Karolis Rusenas 2019-04-27 09:39:53 +01:00
parent 551dc127fb
commit 2669c0bd8f
1 changed files with 8 additions and 1 deletions

View File

@ -58,8 +58,15 @@ func (s *sender) Configure(config *notification.Config) (bool, error) {
"channels": s.channels,
}).Info("extension.notification.slack: sender configured")
var msg string
if version.GetKeelVersion().Version != "" {
msg = fmt.Sprintf("Keel has started. Version: %s", version.GetKeelVersion().Version)
} else {
msg = fmt.Sprintf("Keel has started. Revision: %s", version.GetKeelVersion().Revision)
}
err := s.Send(types.EventNotification{
Message: fmt.Sprintf("Keel has started. Version: %s", version.GetKeelVersion().Version),
Message: msg,
CreatedAt: time.Now(),
Type: types.NotificationSystemEvent,
Level: types.LevelInfo,