add slackrus slack notifications

This commit is contained in:
ubergesundheit 2017-11-27 12:04:08 +01:00 committed by Fabrizio Steiner
parent d989254b1a
commit fd7f8a40ed
6 changed files with 95 additions and 10 deletions

21
main.go
View file

@ -8,8 +8,8 @@ import (
"strconv"
log "github.com/sirupsen/logrus"
"github.com/robfig/cron"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/v2tec/watchtower/actions"
"github.com/v2tec/watchtower/container"
@ -93,7 +93,7 @@ func main() {
cli.StringSliceFlag{
Name: "notifications",
Value: &cli.StringSlice{},
Usage: "notification types to send (valid: email)",
Usage: "notification types to send (valid: email, slack)",
EnvVar: "WATCHTOWER_NOTIFICATIONS",
},
cli.StringFlag{
@ -136,6 +136,23 @@ func main() {
Usage: "SMTP server password for sending notifications",
EnvVar: "WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD",
},
cli.StringFlag{
Name: "notification-slack-hook-url",
Usage: "The Slack Hook URL to send notifications to",
EnvVar: "WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL",
},
cli.StringFlag{
Name: "notification-slack-identifier",
Usage: "A string which will be used to identify the messages coming from this watchtower instance. Default if omitted is \"watchtower\"",
EnvVar: "WATCHTOWER_NOTIFICATION_SLACK_IDENTIFIER",
Value: "watchtower",
},
cli.StringFlag{
Name: "notification-slack-level",
Usage: "The log level used for sending notifications through Slack. Default if omitted is \"info\". Possible values: \"panic\",\"fatal\",\"error\",\"warn\",\"info\" or \"debug\"",
EnvVar: "WATCHTOWER_NOTIFICATION_SLACK_LEVEL",
Value: "info",
},
}
if err := app.Run(os.Args); err != nil {