plugins

package
v0.0.0-...-1ae172a Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeBuildTypeNone   = "none"
	CodeBuildTypeFile   = "file"
	CodeBuildTypeScript = "script"
)
View Source
const (
	ResourceTypeImage = "image"
	ResourceTypeHost  = "host"
)
View Source
const PipelineRunAddReleaseVersionUri = "/api/v1/spacelet/pipeline/add_release"

Variables

View Source
var WorkloadKinds = []string{"Deployment", "StatefulSet", "DaemonSet", "Job", "Pod", "CronJob"}

Functions

This section is empty.

Types

type CodeBuilderPlugin

type CodeBuilderPlugin struct{}

CodeBuilderPlugin 流水线代码构建执行器

func (CodeBuilderPlugin) Executor

func (b CodeBuilderPlugin) Executor(params *ExecutorParams) (Executor, error)

type CodeBuilderPluginResult

type CodeBuilderPluginResult struct {
	ImageUrl        string `json:"images"`
	ImageRegistry   string `json:"image_registry"`
	ImageRegistryId int    `json:"image_registry_id"`
}

CodeBuilderPluginResult 代码构建执行结果

type DeployK8sPlugin

type DeployK8sPlugin struct {
	*model.Models
	KubeClient *cluster.KubeClient
}

func (DeployK8sPlugin) Executor

func (p DeployK8sPlugin) Executor(params *ExecutorParams) (Executor, error)

type ExecShellParams

type ExecShellParams struct {
	JobId uint `json:"job_id"`

	Resource PipelineResource       `json:"resource"`
	Port     string                 `json:"port"`
	Shell    string                 `json:"shell"`
	Script   string                 `json:"script"`
	Env      map[string]interface{} `json:"env"`
}

type ExecShellPlugin

type ExecShellPlugin struct{}

func (ExecShellPlugin) Executor

func (b ExecShellPlugin) Executor(params *ExecutorParams) (Executor, error)

type Executor

type Executor interface {
	// Execute 任务插件执行处理
	Execute() (interface{}, error)

	// Cancel 取消执行
	Cancel() error
}

Executor 流水线任务插件执行处理器

type ExecutorFactory

type ExecutorFactory interface {
	// Executor 创建任务插件执行器
	Executor(params *ExecutorParams) (Executor, error)
}

ExecutorFactory 流水线任务插件执行器工厂,不同流水线任务插件产生不同的流水线执行器

type ExecutorParams

type ExecutorParams struct {
	JobId     uint
	PluginKey string
	RootDir   string
	Params    map[string]interface{}
	Logger    Logger
}

ExecutorParams 任务插件执行参数

func NewExecutorParams

func NewExecutorParams(jobId uint, pluginKey, rootDir string, params map[string]interface{}, logger Logger) *ExecutorParams

type ImageBuilds

type ImageBuilds struct {
	Dockerfile string `json:"dockerfile"`
	Image      string `json:"image"`
}

type Logger

type Logger interface {
	io.Writer

	// Log 日志追加写入
	Log(format string, a ...interface{})

	// Reset 日志覆盖重写
	Reset(format string, a ...interface{})

	Close() error
}

Logger 任务插件执行时调用的日志存储接口 当前存在两个日志存储 1. 在pipeline controller执行任务日志存储到db中 2. 在spacelet执行任务日志存储到文件中

type PipelineResource

type PipelineResource struct {
	Type   string        `json:"type"`
	Value  string        `json:"value"`
	Secret *types.Secret `json:"secret"`
}

type ReleaserPlugin

type ReleaserPlugin struct {
	// contains filtered or unexported fields
}

func NewReleasePlugin

func NewReleasePlugin(client *httpclient.HttpClient) *ReleaserPlugin

func (ReleaserPlugin) Executor

func (b ReleaserPlugin) Executor(params *ExecutorParams) (Executor, error)

type ReleaserPluginResult

type ReleaserPluginResult struct {
	Version string `json:"version"`
	Images  string `json:"images"`
}

type UpgradeAppPlugin

type UpgradeAppPlugin struct {
	*model.Models
	KubeClient *cluster.KubeClient
}

func (UpgradeAppPlugin) Executor

func (p UpgradeAppPlugin) Executor(params *ExecutorParams) (Executor, error)

Jump to

Keyboard shortcuts

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