Commit 6721e400 authored by fredix's avatar fredix
Browse files

first commit

parent eae0e1ca
drone-gotify
# drone-gotify
environment variables :
PLUGIN_ENDPOINT=https://gotify.server
PLUGIN_TOKEN=APPLICATION_TOKEN
PLUGIN_TITLE="from drone-gotify"
PLUGIN_MESSAGE="test"
PLUGIN_PRIORITY=5
package main
import (
"net/http"
"net/url"
"os"
"log"
)
// https://gotify.net/docs/more-pushmsg#golang
// https://docs.drone.io/plugins/examples/golang/
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")
resp, err := http.PostForm(endpoint + "/message?token=" + token, url.Values{"message": {message}, "title": {title}, "priority": {priority}})
if resp != nil {
resp.Body.Close()
}
if err != nil {
log.Fatalln(err)
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment