mirror of
https://framagit.org/fredix/drone-gotify
synced 2026-01-23 02:14:06 +00:00
update variables
This commit is contained in:
parent
96e4e1a36a
commit
ca8bec4f3f
2 changed files with 11 additions and 11 deletions
12
README.md
12
README.md
|
|
@ -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"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue