Documentation ¶
Index ¶
- Constants
- func CleanWorkflowJobs(ctx context.Context, workflowTask *commonmodels.WorkflowTask, ...)
- func GetK8sClients(hubServerAddr, clusterID string) (crClient.Client, kubernetes.Interface, *rest.Config, error)
- func GetObjectPath(subFolder, name string) string
- func RunJobs(ctx context.Context, jobs []*commonmodels.JobTask, ...)
- type BlueGreenDeployJobCtl
- type BlueGreenReleaseJobCtl
- type CanaryDeployJobCtl
- type CanaryReleaseJobCtl
- type CustomDeployJobCtl
- type DeployJobCtl
- type EnvVar
- type FreestyleJobCtl
- type HelmDeployJobCtl
- type JobContext
- type JobCtl
- type JobLabel
- type PluginJobCtl
- type Pool
- type Proxy
Constants ¶
View Source
const ( DindServer = "dind" KoderoverAgentNamespace = "koderover-agent" )
View Source
const ( BusyBoxImage = "koderover.tencentcloudcr.com/koderover-public/busybox:latest" ZadigContextDir = "/zadig/" ZadigLogFile = ZadigContextDir + "zadig.log" ZadigLifeCycleFile = ZadigContextDir + "lifecycle" JobExecutorFile = "http://resource-server/jobexecutor" ResourceServer = "resource-server" )
View Source
const (
CanaryDeploymentSuffix = "-zadig-canary"
)
Variables ¶
This section is empty.
Functions ¶
func CleanWorkflowJobs ¶
func CleanWorkflowJobs(ctx context.Context, workflowTask *commonmodels.WorkflowTask, workflowCtx *commonmodels.WorkflowTaskCtx, logger *zap.SugaredLogger, ack func())
func GetK8sClients ¶
func GetObjectPath ¶
func RunJobs ¶
func RunJobs(ctx context.Context, jobs []*commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, concurrency int, logger *zap.SugaredLogger, ack func())
Types ¶
type BlueGreenDeployJobCtl ¶
type BlueGreenDeployJobCtl struct {
// contains filtered or unexported fields
}
func NewBlueGreenDeployJobCtl ¶
func NewBlueGreenDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *BlueGreenDeployJobCtl
func (*BlueGreenDeployJobCtl) Clean ¶
func (c *BlueGreenDeployJobCtl) Clean(ctx context.Context)
func (*BlueGreenDeployJobCtl) Run ¶
func (c *BlueGreenDeployJobCtl) Run(ctx context.Context)
type BlueGreenReleaseJobCtl ¶
type BlueGreenReleaseJobCtl struct {
// contains filtered or unexported fields
}
func NewBlueGreenReleaseJobCtl ¶
func NewBlueGreenReleaseJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *BlueGreenReleaseJobCtl
func (*BlueGreenReleaseJobCtl) Clean ¶
func (c *BlueGreenReleaseJobCtl) Clean(ctx context.Context)
func (*BlueGreenReleaseJobCtl) Run ¶
func (c *BlueGreenReleaseJobCtl) Run(ctx context.Context)
type CanaryDeployJobCtl ¶
type CanaryDeployJobCtl struct {
// contains filtered or unexported fields
}
func NewCanaryDeployJobCtl ¶
func NewCanaryDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *CanaryDeployJobCtl
func (*CanaryDeployJobCtl) Clean ¶
func (c *CanaryDeployJobCtl) Clean(ctx context.Context)
func (*CanaryDeployJobCtl) Run ¶
func (c *CanaryDeployJobCtl) Run(ctx context.Context)
type CanaryReleaseJobCtl ¶
type CanaryReleaseJobCtl struct {
// contains filtered or unexported fields
}
func NewCanaryReleaseJobCtl ¶
func NewCanaryReleaseJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *CanaryReleaseJobCtl
func (*CanaryReleaseJobCtl) Clean ¶
func (c *CanaryReleaseJobCtl) Clean(ctx context.Context)
func (*CanaryReleaseJobCtl) Run ¶
func (c *CanaryReleaseJobCtl) Run(ctx context.Context)
type CustomDeployJobCtl ¶
type CustomDeployJobCtl struct {
// contains filtered or unexported fields
}
func NewCustomDeployJobCtl ¶
func NewCustomDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *CustomDeployJobCtl
func (*CustomDeployJobCtl) Clean ¶
func (c *CustomDeployJobCtl) Clean(ctx context.Context)
func (*CustomDeployJobCtl) Run ¶
func (c *CustomDeployJobCtl) Run(ctx context.Context)
type DeployJobCtl ¶
type DeployJobCtl struct {
// contains filtered or unexported fields
}
func NewDeployJobCtl ¶
func NewDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *DeployJobCtl
func (*DeployJobCtl) Clean ¶
func (c *DeployJobCtl) Clean(ctx context.Context)
func (*DeployJobCtl) Run ¶
func (c *DeployJobCtl) Run(ctx context.Context)
type FreestyleJobCtl ¶
type FreestyleJobCtl struct {
// contains filtered or unexported fields
}
func NewFreestyleJobCtl ¶
func NewFreestyleJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *FreestyleJobCtl
func (*FreestyleJobCtl) Clean ¶
func (c *FreestyleJobCtl) Clean(ctx context.Context)
func (*FreestyleJobCtl) Run ¶
func (c *FreestyleJobCtl) Run(ctx context.Context)
type HelmDeployJobCtl ¶
type HelmDeployJobCtl struct {
// contains filtered or unexported fields
}
func NewHelmDeployJobCtl ¶
func NewHelmDeployJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *HelmDeployJobCtl
func (*HelmDeployJobCtl) Clean ¶
func (c *HelmDeployJobCtl) Clean(ctx context.Context)
func (*HelmDeployJobCtl) Run ¶
func (c *HelmDeployJobCtl) Run(ctx context.Context)
type JobContext ¶
type JobContext struct { Name string `yaml:"name"` // Workspace 容器工作目录 [必填] Workspace string `yaml:"workspace"` Proxy *Proxy `yaml:"proxy"` // Envs 用户注入环境变量, 包括安装脚本环境变量 [optional] Envs EnvVar `yaml:"envs"` // SecretEnvs 用户注入敏感信息环境变量, value不能在stdout stderr中输出 [optional] SecretEnvs EnvVar `yaml:"secret_envs"` // WorkflowName WorkflowName string `yaml:"workflow_name"` // TaskID TaskID int64 `yaml:"task_id"` // Paths 执行脚本Path Paths string `yaml:"paths"` Steps []*commonmodels.StepTask `yaml:"steps"` Outputs []string `yaml:"outputs"` }
func BuildJobExcutorContext ¶
func BuildJobExcutorContext(jobTaskSpec *commonmodels.JobTaskFreestyleSpec, job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, logger *zap.SugaredLogger) *JobContext
type PluginJobCtl ¶
type PluginJobCtl struct {
// contains filtered or unexported fields
}
func NewPluginsJobCtl ¶
func NewPluginsJobCtl(job *commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, ack func(), logger *zap.SugaredLogger) *PluginJobCtl
func (*PluginJobCtl) Clean ¶
func (c *PluginJobCtl) Clean(ctx context.Context)
func (*PluginJobCtl) Run ¶
func (c *PluginJobCtl) Run(ctx context.Context)
type Pool ¶
type Pool struct { Jobs []*commonmodels.JobTask // contains filtered or unexported fields }
Pool is a worker group that runs a number of tasks at a configured concurrency.
func NewPool ¶
func NewPool(ctx context.Context, jobs []*commonmodels.JobTask, workflowCtx *commonmodels.WorkflowTaskCtx, concurrency int, logger *zap.SugaredLogger, ack func()) *Pool
NewPool initializes a new pool with the given tasks and at the given concurrency.
type Proxy ¶
type Proxy struct { Type string `yaml:"type"` Address string `yaml:"address"` Port int `yaml:"port"` NeedPassword bool `yaml:"need_password"` Username string `yaml:"username"` Password string `yaml:"password"` EnableRepoProxy bool `yaml:"enable_repo_proxy"` EnableApplicationProxy bool `yaml:"enable_application_proxy"` }
Proxy 翻墙配置信息
Click to show internal directories.
Click to hide internal directories.