grafana - logging if image send

This commit is contained in:
Martin/Geno 2019-02-13 19:24:53 +01:00
parent 2d49586312
commit cfd2694693
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
2 changed files with 4 additions and 3 deletions

View File

@ -51,7 +51,7 @@ var eventMsg = map[string]string{
type requestBody struct {
Repository struct {
URL string `mapstructure:"url"`
URL string `mapstructure:"url"`
HTMLURL string `mapstructure:"html_url"`
FullName string `mapstructure:"full_name"`
} `mapstructure:"repository"`

View File

@ -72,11 +72,12 @@ func init() {
if ruleURL.Hostname() != hook.URL {
continue
}
logger.Infof("run hook")
runtime.Notify(client, hook, request.String())
if request.ImageURL != "" {
runtime.NotifyImage(client, hook, request.ImageURL)
logger = logger.WithField("image", request.ImageURL)
runtime.NotifyImage(client, hook, request.ImageURL)
}
logger.Infof("run hook")
ok = true
}
if !ok {