update variables

This commit is contained in:
fredix 2019-06-09 15:30:01 +02:00
parent 96e4e1a36a
commit ca8bec4f3f
2 changed files with 11 additions and 11 deletions

View file

@ -8,9 +8,9 @@ https://docs.drone.io/plugins/examples/golang/
## environment variables :
```
PLUGIN_ENDPOINT=https://gotify.server.tld
PLUGIN_TOKEN=APPLICATION_TOKEN
PLUGIN_TITLE="from drone-gotify"
PLUGIN_MESSAGE="test"
PLUGIN_PRIORITY=5
```
PLUGIN_GOTIFY_ENDPOINT="https://gotify.server.tld"
PLUGIN_GOTIFY_TOKEN="APPLICATION_TOKEN"
PLUGIN_GOTIFY_TITLE="from drone-gotify"
PLUGIN_GOTIFY_MESSAGE="test"
PLUGIN_GOTIFY_PRIORITY="5"
```

View file

@ -8,11 +8,11 @@ import (
)
func main() {
token := os.Getenv("PLUGIN_TOKEN")
endpoint := os.Getenv("PLUGIN_ENDPOINT")
title := os.Getenv("PLUGIN_TITLE")
message := os.Getenv("PLUGIN_MESSAGE")
priority := os.Getenv("PLUGIN_PRIORITY")
token := os.Getenv("PLUGIN_GOTIFY_TOKEN")
endpoint := os.Getenv("PLUGIN_GOTIFY_ENDPOINT")
title := os.Getenv("PLUGIN_GOTIFY_TITLE")
message := os.Getenv("PLUGIN_GOTIFY_MESSAGE")
priority := os.Getenv("PLUGIN_GOTIFY_PRIORITY")
resp, err := http.PostForm(endpoint + "/message?token=" + token, url.Values{"message": {message}, "title": {title}, "priority": {priority}})
if resp != nil {