drone-ntfy/cmd/drone-ntfy/config/config.go

33 lines
1.2 KiB
Go

package config
type App struct {
BaseUrl string `env:"PLUGIN_URL" envDefault:"https://ntfy.sh"`
Topic string `env:"PLUGIN_TOPIC" envDefault:"undefined"`
Username string `env:"PLUGIN_USERNAME"`
Password string `env:"PLUGIN_PASSWORD"`
Token string `env:"PLUGIN_TOKEN"`
Title string `env:"PLUGIN_TITLE" envDefault:"Drone notification"`
Priority string `env:"PLUGIN_PRIORITY" envDefault:"default"`
Tags []string `env:"PLUGIN_TAGS" envSeparator:","`
DefaultTags []string `env:"PLUGIN_DEFAULT_TAGS" envDefault:"drone"`
Message string `env:"PLUGIN_MESSAGE"`
}
type Drone struct {
BuildNumber string `env:"DRONE_BUILD_NUMBER"`
BuildStatus string `env:"DRONE_BUILD_STATUS"`
StageName string `env:"DRONE_STAGE_NUMBER"`
StageStatus string `env:"DRONE_STAGE_STATUS"`
Tag string `env:"DRONE_TAG"`
BuildLink string `env:"DRONE_BUILD_LINK"`
CommitLink string `env:"DRONE_COMMIT_LINK"`
}
type Ci struct {
RepoName string `env:"CI_REPO_NAME"`
CommitMessage string `env:"CI_COMMIT_MESSAGE"`
CommitSha string `env:"CI_COMMIT_SHA"`
CommitBranch string `env:"CI_COMMIT_BRANCH"`
CommitRef string `env:"CI_COMMIT_REF"`
}