workflow

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 84 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameSpaceRegexString = "[^a-z0-9.-]"

	InterceptCommitID = 8
)
View Source
const (
	OfficalRepoOwner = "koderover"
	OfficalRepoName  = "zadig"
	OfficalRepoURL   = "https://github.com/" + OfficalRepoOwner + "/" + OfficalRepoName
	OfficalBranch    = "main"
)
View Source
const (
	ClusterStorageEP = "nfs-server"
)
View Source
const SplitSymbol = "&"

Variables

View Source
var SubtaskOrder = map[config.TaskType]int{
	config.TaskType("jira"):            1,
	config.TaskType("pipeline"):        2,
	config.TaskType("buildv2"):         3,
	config.TaskType("buildv3"):         4,
	config.TaskType("jenkins_build"):   5,
	config.TaskType("docker_build"):    6,
	config.TaskType("archive"):         7,
	config.TaskType("artifact"):        8,
	config.TaskType("artifact_deploy"): 9,
	config.TaskType("deploy"):          10,
	config.TaskType("testingv2"):       11,
	config.TaskType("security"):        12,
	config.TaskType("distribute2kodo"): 13,
	config.TaskType("release_image"):   14,
	config.TaskType("reset_image"):     15,
	config.TaskType("trigger"):         16,
	config.TaskType("extension"):       17,
	config.TaskType("scanning"):        18,
}

Functions

func AddJiraSubTask

func AddJiraSubTask(moduleName, target, serviceName, productName, buildName string, log *zap.SugaredLogger) (map[string]interface{}, error)

func AddPipelineJiraSubTask

func AddPipelineJiraSubTask(pipeline *commonmodels.Pipeline, log *zap.SugaredLogger) (map[string]interface{}, error)

func AddSubtaskToStage

func AddSubtaskToStage(stages *[]*commonmodels.Stage, subTask map[string]interface{}, target string)

func ApproveStage added in v1.9.9

func ApproveStage(workflowName, stageName, userName, userID, comment string, taskID int64, approve bool, logger *zap.SugaredLogger) error

func BlockedTaskQueue

func BlockedTaskQueue() ([]*task.Task, error)

func BuildInstallCtx added in v1.9.9

func BuildInstallCtx(installItems []*commonmodels.Item) ([]*commonmodels.Install, error)

根据用户的配置和BuildStep中步骤的依赖,从系统配置的InstallItems中获取配置项,构建Install Context

func BuildModuleToSubTasks

func BuildModuleToSubTasks(args *commonmodels.BuildModuleArgs, log *zap.SugaredLogger) ([]map[string]interface{}, error)

func BulkCopyWorkflow added in v1.9.9

func BulkCopyWorkflow(args BulkCopyWorkflowArgs, username string, log *zap.SugaredLogger) error

func BulkCopyWorkflowV4 added in v1.9.9

func BulkCopyWorkflowV4(args BulkCopyWorkflowArgs, username string, log *zap.SugaredLogger) error

func CancelWorkflowTaskV4 added in v1.9.9

func CancelWorkflowTaskV4(userName, workflowName string, taskID int64, logger *zap.SugaredLogger) error

func CheckShareStorageEnabled added in v1.9.9

func CheckShareStorageEnabled(clusterID, jobType, identifyName, project string, logger *zap.SugaredLogger) (bool, error)

func CheckWorkflowV4LarkApproval added in v1.16.0

func CheckWorkflowV4LarkApproval(workflowName, uid string, log *zap.SugaredLogger) error

func Clean

func Clean(task *task.Task)

func CleanWorkflow3 added in v1.8.0

func CleanWorkflow3(task *task.Task)

func CloneWorkflowTaskV4 added in v1.9.9

func CloneWorkflowTaskV4(workflowName string, taskID int64, logger *zap.SugaredLogger) (*commonmodels.WorkflowV4, error)

func ConvertQueueToTask

func ConvertQueueToTask(queueTask *commonmodels.Queue) *task.Task

func ConvertTaskToQueue

func ConvertTaskToQueue(task *task.Task) *commonmodels.Queue

func CopyPipeline added in v1.2.0

func CopyPipeline(oldPipelineName, newPipelineName, username string, log *zap.SugaredLogger) error

func CopyWorkflow

func CopyWorkflow(oldWorkflowName, newWorkflowName, newWorkflowDisplayName, username string, log *zap.SugaredLogger) error

func CreateArtifactPackageTask added in v1.8.0

func CreateArtifactPackageTask(args *commonmodels.ArtifactPackageTaskArgs, taskCreator string, log *zap.SugaredLogger) (int64, error)

get global config payload

func CreateCronForWorkflowV4 added in v1.9.9

func CreateCronForWorkflowV4(workflowName string, input *commonmodels.Cronjob, logger *zap.SugaredLogger) error

func CreateFavoritePipeline

func CreateFavoritePipeline(args *commonmodels.Favorite, log *zap.SugaredLogger) error

func CreateGerritWebhook

func CreateGerritWebhook(workflow *commonmodels.Workflow, log *zap.SugaredLogger) error

func CreateTask

func CreateTask(t *task.Task) error

CreateTask 接受create task请求, 保存task到数据库, 发送task到queue

func CreateWebhookForWorkflowV4 added in v1.9.9

func CreateWebhookForWorkflowV4(workflowName string, input *commonmodels.WorkflowV4Hook, logger *zap.SugaredLogger) error

func CreateWorkflow

func CreateWorkflow(workflow *commonmodels.Workflow, log *zap.SugaredLogger) error

func CreateWorkflowV3 added in v1.8.0

func CreateWorkflowV3(user string, workflowModel *commonmodels.WorkflowV3, logger *zap.SugaredLogger) (string, error)

func CreateWorkflowV4 added in v1.9.9

func CreateWorkflowV4(user string, workflow *commonmodels.WorkflowV4, logger *zap.SugaredLogger) error

func CreateWorkflowView added in v1.9.9

func CreateWorkflowView(name, projectName string, workflowList []*commonmodels.WorkflowViewDetail, username string, logger *zap.SugaredLogger) error

func CreateWorkflowViewOpenAPI added in v1.9.9

func CreateWorkflowViewOpenAPI(name, projectName string, workflowList []*commonmodels.WorkflowViewDetail, username string, logger *zap.SugaredLogger) error

func DeleteCronForWorkflowV4 added in v1.9.9

func DeleteCronForWorkflowV4(workflowName, cronID string, logger *zap.SugaredLogger) error

func DeleteCronjob

func DeleteCronjob(parentName, parentType string) error

func DeleteFavoritePipeline

func DeleteFavoritePipeline(args *commonrepo.FavoriteArgs) error

func DeleteGerritWebhook

func DeleteGerritWebhook(workflow *commonmodels.Workflow, log *zap.SugaredLogger) error

DeleteGerritWebhook 删除gerrit webhook

func DeletePluginRepo added in v1.9.9

func DeletePluginRepo(id string, log *zap.SugaredLogger) error

func DeleteWebhookForWorkflowV4 added in v1.9.9

func DeleteWebhookForWorkflowV4(workflowName, triggerName string, logger *zap.SugaredLogger) error

func DeleteWorkflowV3 added in v1.8.0

func DeleteWorkflowV3(id string, logger *zap.SugaredLogger) error

func DeleteWorkflowV4 added in v1.9.9

func DeleteWorkflowV4(name string, logger *zap.SugaredLogger) error

func DeleteWorkflowView added in v1.9.9

func DeleteWorkflowView(projectName, viewName string, logger *zap.SugaredLogger) error

func EnsureBuildResp

func EnsureBuildResp(mb *commonmodels.Build)

func EnsureSubTasksResp

func EnsureSubTasksResp(subTasks []map[string]interface{})

EnsureSubTasksResp 确保SubTask中敏感信息和其他不必要信息不返回给前端

func EnsureSubTasksV3Resp added in v1.8.0

func EnsureSubTasksV3Resp(subTasks []map[string]interface{})

EnsureSubTasksResp 确保SubTask中敏感信息和其他不必要信息不返回给前端

func EnsureTaskResp

func EnsureTaskResp(mt *commonmodels.Testing)

func EnsureTestingResp

func EnsureTestingResp(mt *commonmodels.Testing)

func FindWorkflow

func FindWorkflow(workflowName string, log *zap.SugaredLogger) (*commonmodels.Workflow, error)

func FindWorkflowV4 added in v1.9.9

func FindWorkflowV4(encryptedKey, name string, logger *zap.SugaredLogger) (*commonmodels.WorkflowV4, error)

func FmtBuilds

func FmtBuilds(builds []*types.Repository, log *zap.SugaredLogger)

replace gitInfo with codehostID

func GePackageFileContent added in v1.2.0

func GePackageFileContent(pipelineName string, taskID int64, log *zap.SugaredLogger) ([]byte, string, error)

func GetArtifactAndS3Info added in v1.6.0

func GetArtifactAndS3Info(pipelineName, dir string, taskID int64, notHistoryFileFlag bool, log *zap.SugaredLogger) (*s3.S3, *s3tool.Client, []string, []byte, error)

func GetArtifactFileContent

func GetArtifactFileContent(pipelineName string, taskID int64, notHistoryFileFlag bool, log *zap.SugaredLogger) ([]byte, error)

func GetBundleResources added in v1.9.9

func GetBundleResources(logger *zap.SugaredLogger) ([]*resourceSpec, error)

func GetCronForWorkflowV4Preset added in v1.9.9

func GetCronForWorkflowV4Preset(workflowName, cronID string, logger *zap.SugaredLogger) (*commonmodels.Cronjob, error)

func GetFiltersPipelineTaskV2 added in v1.9.0

func GetFiltersPipelineTaskV2(projectName, pipelineName, querytype string, typeString config.PipelineType, log *zap.SugaredLogger) ([]interface{}, error)

func GetImage

func GetImage(registry *commonmodels.RegistryNamespace, suffix string) string

GetImage suffix 可以是 branch name 或者 pr number

func GetLatestTaskInfo added in v1.9.9

func GetLatestTaskInfo(workflowInfo *Workflow) (startTime int64, creator, status string)
func GetLink(p *task.Task, baseURI string, taskType config.PipelineType) string

func GetPackageFile

func GetPackageFile(suffix string) string

GetPackageFile suffix 可以是 branch name 或者 pr number

func GetPatchParams added in v1.9.9

func GetPatchParams(patchItem *commonmodels.PatchItem, logger *zap.SugaredLogger) ([]*commonmodels.Param, error)

func GetPipeline added in v1.2.0

func GetPipeline(userID, pipelineName string, log *zap.SugaredLogger) (*commonmodels.Pipeline, error)

func GetPipelineTaskV2

func GetPipelineTaskV2(taskID int64, pipelineName string, typeString config.PipelineType, log *zap.SugaredLogger) (*task.Task, error)

func GetRaw

func GetRaw(name, productName string, log *zap.SugaredLogger) (*commonmodels.Testing, error)

GetRaw find the testing module with secret env not masked

func GetS3RelStorage

func GetS3RelStorage(logger *zap.SugaredLogger) (*commonmodels.S3Storage, error)

GetS3RelStorage find the default s3storage

func GetS3Storage

func GetS3Storage(id string, logger *zap.SugaredLogger) (*commonmodels.S3Storage, error)

func GetServiceNames

func GetServiceNames(p *commonmodels.Product) []string

func GetTesting

func GetTesting(name, productName string, log *zap.SugaredLogger) (*commonmodels.Testing, error)

func GetWebhookForWorkflowV4Preset added in v1.9.9

func GetWebhookForWorkflowV4Preset(workflowName, triggerName string, logger *zap.SugaredLogger) (*commonmodels.WorkflowV4Hook, error)

func GetWorkflowGlabalVars added in v1.9.9

func GetWorkflowGlabalVars(workflow *commonmodels.WorkflowV4, currentJobName string, log *zap.SugaredLogger) []string

func GetWorkflowTaskV3 added in v1.8.0

func GetWorkflowTaskV3(taskID int64, pipelineName string, typeString config.PipelineType, log *zap.SugaredLogger) (*task.Task, error)

func GetWorkflowTaskV3Callback added in v1.8.0

func GetWorkflowTaskV3Callback(taskID int64, pipelineName string, logger *zap.SugaredLogger) (*commonmodels.CallbackRequest, error)

func GetWorkflowV4ArtifactFileContent added in v1.9.9

func GetWorkflowV4ArtifactFileContent(workflowName, jobName string, taskID int64, log *zap.SugaredLogger) ([]byte, error)

func GetWorkflowViewPreset added in v1.9.9

func GetWorkflowViewPreset(projectName, viewName string, logger *zap.SugaredLogger) (*commonmodels.WorkflowView, error)

func GetWorkflowv4Preset added in v1.9.9

func GetWorkflowv4Preset(encryptedKey, workflowName, uid string, log *zap.SugaredLogger) (*commonmodels.WorkflowV4, error)

func HandleCronjob

func HandleCronjob(workflow *commonmodels.Workflow, log *zap.SugaredLogger) error

func InitPipelineController

func InitPipelineController()

func InitQueue

func InitQueue() error

func IsProductAuthed

func IsProductAuthed(username, productOwner, productName string, perm config.ProductPermission, log *zap.SugaredLogger) bool

IsProductAuthed 查询指定产品是否授权给用户, 或者用户所在的组 TODO: REVERT Auth is diabled

func JenkinsBuildModuleToSubTasks

func JenkinsBuildModuleToSubTasks(jenkinsBuildOption *JenkinsBuildOption, log *zap.SugaredLogger) ([]map[string]interface{}, error)

func LintWorkflowV4 added in v1.9.9

func LintWorkflowV4(workflow *commonmodels.WorkflowV4, logger *zap.SugaredLogger) error

func ListBuildDetail

func ListBuildDetail(name, targets string, log *zap.SugaredLogger) ([]*commonmodels.Build, error)

func ListCronForWorkflowV4 added in v1.9.9

func ListCronForWorkflowV4(workflowName string, logger *zap.SugaredLogger) ([]*commonmodels.Cronjob, error)

func ListFavoritePipelines

func ListFavoritePipelines(args *commonrepo.FavoriteArgs) ([]*commonmodels.Favorite, error)

func ListPipelines added in v1.2.0

func ListPipelines(log *zap.SugaredLogger) ([]*commonmodels.Pipeline, error)

func ListPluginTemplates added in v1.9.9

func ListPluginTemplates(log *zap.SugaredLogger) ([]*commonmodels.PluginTemplate, error)

func ListTasks

func ListTasks() []*task.Task

func ListTestWorkflows added in v1.7.0

func ListTestWorkflows(testName string, projects []string, log *zap.SugaredLogger) (workflows []*commonmodels.Workflow, err error)

func ListUnofficalPluginRepositories added in v1.9.9

func ListUnofficalPluginRepositories(log *zap.SugaredLogger) ([]*commonmodels.PluginRepo, error)

func ListWebhookForWorkflowV4 added in v1.9.9

func ListWebhookForWorkflowV4(workflowName string, logger *zap.SugaredLogger) ([]*commonmodels.WorkflowV4Hook, error)

func ListWorkflowTaskV4 added in v1.13.0

func ListWorkflowTaskV4(workflowName string, pageNum, pageSize int64, logger *zap.SugaredLogger) ([]*commonmodels.WorkflowTask, int64, error)

func ListWorkflowViewNames added in v1.9.9

func ListWorkflowViewNames(projectName string, logger *zap.SugaredLogger) ([]string, error)

func NextWaitingTask

func NextWaitingTask() (*task.Task, error)

NextWaitingTask 查询下一个等待的task

func ParallelRunningAndQueuedTasks

func ParallelRunningAndQueuedTasks(currentTask *task.Task) bool

func PendingPipelineTasks

func PendingPipelineTasks() []*task.Task

func PendingTasks

func PendingTasks() []*task.Task

func PipelineTaskSender

func PipelineTaskSender()

PipelineTaskSender 监控warpdrive空闲情况, 如果有空闲, 则发现下一个waiting task给warpdrive 并将task状态设置为queued

func PresetWorkflowArgs

func PresetWorkflowArgs(namespace, workflowName string, log *zap.SugaredLogger) (*commonmodels.WorkflowTaskArgs, error)

PresetWorkflowArgs 返回工作流详细信息

func Push

func Push(pt *task.Task) error

func RenamePipeline added in v1.2.0

func RenamePipeline(oldName, newName string, log *zap.SugaredLogger) error

func RestartPipelineTaskV2

func RestartPipelineTaskV2(userName string, taskID int64, pipelineName string, typeString config.PipelineType, log *zap.SugaredLogger) error

func RestartWorkflowTaskV3 added in v1.8.0

func RestartWorkflowTaskV3(userName string, taskID int64, workflowName string, typeString config.PipelineType, log *zap.SugaredLogger) error

func RunningAndQueuedTasks

func RunningAndQueuedTasks() []*task.Task

func RunningPipelineTasks

func RunningPipelineTasks() []*task.Task

func RunningTasks

func RunningTasks() []*task.Task

func SetCandidateRegistry

func SetCandidateRegistry(payload *commonmodels.ConfigPayload, log *zap.SugaredLogger) error

func SetTriggerBuilds

func SetTriggerBuilds(builds []*types.Repository, buildArgs []*types.Repository, log *zap.SugaredLogger) error

外部触发任务设置build参数

func SubScribeNSQ

func SubScribeNSQ() error

func TestArgsToTestSubtask

func TestArgsToTestSubtask(args *commonmodels.TestTaskArgs, pt *task.Task, log *zap.SugaredLogger) (*task.Testing, error)

func UIType

func UIType(pipelineType config.PipelineType) string

func UpdateCronForWorkflowV4 added in v1.9.9

func UpdateCronForWorkflowV4(input *commonmodels.Cronjob, logger *zap.SugaredLogger) error

func UpdateCronjob

func UpdateCronjob(parentName, parentType, productName string, schedule *commonmodels.ScheduleCtrl, log *zap.SugaredLogger) (deleteList []string, err error)

func UpdateGerritWebhook

func UpdateGerritWebhook(currentWorkflow *commonmodels.Workflow, log *zap.SugaredLogger) error

UpdateGerritWebhook 更新gerrit webhook

func UpdateOfficalPluginRepository added in v1.9.9

func UpdateOfficalPluginRepository(log *zap.SugaredLogger)

func UpdateQueue

func UpdateQueue(task *task.Task) bool

func UpdateTask

func UpdateTask(t *task.Task) error

func UpdateTaskAgent

func UpdateTaskAgent(taskID int64, pipelineName string, createTime int64, agentID string) error

func UpdateWebhookForWorkflowV4 added in v1.9.9

func UpdateWebhookForWorkflowV4(workflowName string, input *commonmodels.WorkflowV4Hook, logger *zap.SugaredLogger) error

func UpdateWorkflow

func UpdateWorkflow(workflow *commonmodels.Workflow, log *zap.SugaredLogger) error

func UpdateWorkflowTaskV4 added in v1.13.0

func UpdateWorkflowTaskV4(id string, workflowTask *commonmodels.WorkflowTask, logger *zap.SugaredLogger) error

func UpdateWorkflowV3 added in v1.8.0

func UpdateWorkflowV3(id, user string, workflowModel *commonmodels.WorkflowV3, logger *zap.SugaredLogger) error

func UpdateWorkflowV4 added in v1.9.9

func UpdateWorkflowV4(name, user string, inputWorkflow *commonmodels.WorkflowV4, logger *zap.SugaredLogger) error

func UpdateWorkflowView added in v1.9.9

func UpdateWorkflowView(input *commonmodels.WorkflowView, userName string, logger *zap.SugaredLogger) error

func UpsertEnterprisePluginRepository added in v1.9.9

func UpsertEnterprisePluginRepository(args *commonmodels.PluginRepo, log *zap.SugaredLogger) error

func UpsertPipeline added in v1.2.0

func UpsertPipeline(args *commonmodels.Pipeline, log *zap.SugaredLogger) error

func UpsertUserPluginRepository added in v1.9.9

func UpsertUserPluginRepository(args *commonmodels.PluginRepo, log *zap.SugaredLogger) error

Types

type BlueGreenDeployArgs added in v1.9.9

type BlueGreenDeployArgs struct {
	ServiceName string `json:"service_name"`
	ImageName   string `json:"image_name"`
}

type BlueGreenDeployJobInput added in v1.9.9

type BlueGreenDeployJobInput struct {
	ServiceList []*BlueGreenDeployArgs `json:"service_list"`
}

func (*BlueGreenDeployJobInput) UpdateJobSpec added in v1.9.9

func (p *BlueGreenDeployJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type BulkCopyWorkflowArgs added in v1.9.9

type BulkCopyWorkflowArgs struct {
	Items []WorkflowCopyItem `json:"items"`
}

type ByStageKind

type ByStageKind []*commonmodels.Stage

func (ByStageKind) Len

func (a ByStageKind) Len() int

func (ByStageKind) Less

func (a ByStageKind) Less(i, j int) bool

func (ByStageKind) Swap

func (a ByStageKind) Swap(i, j int)

type ByTaskKind

type ByTaskKind []map[string]interface{}

func (ByTaskKind) Len

func (a ByTaskKind) Len() int

func (ByTaskKind) Less

func (a ByTaskKind) Less(i, j int) bool

func (ByTaskKind) Swap

func (a ByTaskKind) Swap(i, j int)

type CanaryDeployArgs added in v1.9.9

type CanaryDeployArgs struct {
	ServiceName string `json:"service_name"`
	ImageName   string `json:"image_name"`
}

type CanaryDeployJobInput added in v1.9.9

type CanaryDeployJobInput struct {
	ServiceList []*BlueGreenDeployArgs `json:"service_list"`
}

func (*CanaryDeployJobInput) UpdateJobSpec added in v1.9.9

func (p *CanaryDeployJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type CancelMessage

type CancelMessage struct {
	Revoker      string `json:"revoker"`
	PipelineName string `json:"pipeline_name"`
	TaskID       int64  `json:"task_id"`
	ReqID        string `json:"req_id"`
}

type ContainerNotFound

type ContainerNotFound struct {
	ServiceName string
	Container   string
	EnvName     string
	ProductName string
}

func (*ContainerNotFound) Error

func (c *ContainerNotFound) Error() string

type CreateCustomTaskJobInput added in v1.9.9

type CreateCustomTaskJobInput struct {
	JobName    string         `json:"job_name"`
	JobType    config.JobType `json:"job_type"`
	Parameters interface{}    `json:"parameters"`
}

type CreateProductTaskJobInput added in v1.9.9

type CreateProductTaskJobInput struct {
	TargetEnv  string            `json:"target_env"`
	BuildArgs  WorkflowBuildArg  `json:"build"`
	DeployArgs WorkflowDeployArg `json:"deploy"`
}

type CreateTaskResp

type CreateTaskResp struct {
	ProjectName  string `json:"project_name"`
	PipelineName string `json:"pipeline_name"`
	TaskID       int64  `json:"task_id"`
}

func AddDataToArgsOrCreateReleaseImageTask added in v1.8.0

func AddDataToArgsOrCreateReleaseImageTask(args *commonmodels.WorkflowTaskArgs, log *zap.SugaredLogger) (*CreateTaskResp, error)

add data to workflow args or create release image task

func CreateArtifactWorkflowTask

func CreateArtifactWorkflowTask(args *commonmodels.WorkflowTaskArgs, taskCreator string, log *zap.SugaredLogger) (*CreateTaskResp, error)

func CreatePipelineTask

func CreatePipelineTask(args *commonmodels.TaskArgs, log *zap.SugaredLogger) (*CreateTaskResp, error)

func CreateServiceTask added in v1.2.0

func CreateServiceTask(args *commonmodels.ServiceTaskArgs, log *zap.SugaredLogger) ([]*CreateTaskResp, error)

func CreateWorkflowTask

func CreateWorkflowTask(args *commonmodels.WorkflowTaskArgs, taskCreator string, log *zap.SugaredLogger) (*CreateTaskResp, error)

func OpenAPICreateProductWorkflowTask added in v1.9.9

func OpenAPICreateProductWorkflowTask(username string, args *OpenAPICreateProductWorkflowTaskArgs, logger *zap.SugaredLogger) (*CreateTaskResp, error)

type CreateTaskV4Resp added in v1.9.9

type CreateTaskV4Resp struct {
	ProjectName  string `json:"project_name"`
	WorkflowName string `json:"workflow_name"`
	TaskID       int64  `json:"task_id"`
}

func CreateCustomWorkflowTask added in v1.9.9

func CreateCustomWorkflowTask(username string, args *OpenAPICreateCustomWorkflowTaskArgs, log *zap.SugaredLogger) (*CreateTaskV4Resp, error)

CreateCustomWorkflowTask creates a task for custom workflow with user-friendly inputs, this is currently used for openAPI

func CreateWorkflowTaskV4 added in v1.9.9

func CreateWorkflowTaskV4(args *CreateWorkflowTaskV4Args, workflow *commonmodels.WorkflowV4, log *zap.SugaredLogger) (*CreateTaskV4Resp, error)

type CreateWorkflowTaskV4Args added in v1.9.9

type CreateWorkflowTaskV4Args struct {
	Name   string
	UserID string
}

type CronjobWorkflowArgs

type CronjobWorkflowArgs struct {
	Target []*commonmodels.TargetArgs `bson:"targets"                      json:"targets"`
}

func GetWorkflowArgs

func GetWorkflowArgs(productName, namespace string, log *zap.SugaredLogger) (*CronjobWorkflowArgs, error)

GetWorkflowArgs 返回工作流详细信息

type CustomDeployJobInput added in v1.9.9

type CustomDeployJobInput struct {
	TargetList []*CustomDeployTarget `json:"target_list"`
}

func (*CustomDeployJobInput) UpdateJobSpec added in v1.9.9

func (p *CustomDeployJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type CustomDeployJobSpec added in v1.9.9

type CustomDeployJobSpec struct {
	Image              string `bson:"image"                        json:"image"`
	Target             string `bson:"target"                       json:"target"`
	ClusterName        string `bson:"cluster_name"                 json:"cluster_name"`
	Namespace          string `bson:"namespace"                    json:"namespace"`
	SkipCheckRunStatus bool   `bson:"skip_check_run_status"        json:"skip_check_run_status"`
}

type CustomDeployTarget added in v1.9.9

type CustomDeployTarget struct {
	WorkloadType  string `json:"workload_type"`
	WorkloadName  string `json:"workload_name"`
	ContainerName string `json:"container_name"`
	ImageName     string `json:"image_name"`
}

type CustomJobInput added in v1.9.9

type CustomJobInput interface {
	UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)
}

type DeployEnv

type DeployEnv struct {
	Env         string `json:"env"`
	Type        string `json:"type"`
	ProductName string `json:"product_name,omitempty"`
}

type DistributeImageJobSpec added in v1.9.9

type DistributeImageJobSpec struct {
	SourceRegistryID string                       `bson:"source_registry_id"           json:"source_registry_id"`
	TargetRegistryID string                       `bson:"target_registry_id"           json:"target_registry_id"`
	DistributeTarget []*step.DistributeTaskTarget `bson:"distribute_target"            json:"distribute_target"`
}

type EmptyInput added in v1.9.9

type EmptyInput struct{}

func (*EmptyInput) UpdateJobSpec added in v1.9.9

func (p *EmptyInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type EnvStatus

type EnvStatus struct {
	EnvName    string `json:"env_name,omitempty"`
	Status     string `json:"status"`
	ErrMessage string `json:"err_message"`
}

func AutoCreateWorkflow

func AutoCreateWorkflow(productName string, log *zap.SugaredLogger) *EnvStatus

type FreestyleJobInput added in v1.9.9

type FreestyleJobInput struct {
	KVs      []*types.KV               `json:"kv"`
	RepoInfo []*types.OpenAPIRepoInput `json:"repo_info"`
}

func (*FreestyleJobInput) UpdateJobSpec added in v1.9.9

func (p *FreestyleJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type GoCacheManager

type GoCacheManager struct{}

GoCacheManager is deprecated

func NewGoCacheManager

func NewGoCacheManager() *GoCacheManager

func (*GoCacheManager) Archive

func (gcm *GoCacheManager) Archive(source, dest string) error

type GrayReleaseJobInput added in v1.9.9

type GrayReleaseJobInput struct {
	TargetList []*GrayReleaseTarget `json:"target_list"`
}

func (*GrayReleaseJobInput) UpdateJobSpec added in v1.9.9

func (p *GrayReleaseJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type GrayReleaseTarget added in v1.9.9

type GrayReleaseTarget struct {
	WorkloadType  string `json:"workload_type"`
	WorkloadName  string `json:"workload_name"`
	ContainerName string `json:"container_name"`
	ImageName     string `json:"image_name"`
}

type GrayRollbackJobInput added in v1.9.9

type GrayRollbackJobInput struct {
	TargetList []*GrayReleaseTarget `json:"target_list"`
}

func (*GrayRollbackJobInput) UpdateJobSpec added in v1.9.9

func (p *GrayRollbackJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type GrayRollbackTarget added in v1.9.9

type GrayRollbackTarget struct {
	WorkloadType string `json:"workload_type"`
	WorkloadName string `json:"workload_name"`
}

type ImageIllegal

type ImageIllegal struct {
}

func (*ImageIllegal) Error

func (c *ImageIllegal) Error() string

type ItReportHandler

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

func (*ItReportHandler) HandleMessage

func (h *ItReportHandler) HandleMessage(message *nsq.Message) error

type JenkinsBuildOption

type JenkinsBuildOption struct {
	BuildName        string
	Version          string
	Target           string
	ServiceName      string
	ProductName      string
	JenkinsBuildArgs *commonmodels.JenkinsBuildArgs
}

type JobTaskPreview added in v1.9.9

type JobTaskPreview struct {
	Name      string        `bson:"name"           json:"name"`
	JobType   string        `bson:"type"           json:"type"`
	Status    config.Status `bson:"status"         json:"status"`
	StartTime int64         `bson:"start_time"     json:"start_time,omitempty"`
	EndTime   int64         `bson:"end_time"       json:"end_time,omitempty"`
	Error     string        `bson:"error"          json:"error"`
	Spec      interface{}   `bson:"spec"           json:"spec"`
}

type K8sBlueGreenDeployJobSpec added in v1.9.9

type K8sBlueGreenDeployJobSpec struct {
	Image          string               `bson:"image"                        json:"image"`
	K8sServiceName string               `bson:"k8s_service_name"             json:"k8s_service_name"`
	ClusterName    string               `bson:"cluster_name"                 json:"cluster_name"`
	Namespace      string               `bson:"namespace"                    json:"namespace"`
	ContainerName  string               `bson:"container_name"               json:"container_name"`
	Events         *commonmodels.Events `bson:"events"                       json:"events"`
}

type K8sBlueGreenReleaseJobSpec added in v1.9.9

type K8sBlueGreenReleaseJobSpec struct {
	Image          string               `bson:"image"                        json:"image"`
	K8sServiceName string               `bson:"k8s_service_name"             json:"k8s_service_name"`
	ClusterName    string               `bson:"cluster_name"                 json:"cluster_name"`
	Namespace      string               `bson:"namespace"                    json:"namespace"`
	ContainerName  string               `bson:"container_name"               json:"container_name"`
	Events         *commonmodels.Events `bson:"events"                       json:"events"`
}

type K8sCanaryDeployJobSpec added in v1.9.9

type K8sCanaryDeployJobSpec struct {
	Image          string               `bson:"image"                        json:"image"`
	K8sServiceName string               `bson:"k8s_service_name"             json:"k8s_service_name"`
	ClusterName    string               `bson:"cluster_name"                 json:"cluster_name"`
	Namespace      string               `bson:"namespace"                    json:"namespace"`
	ContainerName  string               `bson:"container_name"               json:"container_name"`
	CanaryReplica  int                  `bson:"canary_replica"               json:"canary_replica"`
	Events         *commonmodels.Events `bson:"events"                       json:"events"`
}

type K8sCanaryReleaseJobSpec added in v1.9.9

type K8sCanaryReleaseJobSpec struct {
	Image          string               `bson:"image"                        json:"image"`
	K8sServiceName string               `bson:"k8s_service_name"             json:"k8s_service_name"`
	ClusterName    string               `bson:"cluster_name"                 json:"cluster_name"`
	Namespace      string               `bson:"namespace"                    json:"namespace"`
	ContainerName  string               `bson:"container_name"               json:"container_name"`
	Events         *commonmodels.Events `bson:"events"                       json:"events"`
}

type K8sPatchJobInput added in v1.9.9

type K8sPatchJobInput struct {
	TargetList []*K8sPatchTarget `json:"target_list"`
}

func (*K8sPatchJobInput) UpdateJobSpec added in v1.9.9

func (p *K8sPatchJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type K8sPatchTarget added in v1.9.9

type K8sPatchTarget struct {
	ResourceName    string      `json:"resource_name"`
	ResourceKind    string      `json:"resource_kind"`
	ResourceGroup   string      `json:"resource_group"`
	ResourceVersion string      `json:"resource_version"`
	Inputs          []*types.KV `json:"inputs"`
}

type OpenAPICreateCustomWorkflowTaskArgs added in v1.9.9

type OpenAPICreateCustomWorkflowTaskArgs struct {
	WorkflowName string                      `json:"workflow_name"`
	ProjectName  string                      `json:"project_name"`
	Inputs       []*CreateCustomTaskJobInput `json:"inputs"`
}

type OpenAPICreateProductWorkflowTaskArgs added in v1.9.9

type OpenAPICreateProductWorkflowTaskArgs struct {
	WorkflowName string                     `json:"workflow_name"`
	ProjectName  string                     `json:"project_name"`
	Input        *CreateProductTaskJobInput `json:"input"`
}

func (*OpenAPICreateProductWorkflowTaskArgs) Validate added in v1.9.9

type PRCommit

type PRCommit struct {
	ID          string     `json:"id"`
	Title       string     `json:"title"`
	AuthorName  string     `json:"author_name"`
	CreatedAt   *time.Time `json:"created_at"`
	CheckoutRef string     `json:"checkout_ref"`
}

func GetLatestPRCommitList

func GetLatestPRCommitList(cli *gitlab.Client, projectID string, pr int) (*PRCommit, error)

func GetLatestPrCommit

func GetLatestPrCommit(codehostID, pr int, namespace, projectName string, log *zap.SugaredLogger) (*PRCommit, error)

type PipelinePreview added in v1.2.0

type PipelinePreview struct {
	ProductName     string                   `bson:"product_name"               json:"product_name"`
	Name            string                   `bson:"name"                       json:"name"`
	TeamName        string                   `bson:"team_name"                  json:"team_name"`
	SubTasks        []map[string]interface{} `bson:"sub_tasks"                  json:"sub_tasks"`
	Types           []string                 `bson:"-"                          json:"types"`
	UpdateBy        string                   `bson:"update_by"                  json:"update_by,omitempty"`
	UpdateTime      int64                    `bson:"update_time"                json:"update_time,omitempty"`
	IsFavorite      bool                     `bson:"is_favorite"                json:"is_favorite"`
	LastestTask     *commonmodels.TaskInfo   `bson:"-"                          json:"lastest_task"`
	LastSucessTask  *commonmodels.TaskInfo   `bson:"-"                          json:"last_task_success"`
	LastFailureTask *commonmodels.TaskInfo   `bson:"-"                          json:"last_task_failure"`
	TotalDuration   int64                    `bson:"-"                          json:"total_duration"`
	TotalNum        int                      `bson:"-"                          json:"total_num"`
	TotalSuccess    int                      `bson:"-"                          json:"total_success"`
}

func ListPipelinesPreview added in v1.2.0

func ListPipelinesPreview(userID string, log *zap.SugaredLogger) ([]*PipelinePreview, error)

type PluginJobInput added in v1.9.9

type PluginJobInput struct {
	KVs []*types.KV `json:"kv"`
}

func (*PluginJobInput) UpdateJobSpec added in v1.9.9

func (p *PluginJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type PreSetResp

type PreSetResp struct {
	Target          *commonmodels.ServiceModuleTarget `json:"target"`
	BuildModuleVers []string                          `json:"build_module_vers"`
	Deploy          []DeployEnv                       `json:"deploy"`
	Repos           []*types.Repository               `json:"repos"`
}

func PreSetWorkflow

func PreSetWorkflow(productName string, log *zap.SugaredLogger) ([]*PreSetResp, error)

type Preview

type Preview struct {
	Name         string              `json:"name"`
	DisplayName  string              `json:"display_name"`
	WorkflowType config.PipelineType `json:"workflow_type"`
}

type ProductNameWithType

type ProductNameWithType struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	Namespace string `json:"namespace"`
}

func ListOldEnvsByServiceName

func ListOldEnvsByServiceName(serviceName string, log *zap.SugaredLogger) []ProductNameWithType

func ListPipelineUpdatableProductNames added in v1.2.0

func ListPipelineUpdatableProductNames(userName, pipelineName string, log *zap.SugaredLogger) ([]ProductNameWithType, error)

type Queue

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

func NewPipelineQueue

func NewPipelineQueue(log *zap.SugaredLogger) *Queue

func (*Queue) BlockedTaskQueue

func (q *Queue) BlockedTaskQueue() ([]*task.Task, error)

BlockedTaskQueue ...

func (*Queue) List

func (q *Queue) List() []*task.Task

func (*Queue) NextWaitingTask

func (q *Queue) NextWaitingTask() (*task.Task, error)

NextWaitingTask 查询下一个等待的task

func (*Queue) Push

func (q *Queue) Push(pt *task.Task) error

Push task queue, 如果已经存在相同的 pipeline 并且 multi=false情况 设置新的 pipeline 为 blocked 默认task状态为 created

func (*Queue) Remove

func (q *Queue) Remove(task *task.Task) error

Remove ...

func (*Queue) Update

func (q *Queue) Update(task *task.Task) bool

Update ...

func (*Queue) UpdateAgent

func (q *Queue) UpdateAgent(taskID int64, pipelineName string, createTime int64, agentID string) error

UpdateAgent ...

type RepoCommit

type RepoCommit struct {
	ID         string     `json:"id"`
	Title      string     `json:"title"`
	AuthorName string     `json:"author_name"`
	CreatedAt  *time.Time `json:"created_at"`
	Message    string     `json:"message"`
}

RepoCommit : Repository commit struct

func QueryByBranch

func QueryByBranch(id int, owner, name, branch string, log *zap.SugaredLogger) (*RepoCommit, error)

func QueryByTag

func QueryByTag(id int, owner, name, tag string, log *zap.SugaredLogger) (*RepoCommit, error)

type ScanningArg added in v1.9.9

type ScanningArg struct {
	ScanningName string                    `json:"scanning_name"`
	RepoInfo     []*types.OpenAPIRepoInput `json:"repo_info"`
}

type ServiceAndImage added in v1.9.9

type ServiceAndImage struct {
	ServiceName   string `bson:"service_name"           json:"service_name"`
	ServiceModule string `bson:"service_module"         json:"service_module"`
	Image         string `bson:"image"                  json:"image"`
}

type ServiceDeployArgs added in v1.9.9

type ServiceDeployArgs struct {
	ServiceModule string `json:"service_module"`
	ServiceName   string `json:"service_name"`
	ImageName     string `json:"image_name"`
}

type ServiceTaskPreview

type ServiceTaskPreview struct {
	Workflows []*Preview                         `json:"workflows"`
	Targets   []commonmodels.ServiceModuleTarget `json:"targets"`
}

func ListServiceWorkflows

func ListServiceWorkflows(productName, envName, serviceName, serviceType string, log *zap.SugaredLogger) (*ServiceTaskPreview, error)

type StageTaskPreview added in v1.9.9

type StageTaskPreview struct {
	Name      string                 `bson:"name"          json:"name"`
	Status    config.Status          `bson:"status"        json:"status"`
	StartTime int64                  `bson:"start_time"    json:"start_time,omitempty"`
	EndTime   int64                  `bson:"end_time"      json:"end_time,omitempty"`
	Parallel  bool                   `bson:"parallel"      json:"parallel"`
	Approval  *commonmodels.Approval `bson:"approval"      json:"approval"`
	Jobs      []*JobTaskPreview      `bson:"jobs"          json:"jobs"`
}

type TaskAckHandler

type TaskAckHandler struct {
	TestTaskStatColl *commonrepo.TestTaskStatColl
	// contains filtered or unexported fields
}

func NewTaskAckHandler

func NewTaskAckHandler(maxInFlight int, log *zap.SugaredLogger) *TaskAckHandler

func (*TaskAckHandler) HandleMessage

func (h *TaskAckHandler) HandleMessage(message *nsq.Message) error

HandleMessage 接收 warpdrive 回传 pipeline task 消息 1. 更新 queue pipeline task 2. 更新 数据库 pipeline task 3. 如果 pipeline task 完成, 检查是否有 blocked pipeline task, 检查是否可以unblock, 从queue中移除task pipeline 完成状态包括:passed, failed, timeout 4. 更新 数据库 proudct 5. 更新历史piplinetask的状态为archived(默认只留下最近的一百个task)

type TaskInfo added in v1.7.1

type TaskInfo struct {
	TaskID       int64  `json:"taskID"`
	PipelineName string `json:"pipelineName"`
	Status       string `json:"status"`
	TaskCreator  string `json:"task_creator"`
	CreateTime   int64  `json:"create_time"`
}

type TaskNotificationHandler

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

TaskNotificationHandler ...

func (*TaskNotificationHandler) HandleMessage

func (h *TaskNotificationHandler) HandleMessage(message *nsq.Message) error

HandleMessage ...

type TaskResp added in v1.8.0

type TaskResp struct {
	Name   string `json:"name"`
	TaskID int64  `json:"task_id"`
}

func CreateWorkflowTaskV3 added in v1.8.0

func CreateWorkflowTaskV3(args *commonmodels.WorkflowV3Args, username, reqID string, log *zap.SugaredLogger) (*TaskResp, error)

type TaskResult

type TaskResult struct {
	Data      []*commonrepo.TaskPreview `bson:"data"             json:"data"`
	StartAt   int                       `bson:"start_at"         json:"start_at"`
	MaxResult int                       `bson:"max_result"       json:"max_result"`
	Total     int                       `bson:"total"            json:"total"`
}

TaskResult ...

func ListPipelineTasksV2Result

func ListPipelineTasksV2Result(name string, typeString config.PipelineType, queryType string, filters []string, maxResult, startAt int, log *zap.SugaredLogger) (*TaskResult, error)

ListPipelineTasksV2Result 工作流任务分页信息

func ListWorkflowTasksV3Result added in v1.8.0

func ListWorkflowTasksV3Result(name string, typeString config.PipelineType, maxResult, startAt int, log *zap.SugaredLogger) (*TaskResult, error)

ListWorkflowTasksV3Result 工作流任务分页信息

type TaskV2Info

type TaskV2Info struct {
	TaskID     int64  `json:"task_id"`
	Status     string `json:"status"`
	CreateTime int64  `json:"create_time"`
	StartTime  int64  `json:"start_time"`
	EndTime    int64  `json:"end_time"`
	URL        string `json:"url"`
}

func FindTasks

func FindTasks(commitID string, log *zap.SugaredLogger) ([]*TaskV2Info, error)

type TestingArgs added in v1.9.9

type TestingArgs struct {
	TestingName string                    `json:"testing_name"`
	RepoInfo    []*types.OpenAPIRepoInput `json:"repo_info"`
	Inputs      []*types.KV               `json:"inputs"`
}

type Workflow added in v1.7.1

type Workflow struct {
	Name                 string                     `json:"name"`
	DisplayName          string                     `json:"display_name"`
	ProjectName          string                     `json:"projectName"`
	UpdateTime           int64                      `json:"updateTime"`
	CreateTime           int64                      `json:"createTime"`
	UpdateBy             string                     `json:"updateBy,omitempty"`
	Schedules            *commonmodels.ScheduleCtrl `json:"schedules,omitempty"`
	SchedulerEnabled     bool                       `json:"schedulerEnabled"`
	EnabledStages        []string                   `json:"enabledStages"`
	IsFavorite           bool                       `json:"isFavorite"`
	WorkflowType         string                     `json:"workflow_type"`
	RecentTask           *TaskInfo                  `json:"recentTask"`
	RecentSuccessfulTask *TaskInfo                  `json:"recentSuccessfulTask"`
	RecentFailedTask     *TaskInfo                  `json:"recentFailedTask"`
	AverageExecutionTime float64                    `json:"averageExecutionTime"`
	SuccessRate          float64                    `json:"successRate"`
	Description          string                     `json:"description,omitempty"`
	BaseName             string                     `json:"base_name"`
	BaseRefs             []string                   `json:"base_refs"`
	NeverRun             bool                       `json:"never_run"`
}

func ListAllAvailableWorkflows added in v1.9.9

func ListAllAvailableWorkflows(projects []string, log *zap.SugaredLogger) ([]*Workflow, error)

func ListWorkflowV4 added in v1.9.9

func ListWorkflowV4(projectName, viewName, userID string, names, v4Names []string, policyFound bool, logger *zap.SugaredLogger) ([]*Workflow, error)

func ListWorkflows

func ListWorkflows(projects []string, userID string, names []string, log *zap.SugaredLogger) ([]*Workflow, error)

type WorkflowBuildArg added in v1.9.9

type WorkflowBuildArg struct {
	Enabled     bool                             `json:"enabled"`
	ServiceList []*types.OpenAPIServiceBuildArgs `json:"service_list"`
}

type WorkflowCopyItem added in v1.9.9

type WorkflowCopyItem struct {
	ProjectName    string `json:"project_name"`
	Old            string `json:"old"`
	New            string `json:"new"`
	NewDisplayName string `json:"new_display_name"`
	BaseName       string `json:"base_name"`
}

type WorkflowDeployArg added in v1.9.9

type WorkflowDeployArg struct {
	Enabled     bool                 `json:"enabled"`
	Source      string               `json:"source"`
	ServiceList []*ServiceDeployArgs `json:"service_list"`
}

type WorkflowTaskPreview added in v1.9.9

type WorkflowTaskPreview struct {
	TaskID              int64                 `bson:"task_id"                   json:"task_id"`
	WorkflowName        string                `bson:"workflow_name"             json:"workflow_name"`
	WorkflowDisplayName string                `bson:"workflow_display_name"     json:"workflow_display_name"`
	Params              []*commonmodels.Param `bson:"params"                    json:"params"`
	Status              config.Status         `bson:"status"                    json:"status,omitempty"`
	TaskCreator         string                `bson:"task_creator"              json:"task_creator,omitempty"`
	TaskRevoker         string                `bson:"task_revoker,omitempty"    json:"task_revoker,omitempty"`
	CreateTime          int64                 `bson:"create_time"               json:"create_time,omitempty"`
	StartTime           int64                 `bson:"start_time"                json:"start_time,omitempty"`
	EndTime             int64                 `bson:"end_time"                  json:"end_time,omitempty"`
	Stages              []*StageTaskPreview   `bson:"stages"                    json:"stages"`
	ProjectName         string                `bson:"project_name"              json:"project_name"`
	Error               string                `bson:"error,omitempty"           json:"error,omitempty"`
	IsRestart           bool                  `bson:"is_restart"                json:"is_restart"`
}

func GetWorkflowTaskV4 added in v1.9.9

func GetWorkflowTaskV4(workflowName string, taskID int64, logger *zap.SugaredLogger) (*WorkflowTaskPreview, error)

type WorkflowV3 added in v1.8.0

type WorkflowV3 struct {
	ID          string                    `json:"id"`
	Name        string                    `json:"name"`
	ProjectName string                    `json:"project_name"`
	Description string                    `json:"description"`
	Parameters  []*types.ParameterSetting `json:"parameters"`
	SubTasks    []map[string]interface{}  `json:"sub_tasks"`
}

func GetWorkflowV3Detail added in v1.8.0

func GetWorkflowV3Detail(id string, logger *zap.SugaredLogger) (*WorkflowV3, error)

type WorkflowV3Brief added in v1.8.0

type WorkflowV3Brief struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	ProjectName string `json:"project_name"`
}

func ListWorkflowsV3 added in v1.8.0

func ListWorkflowsV3(projectName string, pageNum, pageSize int64, logger *zap.SugaredLogger) ([]*WorkflowV3Brief, int64, error)

type WorkflowV3TaskArgs added in v1.8.0

type WorkflowV3TaskArgs struct {
	Type    string                   `json:"type"`
	Key     string                   `json:"key,omitempty"`
	Value   string                   `json:"value,omitempty"`
	Choice  []string                 `json:"choice,omitempty"`
	Options []map[string]interface{} `json:"options,omitempty"`
}

func GetWorkflowV3Args added in v1.8.0

func GetWorkflowV3Args(id string, logger *zap.SugaredLogger) ([]*WorkflowV3TaskArgs, error)

type ZadigBuildJobInput added in v1.9.9

type ZadigBuildJobInput struct {
	Registry    string                           `json:"registry"`
	ServiceList []*types.OpenAPIServiceBuildArgs `json:"service_list"`
}

func (*ZadigBuildJobInput) UpdateJobSpec added in v1.9.9

func (p *ZadigBuildJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type ZadigBuildJobSpec added in v1.9.9

type ZadigBuildJobSpec struct {
	Repos         []*types.Repository    `bson:"repos"           json:"repos"`
	Image         string                 `bson:"image"           json:"image"`
	ServiceName   string                 `bson:"service_name"    json:"service_name"`
	ServiceModule string                 `bson:"service_module"  json:"service_module"`
	Envs          []*commonmodels.KeyVal `bson:"envs"            json:"envs"`
}

type ZadigDeployJobInput added in v1.9.9

type ZadigDeployJobInput struct {
	EnvName     string               `json:"env_name"` // required
	ServiceList []*ServiceDeployArgs `json:"service_list"`
}

func (*ZadigDeployJobInput) UpdateJobSpec added in v1.9.9

func (p *ZadigDeployJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type ZadigDeployJobSpec added in v1.13.0

type ZadigDeployJobSpec struct {
	Env                string             `bson:"env"                          json:"env"`
	SkipCheckRunStatus bool               `bson:"skip_check_run_status"        json:"skip_check_run_status"`
	ServiceAndImages   []*ServiceAndImage `bson:"service_and_images"           json:"service_and_images"`
}

type ZadigScanningJobInput added in v1.9.9

type ZadigScanningJobInput struct {
	ScanningList []*ScanningArg `json:"scanning_list"`
}

func (*ZadigScanningJobInput) UpdateJobSpec added in v1.9.9

func (p *ZadigScanningJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type ZadigScanningJobSpec added in v1.9.9

type ZadigScanningJobSpec struct {
	Repos        []*types.Repository `bson:"repos"           json:"repos"`
	LinkURL      string              `bson:"link_url"        json:"link_url"`
	ScanningName string              `bson:"scanning_name"   json:"scanning_name"`
}

type ZadigTestingJobInput added in v1.9.9

type ZadigTestingJobInput struct {
	TestingList []*TestingArgs `json:"testing_list"`
}

func (*ZadigTestingJobInput) UpdateJobSpec added in v1.9.9

func (p *ZadigTestingJobInput) UpdateJobSpec(job *commonmodels.Job) (*commonmodels.Job, error)

type ZadigTestingJobSpec added in v1.9.9

type ZadigTestingJobSpec struct {
	Repos       []*types.Repository    `bson:"repos"           json:"repos"`
	JunitReport bool                   `bson:"junit_report"    json:"junit_report"`
	Archive     bool                   `bson:"archive"         json:"archive"`
	HtmlReport  bool                   `bson:"html_report"     json:"html_report"`
	ProjectName string                 `bson:"project_name"    json:"project_name"`
	TestName    string                 `bson:"test_name"       json:"test_name"`
	Envs        []*commonmodels.KeyVal `bson:"envs"            json:"envs"`
}

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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