plugin

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PLUGIN_VERSION = "0.0.0"

PLUGIN_VERSION drone-feishu 插件本身的版本号

Variables

This section is empty.

Functions

func DefaultBuildFeishuContent

func DefaultBuildFeishuContent(p *Plugin) *feishuRobotGo.RobotContent

func GetAllDroneEnv added in v0.5.0

func GetAllDroneEnv() (entries [][2]string)

Types

type BuildInfo

type BuildInfo struct {
	Tag    string
	Event  string
	Number int
	Parent int
	Commit string
	Ref    string
	Branch string
	Author struct {
		Username string
		Name     string
		Email    string
		Avatar   string
	}
	Pull    string
	Message struct {
		Title string
		Body  string
	}
	DeployTo string
	Status   string
	Link     string
	Started  int64
	Created  int64
}

BuildInfo 针对的是step层级

type Config

type Config struct {
	Webhook string
	Secret  string
	Message string
}

type Plugin

type Plugin struct {
	RepoInfo           RepoInfo
	BuildInfo          BuildInfo
	StageInfo          StageInfo
	Config             Config
	BuildFeishuContent func(p *Plugin) *feishuRobotGo.RobotContent
}

func NewPlugin

func NewPlugin(contentBuilder func(p *Plugin) *feishuRobotGo.RobotContent) *Plugin

func (*Plugin) CheckArgs

func (p *Plugin) CheckArgs() error

func (*Plugin) Exec

func (p *Plugin) Exec(c context.Context) error

func (*Plugin) Main

func (p *Plugin) Main()

Main Drone pipeline 环境中运行

func (*Plugin) ParseAppArgs

func (p *Plugin) ParseAppArgs(c *cli.Context)

ParseAppArgs 用cli.App中读取的环境变量来填充Plugin的数据

type RepoInfo

type RepoInfo struct {
	Owner string
	Name  string
}

type StageInfo

type StageInfo struct {
	Started int64
	Name    string
}

StageInfo 针对的是pipeline层级

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL