-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added notification support for discord #157
Changes from 1 commit
f891a4b
1edf4d8
fedfd99
812cdc0
eed16a0
4c1f818
3ee5816
e946b1f
7e19304
7dea82c
5fae9bf
e7b4349
4a840a4
c485521
2603ae6
4b5eb5e
e34c8b3
c7b7ac6
d13953b
681cead
d091dbf
6215179
ee0bbdb
6e5fd76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,8 @@ ssh_key = "/home/vsts/.beast/secret.key" | |
url = "[email protected]:sdslabs/nonexistent.git" | ||
name = "nonexistent" | ||
branch = "nonexistent" | ||
|
||
[[webhooks]] | ||
url = "https://discordapp.com/api/webhooks/615970326093758464/Dui7gVZVIaGvdys87I9O2Gn9Bx3ssNkdgkxSf3etEXN0ClxlNYSeTflbJd0obO81a_m1" | ||
wryonik marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actual token kyu hai example toml me? |
||
service_name= "discord" | ||
status=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,8 +86,7 @@ type BeastConfig struct { | |
AvailableSidecars []string `toml:"available_sidecars"` | ||
GitRemote GitRemote `toml:"remote"` | ||
JWTSecret string `toml:"jwt_secret"` | ||
SlackWebHookURL string `toml:"slack_webhook"` | ||
DiscordWebHookURL string `toml:"discord_webhook"` | ||
Webhooks []Webhook `toml:webhook` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Name this |
||
TickerFrequency int `toml:"ticker_frequency"` | ||
|
||
RemoteSyncPeriod time.Duration `toml:"-"` | ||
|
@@ -216,6 +215,12 @@ func (config *GitRemote) ValidateGitConfig() error { | |
return nil | ||
} | ||
|
||
type Webhook struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
URL string `toml:"url"` | ||
ServiceName string `toml:"service_name"` | ||
Status bool `toml:"status"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is meant by Status - true or false. Change the name to something more sensible - |
||
} | ||
|
||
// From the path of the config file provided as an arguement this function | ||
// loads the parse the config file and load it into the BeastConfig | ||
// structure. After parsing it validates the data in the config file and returns | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -530,7 +530,7 @@ func StartUndeployChallenge(challengeName string, purge bool) error { | |
notify.SendNotification(notify.Success, msg) | ||
} | ||
|
||
log.Infof("Notification for the event sent to slack.") | ||
log.Infof("Notification for the event sent.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the |
||
return err | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,9 @@ const ( | |
WarningColor NotificationColor = "#FF4500" | ||
SuccessColor NotificationColor = "#32CD32" | ||
) | ||
|
||
const ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the file name to |
||
USERNAME string = "Beast" | ||
ICON_URL string = "https://i.ibb.co/sjC5dRY/beast-eye-39371.png" | ||
CHANNEL_NAME string = "#beast" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add example for slack too.
Change the field
status
toactive