taskplugin

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProductLabel ...
	ProductLabel = "s-product"
	// GroupLabel ...
	GroupLabel = "s-group"
	// ServiceLabel ...
	ServiceLabel = "s-service"
	// ConfigBackupLabel ...
	ConfigBackupLabel = "config-backup"
	// NamespaceLabel
	EnvNameLabel = "s-env"
	// EnvName ...
	UpdateBy   = "update-by"
	UpdateByID = "update-by-id"
	UpdateTime = "update-time"
)
View Source
const (
	PredatorPlugin = "predator-plugin"
	JenkinsPlugin  = "jenkins-plugin"
)
View Source
const (
	// BuildTaskV2Timeout ...
	BuildTaskV2Timeout = 60 * 60 * 3 // 60 minutes
)
View Source
const (
	// DeployTimeout ...
	DeployTimeout = 60 * 10 // 10 minutes

)
View Source
const (
	// Distribute2S3TaskTimeout ...
	Distribute2S3TaskTimeout = 60 * 10 // 10 minutes
)
View Source
const (
	// DockerBuildTimeout ...
	DockerBuildTimeout = 60 * 60 // 60 minutes
)
View Source
const (
	// JenkinsBuildTimeout ...
	JenkinsBuildTimeout = 60 * 60 * 3 // 60 minutes
)
View Source
const (
	// JiraTimeout ...
	JiraTimeout = 60 * 5 // 5 minutes
)
View Source
const (
	// RelealseImageTaskTimeout ...
	RelealseImageTaskTimeout = 60 * 5 // 5 minutes
)
View Source
const (
	SecurityTaskTimeout = 60 * 3 // 3 minutes
)
View Source
const (
	// TestingV2TaskTimeout ...
	TestingV2TaskTimeout = 60 * 60 // 60 minutes
)

Variables

This section is empty.

Functions

func GetBestDockerHost

func GetBestDockerHost(hostList []string, pipelineType, namespace string, log *zap.SugaredLogger) (string, error)

选择最合适的dockerhost

func IToi

func IToi(before interface{}, after interface{}) error

func Min

func Min(x, y int) int

func ToArtifactTask

func ToArtifactTask(sb map[string]interface{}) (*task.Artifact, error)

func ToBuildTask

func ToBuildTask(sb map[string]interface{}) (*task.Build, error)

func ToDeployTask

func ToDeployTask(sb map[string]interface{}) (*task.Deploy, error)

func ToDistributeToS3Task

func ToDistributeToS3Task(sb map[string]interface{}) (*task.DistributeToS3, error)

func ToDockerBuildTask

func ToDockerBuildTask(sb map[string]interface{}) (*task.DockerBuild, error)

func ToJenkinsBuildTask

func ToJenkinsBuildTask(sb map[string]interface{}) (*task.JenkinsBuild, error)

func ToJiraTask

func ToJiraTask(sb map[string]interface{}) (*task.Jira, error)

func ToReleaseImageTask

func ToReleaseImageTask(sb map[string]interface{}) (*task.ReleaseImage, error)

func ToSecurityTask

func ToSecurityTask(sb map[string]interface{}) (*task.Security, error)

func ToTestingTask

func ToTestingTask(sb map[string]interface{}) (*task.Testing, error)

Types

type BuildTaskPlugin

type BuildTaskPlugin struct {
	Name          config.TaskType
	KubeNamespace string
	JobName       string
	FileName      string

	Task *task.Build
	Log  *zap.SugaredLogger
	// contains filtered or unexported fields
}

BuildTaskPlugin is Plugin, name should be compatible with task type

func (*BuildTaskPlugin) Complete

func (p *BuildTaskPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

Complete ...

func (*BuildTaskPlugin) GetTask

func (p *BuildTaskPlugin) GetTask() interface{}

GetTask ...

func (*BuildTaskPlugin) Init

func (p *BuildTaskPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*BuildTaskPlugin) IsTaskDone

func (p *BuildTaskPlugin) IsTaskDone() bool

IsTaskDone ...

func (*BuildTaskPlugin) IsTaskEnabled

func (p *BuildTaskPlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*BuildTaskPlugin) IsTaskFailed

func (p *BuildTaskPlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*BuildTaskPlugin) ResetError

func (p *BuildTaskPlugin) ResetError()

ResetError ...

func (*BuildTaskPlugin) Run

func (p *BuildTaskPlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

TODO: Binded Archive File logic

func (*BuildTaskPlugin) SetAckFunc

func (p *BuildTaskPlugin) SetAckFunc(ack func())

func (*BuildTaskPlugin) SetBuildStatusCompleted

func (p *BuildTaskPlugin) SetBuildStatusCompleted(status config.Status)

func (*BuildTaskPlugin) SetEndTime

func (p *BuildTaskPlugin) SetEndTime()

SetEndTime ...

func (*BuildTaskPlugin) SetStartTime

func (p *BuildTaskPlugin) SetStartTime()

SetStartTime ...

func (*BuildTaskPlugin) SetStatus

func (p *BuildTaskPlugin) SetStatus(status config.Status)

SetStatus ...

func (*BuildTaskPlugin) SetTask

func (p *BuildTaskPlugin) SetTask(t map[string]interface{}) error

SetTask ...

func (*BuildTaskPlugin) Status

func (p *BuildTaskPlugin) Status() config.Status

Status ...

func (*BuildTaskPlugin) TaskTimeout

func (p *BuildTaskPlugin) TaskTimeout() int

TaskTimeout ...

func (*BuildTaskPlugin) Type

func (p *BuildTaskPlugin) Type() config.TaskType

func (*BuildTaskPlugin) Wait

func (p *BuildTaskPlugin) Wait(ctx context.Context)

Wait ...

type DeployTaskPlugin

type DeployTaskPlugin struct {
	Name    config.TaskType
	JobName string

	Task         *task.Deploy
	Log          *zap.SugaredLogger
	ReplaceImage string
	// contains filtered or unexported fields
}

DeployTaskPlugin Plugin name should be compatible with task type

func (*DeployTaskPlugin) Complete

func (p *DeployTaskPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

func (*DeployTaskPlugin) GetTask

func (p *DeployTaskPlugin) GetTask() interface{}

GetTask ...

func (*DeployTaskPlugin) Init

func (p *DeployTaskPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*DeployTaskPlugin) IsTaskDone

func (p *DeployTaskPlugin) IsTaskDone() bool

IsTaskDone ...

func (*DeployTaskPlugin) IsTaskEnabled

func (p *DeployTaskPlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*DeployTaskPlugin) IsTaskFailed

func (p *DeployTaskPlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*DeployTaskPlugin) ResetError

func (p *DeployTaskPlugin) ResetError()

ResetError ...

func (*DeployTaskPlugin) Run

func (p *DeployTaskPlugin) Run(ctx context.Context, pipelineTask *task.Task, _ *task.PipelineCtx, _ string)

func (*DeployTaskPlugin) SetAckFunc

func (p *DeployTaskPlugin) SetAckFunc(func())

func (*DeployTaskPlugin) SetEndTime

func (p *DeployTaskPlugin) SetEndTime()

SetEndTime ...

func (*DeployTaskPlugin) SetStartTime

func (p *DeployTaskPlugin) SetStartTime()

SetStartTime ...

func (*DeployTaskPlugin) SetStatus

func (p *DeployTaskPlugin) SetStatus(status config.Status)

SetStatus ...

func (*DeployTaskPlugin) SetTask

func (p *DeployTaskPlugin) SetTask(t map[string]interface{}) error

func (*DeployTaskPlugin) Status

func (p *DeployTaskPlugin) Status() config.Status

Status ...

func (*DeployTaskPlugin) TaskTimeout

func (p *DeployTaskPlugin) TaskTimeout() int

TaskTimeout ...

func (*DeployTaskPlugin) Type

func (p *DeployTaskPlugin) Type() config.TaskType

Type ...

func (*DeployTaskPlugin) Wait

func (p *DeployTaskPlugin) Wait(ctx context.Context)

Wait ...

type Distribute2S3TaskPlugin

type Distribute2S3TaskPlugin struct {
	Name config.TaskType
	Task *task.DistributeToS3
	Log  *zap.SugaredLogger
}

Distribute2S3TaskPlugin Plugin name should be compatible with task type

func (*Distribute2S3TaskPlugin) Complete

func (p *Distribute2S3TaskPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

Complete ...

func (*Distribute2S3TaskPlugin) GetTask

func (p *Distribute2S3TaskPlugin) GetTask() interface{}

GetTask ...

func (*Distribute2S3TaskPlugin) Init

func (p *Distribute2S3TaskPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*Distribute2S3TaskPlugin) IsTaskDone

func (p *Distribute2S3TaskPlugin) IsTaskDone() bool

IsTaskDone ...

func (*Distribute2S3TaskPlugin) IsTaskEnabled

func (p *Distribute2S3TaskPlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*Distribute2S3TaskPlugin) IsTaskFailed

func (p *Distribute2S3TaskPlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*Distribute2S3TaskPlugin) ResetError

func (p *Distribute2S3TaskPlugin) ResetError()

ResetError ...

func (*Distribute2S3TaskPlugin) Run

func (p *Distribute2S3TaskPlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

Run ...

func (*Distribute2S3TaskPlugin) SetAckFunc

func (p *Distribute2S3TaskPlugin) SetAckFunc(func())

func (*Distribute2S3TaskPlugin) SetEndTime

func (p *Distribute2S3TaskPlugin) SetEndTime()

SetEndTime ...

func (*Distribute2S3TaskPlugin) SetStartTime

func (p *Distribute2S3TaskPlugin) SetStartTime()

SetStartTime ...

func (*Distribute2S3TaskPlugin) SetStatus

func (p *Distribute2S3TaskPlugin) SetStatus(status config.Status)

SetStatus ...

func (*Distribute2S3TaskPlugin) SetTask

func (p *Distribute2S3TaskPlugin) SetTask(t map[string]interface{}) error

SetTask ...

func (*Distribute2S3TaskPlugin) Status

Status ...

func (*Distribute2S3TaskPlugin) TaskTimeout

func (p *Distribute2S3TaskPlugin) TaskTimeout() int

TaskTimeout ...

func (*Distribute2S3TaskPlugin) Type

Type ...

func (*Distribute2S3TaskPlugin) Wait

Wait ...

type DockerBuildPlugin

type DockerBuildPlugin struct {
	Name          config.TaskType
	KubeNamespace string
	JobName       string
	FileName      string

	Task *task.DockerBuild
	Log  *zap.SugaredLogger
	// contains filtered or unexported fields
}

DockerBuildPlugin Plugin name should be compatible with task type

func (*DockerBuildPlugin) Complete

func (p *DockerBuildPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

Complete ...

func (*DockerBuildPlugin) GetTask

func (p *DockerBuildPlugin) GetTask() interface{}

GetTask ...

func (*DockerBuildPlugin) Init

func (p *DockerBuildPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*DockerBuildPlugin) IsTaskDone

func (p *DockerBuildPlugin) IsTaskDone() bool

IsTaskDone ...

func (*DockerBuildPlugin) IsTaskEnabled

func (p *DockerBuildPlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*DockerBuildPlugin) IsTaskFailed

func (p *DockerBuildPlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*DockerBuildPlugin) ResetError

func (p *DockerBuildPlugin) ResetError()

ResetError ...

func (*DockerBuildPlugin) Run

func (p *DockerBuildPlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

func (*DockerBuildPlugin) SetAckFunc

func (p *DockerBuildPlugin) SetAckFunc(func())

func (*DockerBuildPlugin) SetEndTime

func (p *DockerBuildPlugin) SetEndTime()

SetEndTime ...

func (*DockerBuildPlugin) SetStartTime

func (p *DockerBuildPlugin) SetStartTime()

SetStartTime ...

func (*DockerBuildPlugin) SetStatus

func (p *DockerBuildPlugin) SetStatus(status config.Status)

SetStatus ...

func (*DockerBuildPlugin) SetTask

func (p *DockerBuildPlugin) SetTask(t map[string]interface{}) error

SetTask ...

func (*DockerBuildPlugin) Status

func (p *DockerBuildPlugin) Status() config.Status

Status ...

func (*DockerBuildPlugin) TaskTimeout

func (p *DockerBuildPlugin) TaskTimeout() int

TaskTimeout ...

func (*DockerBuildPlugin) Type

func (p *DockerBuildPlugin) Type() config.TaskType

Type ...

func (*DockerBuildPlugin) Wait

func (p *DockerBuildPlugin) Wait(ctx context.Context)

Wait ...

type EnvArgs

type EnvArgs struct {
	EnvName     string `json:"env_name"`
	ProductName string `json:"product_name"`
}

type Initiator added in v1.3.0

type Initiator func(taskType config.TaskType) TaskPlugin

Initiator function for init plugins

type JenkinsBuildPlugin

type JenkinsBuildPlugin struct {
	Name          config.TaskType
	KubeNamespace string

	JobName  string
	FileName string
	Task     *task.JenkinsBuild
	Log      *zap.SugaredLogger
	// contains filtered or unexported fields
}

JenkinsBuildPlugin is Plugin, name should be compatible with task type

func (*JenkinsBuildPlugin) Complete

func (j *JenkinsBuildPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

func (*JenkinsBuildPlugin) GetTask

func (j *JenkinsBuildPlugin) GetTask() interface{}

GetTask ...

func (*JenkinsBuildPlugin) Init

func (j *JenkinsBuildPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*JenkinsBuildPlugin) IsTaskDone

func (j *JenkinsBuildPlugin) IsTaskDone() bool

func (*JenkinsBuildPlugin) IsTaskEnabled

func (j *JenkinsBuildPlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*JenkinsBuildPlugin) IsTaskFailed

func (j *JenkinsBuildPlugin) IsTaskFailed() bool

func (*JenkinsBuildPlugin) ResetError

func (j *JenkinsBuildPlugin) ResetError()

ResetError ...

func (*JenkinsBuildPlugin) Run

func (j *JenkinsBuildPlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

func (*JenkinsBuildPlugin) SetAckFunc

func (j *JenkinsBuildPlugin) SetAckFunc(ack func())

func (*JenkinsBuildPlugin) SetEndTime

func (j *JenkinsBuildPlugin) SetEndTime()

SetEndTime ...

func (*JenkinsBuildPlugin) SetStartTime

func (j *JenkinsBuildPlugin) SetStartTime()

SetStartTime ...

func (*JenkinsBuildPlugin) SetStatus

func (j *JenkinsBuildPlugin) SetStatus(status config.Status)

func (*JenkinsBuildPlugin) SetTask

func (j *JenkinsBuildPlugin) SetTask(t map[string]interface{}) error

func (*JenkinsBuildPlugin) Status

func (j *JenkinsBuildPlugin) Status() config.Status

func (*JenkinsBuildPlugin) TaskTimeout

func (j *JenkinsBuildPlugin) TaskTimeout() int

TaskTimeout ...

func (*JenkinsBuildPlugin) Type

func (*JenkinsBuildPlugin) Wait

func (j *JenkinsBuildPlugin) Wait(ctx context.Context)

Wait ...

type JiraPlugin

type JiraPlugin struct {
	Name config.TaskType
	Task *task.Jira
	Log  *zap.SugaredLogger
}

JiraPlugin name should be compatible with task type

func (*JiraPlugin) Complete

func (p *JiraPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

Complete ...

func (*JiraPlugin) GetTask

func (p *JiraPlugin) GetTask() interface{}

GetTask ...

func (*JiraPlugin) Init

func (p *JiraPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*JiraPlugin) IsTaskDone

func (p *JiraPlugin) IsTaskDone() bool

IsTaskDone ...

func (*JiraPlugin) IsTaskEnabled

func (p *JiraPlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*JiraPlugin) IsTaskFailed

func (p *JiraPlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*JiraPlugin) ResetError

func (p *JiraPlugin) ResetError()

ResetError ...

func (*JiraPlugin) Run

func (p *JiraPlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

func (*JiraPlugin) SetAckFunc

func (p *JiraPlugin) SetAckFunc(func())

func (*JiraPlugin) SetEndTime

func (p *JiraPlugin) SetEndTime()

SetEndTime ...

func (*JiraPlugin) SetStartTime

func (p *JiraPlugin) SetStartTime()

SetStartTime ...

func (*JiraPlugin) SetStatus

func (p *JiraPlugin) SetStatus(status config.Status)

SetStatus ...

func (*JiraPlugin) SetTask

func (p *JiraPlugin) SetTask(t map[string]interface{}) error

SetTask ...

func (*JiraPlugin) Status

func (p *JiraPlugin) Status() config.Status

Status ...

func (*JiraPlugin) TaskTimeout

func (p *JiraPlugin) TaskTimeout() int

TaskTimeout ...

func (*JiraPlugin) Type

func (p *JiraPlugin) Type() config.TaskType

Type ...

func (*JiraPlugin) Wait

func (p *JiraPlugin) Wait(ctx context.Context)

Wait ...

type JobCtxBuilder

type JobCtxBuilder struct {
	JobName        string
	ArchiveFile    string
	TestReportFile string
	PipelineCtx    *task.PipelineCtx
	JobCtx         task.JobCtx
	Installs       []*task.Install
}

JobCtxBuilder ...

func (*JobCtxBuilder) BuildReaperContext

func (b *JobCtxBuilder) BuildReaperContext(pipelineTask *task.Task, serviceName string) *types.Context

BuildReaperContext builds a yaml

type JobLabel

type JobLabel struct {
	PipelineName string
	TaskID       int64
	TaskType     string
	ServiceName  string
	PipelineType string
}

JobLabel is to describe labels that specify job identity

type Preview

type Preview struct {
	TaskType config.TaskType `json:"type"`
	Enabled  bool            `json:"enabled"`
}

func ToPreview

func ToPreview(sb map[string]interface{}) (*Preview, error)

type ReleaseImagePlugin

type ReleaseImagePlugin struct {
	Name          config.TaskType
	KubeNamespace string
	JobName       string
	FileName      string

	Task *task.ReleaseImage
	Log  *zap.SugaredLogger
	// contains filtered or unexported fields
}

ReleaseImagePlugin Plugin name should be compatible with task type

func (*ReleaseImagePlugin) Complete

func (p *ReleaseImagePlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

Complete ...

func (*ReleaseImagePlugin) GetTask

func (p *ReleaseImagePlugin) GetTask() interface{}

GetTask ...

func (*ReleaseImagePlugin) Init

func (p *ReleaseImagePlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*ReleaseImagePlugin) IsTaskDone

func (p *ReleaseImagePlugin) IsTaskDone() bool

IsTaskDone ...

func (*ReleaseImagePlugin) IsTaskEnabled

func (p *ReleaseImagePlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*ReleaseImagePlugin) IsTaskFailed

func (p *ReleaseImagePlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*ReleaseImagePlugin) ResetError

func (p *ReleaseImagePlugin) ResetError()

ResetError ...

func (*ReleaseImagePlugin) Run

func (p *ReleaseImagePlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

Run ...

func (*ReleaseImagePlugin) SetAckFunc

func (p *ReleaseImagePlugin) SetAckFunc(func())

func (*ReleaseImagePlugin) SetEndTime

func (p *ReleaseImagePlugin) SetEndTime()

SetEndTime ...

func (*ReleaseImagePlugin) SetStartTime

func (p *ReleaseImagePlugin) SetStartTime()

SetStartTime ...

func (*ReleaseImagePlugin) SetStatus

func (p *ReleaseImagePlugin) SetStatus(status config.Status)

SetStatus ...

func (*ReleaseImagePlugin) SetTask

func (p *ReleaseImagePlugin) SetTask(t map[string]interface{}) error

SetTask ...

func (*ReleaseImagePlugin) Status

func (p *ReleaseImagePlugin) Status() config.Status

Status ...

func (*ReleaseImagePlugin) TaskTimeout

func (p *ReleaseImagePlugin) TaskTimeout() int

TaskTimeout ...

func (*ReleaseImagePlugin) Type

Type ...

func (*ReleaseImagePlugin) Wait

func (p *ReleaseImagePlugin) Wait(ctx context.Context)

Wait ...

type SecurityPlugin

type SecurityPlugin struct {
	Name          config.TaskType
	KubeNamespace string
	JobName       string
	FileName      string
	Task          *task.Security
	Log           *zap.SugaredLogger
	// contains filtered or unexported fields
}

SecurityPlugin Plugin name should be compatible with task type

func (*SecurityPlugin) Complete

func (p *SecurityPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

Complete ...

func (*SecurityPlugin) GetTask

func (p *SecurityPlugin) GetTask() interface{}

GetTask ...

func (*SecurityPlugin) Init

func (p *SecurityPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*SecurityPlugin) IsTaskDone

func (p *SecurityPlugin) IsTaskDone() bool

IsTaskDone ...

func (*SecurityPlugin) IsTaskEnabled

func (p *SecurityPlugin) IsTaskEnabled() bool

IsTaskEnabled ...

func (*SecurityPlugin) IsTaskFailed

func (p *SecurityPlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*SecurityPlugin) ResetError

func (p *SecurityPlugin) ResetError()

ResetError ...

func (*SecurityPlugin) Run

func (p *SecurityPlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

Run ...

func (*SecurityPlugin) SetAckFunc

func (p *SecurityPlugin) SetAckFunc(func())

func (*SecurityPlugin) SetEndTime

func (p *SecurityPlugin) SetEndTime()

SetEndTime ...

func (*SecurityPlugin) SetStartTime

func (p *SecurityPlugin) SetStartTime()

SetStartTime ...

func (*SecurityPlugin) SetStatus

func (p *SecurityPlugin) SetStatus(status config.Status)

SetStatus ...

func (*SecurityPlugin) SetTask

func (p *SecurityPlugin) SetTask(t map[string]interface{}) error

SetTask ...

func (*SecurityPlugin) Status

func (p *SecurityPlugin) Status() config.Status

func (*SecurityPlugin) TaskTimeout

func (p *SecurityPlugin) TaskTimeout() int

TaskTimeout ...

func (*SecurityPlugin) Type

func (p *SecurityPlugin) Type() config.TaskType

Type ...

func (*SecurityPlugin) Wait

func (p *SecurityPlugin) Wait(ctx context.Context)

type SelectorBuilder

type SelectorBuilder struct {
	ProductName  string
	GroupName    string
	ServiceName  string
	ConfigBackup string
	EnvName      string
}

type TaskPlugin

type TaskPlugin interface {
	Init(jobname, filename string, xl *zap.SugaredLogger)
	// Type ...
	Type() config.TaskType

	// Status ...
	Status() config.Status

	// Run ...
	Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

	// Wait ...
	Wait(ctx context.Context)

	// Complete ...
	Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

	SetTask(map[string]interface{}) error

	GetTask() interface{}

	// TaskTimeout ...
	TaskTimeout() int

	// IsTaskDone ...
	IsTaskDone() bool

	// IsTaskFailed ...
	IsTaskFailed() bool

	// IsTaskEnabled ...
	IsTaskEnabled() bool

	// SetStatus ...
	SetStatus(status config.Status)

	// SetStartTime ...
	SetStartTime()

	// SetEndTime ...
	SetEndTime()

	// ResetError ...
	ResetError()

	// SetAckFunc ...
	SetAckFunc(func())
}

TaskPlugin ...

A Specific Task Plugin is to run one specified task.

func InitializeBuildTaskPlugin

func InitializeBuildTaskPlugin(taskType config.TaskType) TaskPlugin

InitializeBuildTaskPlugin to initialize build task plugin, and return reference

func InitializeDeployTaskPlugin

func InitializeDeployTaskPlugin(taskType config.TaskType) TaskPlugin

InitializeDeployTaskPlugin to initiate deploy task plugin and return ref

func InitializeDistribute2S3TaskPlugin

func InitializeDistribute2S3TaskPlugin(taskType config.TaskType) TaskPlugin

InitializeDistribute2S3TaskPlugin ...

func InitializeDockerBuildTaskPlugin

func InitializeDockerBuildTaskPlugin(taskType config.TaskType) TaskPlugin

InitializeDockerBuildTaskPlugin init docker build plugin

func InitializeJenkinsBuildPlugin

func InitializeJenkinsBuildPlugin(taskType config.TaskType) TaskPlugin

InitializeJenkinsBuildPlugin to initialize jenkins build, and return reference

func InitializeJiraTaskPlugin

func InitializeJiraTaskPlugin(taskType config.TaskType) TaskPlugin

InitializeJiraTaskPlugin to init plugin

func InitializeReleaseImagePlugin

func InitializeReleaseImagePlugin(taskType config.TaskType) TaskPlugin

InitializeReleaseImagePlugin ...

func InitializeSecurityPlugin

func InitializeSecurityPlugin(taskType config.TaskType) TaskPlugin

InitializeSecurityPlugin ...

func InitializeTestTaskPlugin

func InitializeTestTaskPlugin(taskType config.TaskType) TaskPlugin

InitializeTestTaskPlugin ...

type TestPlugin

type TestPlugin struct {
	Name          config.TaskType
	KubeNamespace string
	JobName       string
	FileName      string

	Task *task.Testing
	Log  *zap.SugaredLogger
	// contains filtered or unexported fields
}

TestPlugin name should be compatible with task type

func (*TestPlugin) Complete

func (p *TestPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serviceName string)

Complete ...

func (*TestPlugin) GetTask

func (p *TestPlugin) GetTask() interface{}

func (*TestPlugin) Init

func (p *TestPlugin) Init(jobname, filename string, xl *zap.SugaredLogger)

Init ...

func (*TestPlugin) IsTaskDone

func (p *TestPlugin) IsTaskDone() bool

func (*TestPlugin) IsTaskEnabled

func (p *TestPlugin) IsTaskEnabled() bool

IsTaskEnabled ..

func (*TestPlugin) IsTaskFailed

func (p *TestPlugin) IsTaskFailed() bool

IsTaskFailed ...

func (*TestPlugin) ResetError

func (p *TestPlugin) ResetError()

ResetError ...

func (*TestPlugin) Run

func (p *TestPlugin) Run(ctx context.Context, pipelineTask *task.Task, pipelineCtx *task.PipelineCtx, serviceName string)

func (*TestPlugin) SetAckFunc

func (p *TestPlugin) SetAckFunc(func())

func (*TestPlugin) SetEndTime

func (p *TestPlugin) SetEndTime()

SetEndTime ...

func (*TestPlugin) SetStartTime

func (p *TestPlugin) SetStartTime()

SetStartTime ...

func (*TestPlugin) SetStatus

func (p *TestPlugin) SetStatus(status config.Status)

SetStatus ...

func (*TestPlugin) SetTask

func (p *TestPlugin) SetTask(t map[string]interface{}) error

func (*TestPlugin) Status

func (p *TestPlugin) Status() config.Status

Status ...

func (*TestPlugin) TaskTimeout

func (p *TestPlugin) TaskTimeout() int

TaskTimeout ...

func (*TestPlugin) Type

func (p *TestPlugin) Type() config.TaskType

Type ...

func (*TestPlugin) Wait

func (p *TestPlugin) Wait(ctx context.Context)

Wait ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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