task

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IToi

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

Types

type Artifact

type Artifact struct {
	TaskType   config.TaskType `bson:"type"                          json:"type"`
	Enabled    bool            `bson:"enabled"                       json:"enabled"`
	TaskStatus config.Status   `bson:"status"                        json:"status"`
	Name       string          `bson:"name"                          json:"name"`
	Image      string          `bson:"image"                         json:"image"`
	RegistryID string          `bson:"registry_id"                   json:"registry_id"`
	Timeout    int             `bson:"timeout,omitempty"             json:"timeout,omitempty"`
	Error      string          `bson:"error,omitempty"               json:"error,omitempty"`
	StartTime  int64           `bson:"start_time,omitempty"          json:"start_time,omitempty"`
	EndTime    int64           `bson:"end_time,omitempty"            json:"end_time,omitempty"`
	LogFile    string          `bson:"log_file"                      json:"log_file"`
	IsRestart  bool            `bson:"is_restart"                    json:"is_restart"`
}

func (*Artifact) ToSubTask

func (d *Artifact) ToSubTask() (map[string]interface{}, error)

type ArtifactInfo added in v1.6.0

type ArtifactInfo struct {
	URL          string `bson:"url"                 json:"url"`
	WorkflowName string `bson:"workflow_name"       json:"workflow_name"`
	TaskID       int64  `bson:"task_id"             json:"task_id"`
	FileName     string `bson:"file_name"           json:"file_name"`
}

type Build

type Build struct {
	TaskType    config.TaskType `bson:"type"                       json:"type"`
	Enabled     bool            `bson:"enabled"                    json:"enabled"`
	TaskStatus  config.Status   `bson:"status"                     json:"status"`
	ProductName string          `bson:"product_name"               json:"product_name"`
	// 新增一个service表示服务名称
	Service string `bson:"service"                    json:"service"`
	// 该名称实际为服务组件名称
	ServiceName       string                      `bson:"service_name"               json:"service_name"`
	ServiceType       string                      `bson:"service_type"               json:"service_type"`
	EnvName           string                      `bson:"env_name"                   json:"env_name"`
	Namespace         string                      `bson:"namespace"                  json:"namespace"`
	Timeout           int                         `bson:"timeout"                    json:"timeout,omitempty"`
	Error             string                      `bson:"error,omitempty"            json:"error,omitempty"`
	StartTime         int64                       `bson:"start_time"                 json:"start_time,omitempty"`
	EndTime           int64                       `bson:"end_time"                   json:"end_time,omitempty"`
	JobCtx            JobCtx                      `bson:"job_ctx"                    json:"job_ctx"`
	DockerBuild       *DockerBuild                `bson:"docker_build,omitempty"     json:"docker_build,omitempty"`
	InstallItems      []*models.Item              `bson:"install_items"              json:"install_items"`
	BuildOS           string                      `bson:"build_os"                   json:"build_os,omitempty"`
	ImageFrom         string                      `bson:"image_from"                 json:"image_from,omitempty"`
	ImageID           string                      `bson:"image_id"                   json:"image_id"`
	ResReq            setting.Request             `bson:"res_req"                    json:"res_req"`
	LogFile           string                      `bson:"log_file"                   json:"log_file"`
	InstallCtx        []*models.Install           `bson:"-"                          json:"install_ctx,omitempty"`
	Registries        []*models.RegistryNamespace `bson:"-"                   json:"registries"`
	StaticCheckStatus *StaticCheckStatus          `bson:"static_check_status,omitempty" json:"static_check_status,omitempty"`
	UTStatus          *UTStatus                   `bson:"ut_status,omitempty" json:"ut_status,omitempty"`
	DockerBuildStatus *DockerBuildStatus          `bson:"docker_build_status,omitempty" json:"docker_build_status,omitempty"`
	BuildStatus       *BuildStatus                `bson:"build_status,omitempty" json:"build_status,omitempty"`
	IsRestart         bool                        `bson:"is_restart"                      json:"is_restart"`
	// Get the host bound to the environment of the cloud host service configuration
	EnvHostInfo  map[string][]string `bson:"env_host_info,omitempty"         json:"env_host_info,omitempty"`
	ArtifactInfo *ArtifactInfo       `bson:"artifact_info,omitempty"         json:"artifact_info,omitempty"`
}

func (*Build) ToSubTask

func (b *Build) ToSubTask() (map[string]interface{}, error)

ToSubTask ...

type BuildStatus

type BuildStatus struct {
	StepStatus
}

type BuildStep

type BuildStep struct {
	BuildType  string `bson:"type"                         json:"type"`
	Scripts    string `bson:"scripts"                      json:"scripts"`
	MainGoFile string `bson:"main,omitempty"               json:"main,omitempty"`
}

type Deploy

type Deploy struct {
	TaskType         config.TaskType `bson:"type"                          json:"type"`
	Enabled          bool            `bson:"enabled"                       json:"enabled"`
	TaskStatus       config.Status   `bson:"status"                        json:"status"`
	Namespace        string          `bson:"namespace"                     json:"namespace"`
	EnvName          string          `bson:"env_name"                      json:"env_name"`
	ProductName      string          `bson:"product_name"                  json:"product_name"`
	ServiceName      string          `bson:"service_name"                  json:"service_name"`
	ServiceType      string          `bson:"service_type"                  json:"service_type"`
	ServiceRevision  int64           `bson:"service_revision,omitempty"    json:"service_revision,omitempty"`
	ContainerName    string          `bson:"container_name"                json:"container_name"`
	Image            string          `bson:"image"                         json:"image"`
	Timeout          int             `bson:"timeout,omitempty"             json:"timeout,omitempty"`
	Error            string          `bson:"error,omitempty"               json:"error,omitempty"`
	StartTime        int64           `bson:"start_time,omitempty"          json:"start_time,omitempty"`
	EndTime          int64           `bson:"end_time,omitempty"            json:"end_time,omitempty"`
	ClusterID        string          `bson:"cluster_id,omitempty"          json:"cluster_id,omitempty"`
	ReplaceResources []Resource      `bson:"replace_resources"             json:"replace_resources"`
	SkipWaiting      bool            `bson:"skipWaiting"                   json:"skipWaiting"`
	IsRestart        bool            `bson:"is_restart"                    json:"is_restart"`
	ResetImage       bool            `bson:"reset_image"                   json:"reset_image"`
}

Deploy 容器部署任务

func (*Deploy) SetImage

func (d *Deploy) SetImage(image string)

SetImage ...

func (*Deploy) SetNamespace

func (d *Deploy) SetNamespace(namespace string)

SetNamespace ...

func (*Deploy) ToSubTask

func (d *Deploy) ToSubTask() (map[string]interface{}, error)

ToSubTask ...

type DistributeToS3

type DistributeToS3 struct {
	TaskType       config.TaskType `bson:"type"                           json:"type"`
	Enabled        bool            `bson:"enabled"                        json:"enabled"`
	TaskStatus     config.Status   `bson:"status"                         json:"status"`
	PackageFile    string          `bson:"package_file"                   json:"package_file"`
	ProductName    string          `bson:"product_name"                   json:"product_name"`
	ServiceName    string          `bson:"service_name"                   json:"service_name"`
	RemoteFileKey  string          `bson:"remote_file_key"                json:"remote_file_key,omitempty"`
	Timeout        int             `bson:"timeout,omitempty"              json:"timeout,omitempty"`
	Error          string          `bson:"error,omitempty"                json:"error,omitempty"`
	StartTime      int64           `bson:"start_time,omitempty"           json:"start_time,omitempty"`
	EndTime        int64           `bson:"end_time,omitempty"             json:"end_time,omitempty"`
	DestStorageURL string          `bson:"dest_storage_url"               json:"dest_storage_url"`
	//SrcStorageUrl  string `bson:"src_storage_url"                json:"src_storage_url"`
	S3StorageID string `bson:"s3_storage_id"                  json:"s3_storage_id"`
}

func (*DistributeToS3) SetPackageFile

func (d *DistributeToS3) SetPackageFile(packageFile string)

func (*DistributeToS3) ToSubTask

func (d *DistributeToS3) ToSubTask() (map[string]interface{}, error)

type DockerBuild

type DockerBuild struct {
	TaskType   config.TaskType `bson:"type"                    json:"type"`
	Enabled    bool            `bson:"enabled"                 json:"enabled"`
	TaskStatus config.Status   `bson:"status"                  json:"status"`
	WorkDir    string          `bson:"work_dir"                json:"work_dir"`             // Dockerfile 路径
	DockerFile string          `bson:"docker_file"             json:"docker_file"`          // Dockerfile 名称, 默认为Dockerfile
	BuildArgs  string          `bson:"build_args,omitempty"    json:"build_args,omitempty"` // Docker build可变参数
	Image      string          `bson:"image"                   json:"image"`
	OnSetup    string          `bson:"setup,omitempty"         json:"setup,omitempty"`
	Timeout    int             `bson:"timeout"                 json:"timeout,omitempty"`
	Error      string          `bson:"error"                   json:"error,omitempty"`
	StartTime  int64           `bson:"start_time"              json:"start_time,omitempty"`
	EndTime    int64           `bson:"end_time"                json:"end_time,omitempty"`
	JobName    string          `bson:"job_name"                json:"job_name"`
	LogFile    string          `bson:"log_file"                json:"log_file"`
}

func (*DockerBuild) ToSubTask

func (db *DockerBuild) ToSubTask() (map[string]interface{}, error)

ToSubTask ...

type DockerBuildCtx

type DockerBuildCtx struct {
	Source          string `yaml:"source" bson:"source" json:"source"`
	TemplateID      string `yaml:"template_id" bson:"template_id" json:"template_id"`
	WorkDir         string `yaml:"work_dir" bson:"work_dir" json:"work_dir"`
	DockerFile      string `yaml:"docker_file" bson:"docker_file" json:"docker_file"`
	ImageName       string `yaml:"image_name" bson:"image_name" json:"image_name"`
	BuildArgs       string `yaml:"build_args" bson:"build_args" json:"build_args"`
	ImageReleaseTag string `yaml:"image_release_tag,omitempty" bson:"image_release_tag,omitempty" json:"image_release_tag"`
}

DockerBuildCtx ... Docker build参数 WorkDir: docker build执行路径 DockerFile: dockerfile名称, 默认为Dockerfile ImageBuild: build image镜像全称, e.g. xxx.com/release-candidates/image:tag

func (*DockerBuildCtx) GetDockerFile

func (buildCtx *DockerBuildCtx) GetDockerFile() string

GetDockerFile ...

type DockerBuildStatus

type DockerBuildStatus struct {
	StepStatus
	ImageName    string `bson:"image_name" json:"image_name"`
	RegistryRepo string `bson:"registry_repo" json:"registry_repo"`
}

type FileArchiveCtx

type FileArchiveCtx struct {
	FileLocation string `yaml:"file_location" bson:"file_location" json:"file_location"`
	FileName     string `yaml:"file_name" bson:"file_name" json:"file_name"`
}

type JenkinsBuild

type JenkinsBuild struct {
	TaskType           config.TaskType     `bson:"type"                    json:"type"`
	Enabled            bool                `bson:"enabled"                 json:"enabled"`
	TaskStatus         config.Status       `bson:"status"                  json:"status"`
	ServiceName        string              `bson:"service_name"            json:"service_name"`
	Service            string              `bson:"service"                 json:"service"`
	OnSetup            string              `bson:"setup,omitempty"         json:"setup,omitempty"`
	Timeout            int                 `bson:"timeout"                 json:"timeout,omitempty"`
	Error              string              `bson:"error"                   json:"error,omitempty"`
	ResReq             setting.Request     `bson:"res_req"                 json:"res_req"`
	JenkinsIntegration *JenkinsIntegration `bson:"-"                       json:"jenkins_integration"`
	JenkinsBuildArgs   *JenkinsBuildArgs   `bson:"-"                       json:"jenkins_build_args"`
	StartTime          int64               `bson:"start_time"              json:"start_time,omitempty"`
	EndTime            int64               `bson:"end_time"                json:"end_time,omitempty"`
	LogFile            string              `bson:"log_file"                json:"log_file"`
	Image              string              `bson:"image,omitempty"         json:"image,omitempty"`
	IsRestart          bool                `bson:"is_restart"              json:"is_restart"`
}

JenkinsBuild ...

func (*JenkinsBuild) SetIntegration

func (j *JenkinsBuild) SetIntegration(jenkinsIntegration *JenkinsIntegration)

SetIntegration ...

func (*JenkinsBuild) SetJenkinsBuildArgs

func (j *JenkinsBuild) SetJenkinsBuildArgs(jenkinsBuildArgs *JenkinsBuildArgs)

SetIntegration ...

func (*JenkinsBuild) ToSubTask

func (j *JenkinsBuild) ToSubTask() (map[string]interface{}, error)

ToSubTask ...

type JenkinsBuildArgs

type JenkinsBuildArgs struct {
	JobName            string               `bson:"job_name"            json:"job_name"`
	JenkinsBuildParams []*JenkinsBuildParam `bson:"jenkins_build_param" json:"jenkins_build_params"`
}

type JenkinsBuildParam

type JenkinsBuildParam struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

type JenkinsIntegration

type JenkinsIntegration struct {
	URL      string `bson:"url"                   json:"url"`
	Username string `bson:"username"              json:"username"`
	Password string `bson:"password"              json:"password"`
}

type Jira

type Jira struct {
	TaskType   config.TaskType     `bson:"type"                     json:"type"`
	Enabled    bool                `bson:"enabled"                  json:"enabled"`
	TaskStatus config.Status       `bson:"status"                   json:"status"`
	Builds     []*types.Repository `bson:"builds,omitempty"         json:"builds,omitempty"`
	// TODO: (min) move JiraIssue back to this file
	Issues    []*models.JiraIssue `bson:"issues,omitempty"         json:"issues,omitempty"`
	Timeout   int                 `bson:"timeout,omitempty"        json:"timeout,omitempty"`
	Error     string              `bson:"error,omitempty"          json:"error,omitempty"`
	StartTime int64               `bson:"start_time,omitempty"     json:"start_time,omitempty"`
	EndTime   int64               `bson:"end_time,omitempty"       json:"end_time,omitempty"`
}

func (*Jira) ToSubTask

func (j *Jira) ToSubTask() (map[string]interface{}, error)

ToSubTask ...

type JobCtx

type JobCtx struct {
	EnableProxy    bool          `bson:"enable_proxy"                   json:"enable_proxy"`
	Proxy          *models.Proxy `bson:"proxy"                          json:"proxy"`
	CleanWorkspace bool          `bson:"clean_workspace"                json:"clean_workspace"`

	// BuildJobCtx
	Builds     []*types.Repository `bson:"builds"                         json:"builds"`
	BuildSteps []*BuildStep        `bson:"build_steps,omitempty"          json:"build_steps"`
	SSHs       []*SSH              `bson:"sshs,omitempty"                 json:"sshs"`
	// Envs stores user defined env key val for build
	// TODO: 之后可以不用keystore, 将用户敏感信息保存在此字段
	EnvVars     []*models.KeyVal `bson:"envs,omitempty"                 json:"envs"`
	UploadPkg   bool             `bson:"upload_pkg"                     json:"upload_pkg"`
	PackageFile string           `bson:"package_file,omitempty"         json:"package_file,omitempty"`
	Image       string           `bson:"image,omitempty"                json:"image,omitempty"`

	// TestJobCtx
	TestThreshold  int    `bson:"test_threshold"                 json:"test_threshold"`
	TestResultPath string `bson:"test_result_path,omitempty"     json:"test_result_path,omitempty"`
	TestReportPath string `bson:"test_report_path"               json:"test_report_path"`
	TestJobName    string `bson:"test_job_name,omitempty"        json:"test_job_name,omitempty"`
	// DockerBuildCtx
	DockerBuildCtx *DockerBuildCtx `bson:"docker_build_ctx,omitempty" json:"docker_build_ctx,omitempty"`
	FileArchiveCtx *FileArchiveCtx `bson:"file_archive_ctx,omitempty" json:"file_archive_ctx,omitempty"`
	// TestType
	TestType string `bson:"test_type"                       json:"test_type"`
	// Caches
	Caches        []string `bson:"caches" json:"caches"`
	ArtifactPaths []string `bson:"artifact_paths,omitempty" json:"artifact_paths,omitempty"`
	IsHasArtifact bool     `bson:"is_has_artifact" json:"is_has_artifact"`

	// ClassicBuild used by qbox build
	ClassicBuild    bool   `bson:"classic_build"                  json:"classic_build"`
	PostScripts     string `bson:"post_scripts,omitempty"         json:"post_scripts"`
	PMDeployScripts string `bson:"pm_deploy_scripts,omitempty"    json:"pm_deploy_scripts"`
}

type JobCtxBuilder

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

JobCtxBuilder ...

type PipelineCtx

type PipelineCtx struct {
	DockerHost        string
	Workspace         string
	DistDir           string
	DockerMountDir    string
	ConfigMapMountDir string
	MultiRun          bool
}

type ReleaseImage

type ReleaseImage struct {
	TaskType     config.TaskType `bson:"type"                           json:"type"`
	Enabled      bool            `bson:"enabled"                        json:"enabled"`
	TaskStatus   config.Status   `bson:"status"                         json:"status"`
	ImageTest    string          `bson:"image_test"                     json:"image_test"`
	ImageRelease string          `bson:"image_release"                  json:"image_release"`
	ImageRepo    string          `bson:"image_repo"                     json:"image_repo"`
	Timeout      int             `bson:"timeout,omitempty"              json:"timeout,omitempty"`
	Error        string          `bson:"error,omitempty"                json:"error,omitempty"`
	StartTime    int64           `bson:"start_time,omitempty"           json:"start_time,omitempty"`
	EndTime      int64           `bson:"end_time,omitempty"             json:"end_time,omitempty"`
	LogFile      string          `bson:"log_file"                       json:"log_file"`

	// destinations to distribute images
	Releases []models.RepoImage `bson:"releases"                 json:"releases"`
}

ReleaseImage 线上镜像分发任务

func (*ReleaseImage) SetImage

func (ri *ReleaseImage) SetImage(image string)

SetImage ...

func (*ReleaseImage) ToSubTask

func (ri *ReleaseImage) ToSubTask() (map[string]interface{}, error)

ToSubTask ...

type ReleaseImageItem

type ReleaseImageItem struct {
	RepoID string `bson:"id" json:"id"`
	Image  string `bson:"image" json:"image"`
}

type Repo

type Repo struct {
	Source  string `bson:"source" json:"source"`
	Address string `bson:"address" json:"address"`
	Owner   string `bson:"owner" json:"owner"`
	Name    string `bson:"name" json:"name"`
}

type RepoCoverage

type RepoCoverage struct {
	Repo

	NoStmt       int `bson:"no_stmt" json:"no_stmt"`
	NoMissedStmt int `bson:"no_missed_stmt" json:"no_missed_stmt"`
}

type RepoStaticCheck

type RepoStaticCheck struct {
	Repo
	SecurityMeasureCount int `bson:"security_measure_count" json:"security_measure_count"`
	IssueMeasureCount    int `bson:"issue_measure_count" json:"issue_measure_count"`
}

type Resource

type Resource struct {
	Name      string `json:"name" bson:"name"`
	Kind      string `json:"kind" bson:"kind"`
	Container string `json:"container" bson:"container"`
	Origin    string `json:"origin" bson:"origin"`
}

type SSH

type SSH struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	UserName   string `json:"user_name"`
	IP         string `json:"ip"`
	IsProd     bool   `json:"is_prod"`
	Label      string `json:"label"`
	PrivateKey string `json:"private_key"`
}

type Security

type Security struct {
	TaskType   config.TaskType `bson:"type"                          json:"type"`
	Enabled    bool            `bson:"enabled"                       json:"enabled"`
	TaskStatus config.Status   `bson:"status"                        json:"status"`
	ImageName  string          `bson:"image_name"                    json:"image_name"`
	ImageID    string          `bson:"image_id"                      json:"image_id"`
	Timeout    int             `bson:"timeout,omitempty"             json:"timeout,omitempty"`
	Error      string          `bson:"error,omitempty"               json:"error,omitempty"`
	StartTime  int64           `bson:"start_time,omitempty"          json:"start_time,omitempty"`
	EndTime    int64           `bson:"end_time,omitempty"            json:"end_time,omitempty"`
	LogFile    string          `bson:"log_file"                      json:"log_file"`
	Summary    map[string]int  `bson:"summary"                       json:"summary"`
}

func (*Security) SetImageName

func (s *Security) SetImageName(imageName string)

func (*Security) ToSubTask

func (s *Security) ToSubTask() (map[string]interface{}, error)

type StaticCheckStatus

type StaticCheckStatus struct {
	StepStatus
	Repos []RepoStaticCheck `bson:"repos" json:"repos"`
}

type StepStatus

type StepStatus struct {
	StartTime int64         `bson:"start_time"                 json:"start_time"`
	EndTime   int64         `bson:"end_time"                   json:"end_time"`
	Status    config.Status `bson:"status"                     json:"status"`
}

type Task

type Task struct {
	ID           primitive.ObjectID       `bson:"_id,omitempty"           json:"id,omitempty"`
	TaskID       int64                    `bson:"task_id"                   json:"task_id"`
	ProductName  string                   `bson:"product_name"              json:"product_name"`
	PipelineName string                   `bson:"pipeline_name"             json:"pipeline_name"`
	Type         config.PipelineType      `bson:"type"                      json:"type"`
	Status       config.Status            `bson:"status"                    json:"status,omitempty"`
	Description  string                   `bson:"description,omitempty"     json:"description,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"`
	SubTasks     []map[string]interface{} `bson:"sub_tasks"                 json:"sub_tasks"`
	Stages       []*models.Stage          `bson:"stages"                    json:"stages"`
	ReqID        string                   `bson:"req_id,omitempty"          json:"req_id,omitempty"`
	AgentHost    string                   `bson:"agent_host,omitempty"      json:"agent_host,omitempty"`
	DockerHost   string                   `bson:"-"                         json:"docker_host,omitempty"`
	TeamName     string                   `bson:"team,omitempty"            json:"team,omitempty"`
	IsDeleted    bool                     `bson:"is_deleted"                json:"is_deleted"`
	IsArchived   bool                     `bson:"is_archived"               json:"is_archived"`
	AgentID      string                   `bson:"agent_id"        json:"agent_id"`
	// 是否允许同时运行多次
	MultiRun bool `bson:"multi_run"                 json:"multi_run"`
	// target 服务名称, k8s为容器名称, 物理机为服务名
	Target string `bson:"target,omitempty"                    json:"target"`
	// 使用预定义编译管理模块中的内容生成SubTasks,
	// 查询条件为 服务模板名称: ServiceTmpl, 版本: BuildModuleVer
	// 如果为空,则使用pipeline自定义SubTasks
	BuildModuleVer string `bson:"build_module_ver,omitempty"                 json:"build_module_ver"`

	ServiceName string `bson:"service_name,omitempty"              json:"service_name,omitempty"`
	// TaskArgs 单服务工作流任务参数
	TaskArgs *models.TaskArgs `bson:"task_args,omitempty"         json:"task_args,omitempty"`
	// WorkflowArgs 多服务工作流任务参数
	WorkflowArgs *models.WorkflowTaskArgs `bson:"workflow_args"         json:"workflow_args,omitempty"`
	// TestArgs 测试任务参数
	TestArgs *models.TestTaskArgs `bson:"test_args,omitempty"         json:"test_args,omitempty"`
	// ServiceTaskArgs 脚本部署工作流任务参数
	ServiceTaskArgs *models.ServiceTaskArgs `bson:"service_args,omitempty"         json:"service_args,omitempty"`
	// ConfigPayload 系统配置信息
	ConfigPayload *models.ConfigPayload      `json:"config_payload,omitempty"`
	Error         string                     `bson:"error,omitempty"                json:"error,omitempty"`
	Services      [][]*models.ProductService `bson:"services"                  json:"services"`
	Render        *models.RenderInfo         `bson:"render"                    json:"render"`
	StorageURI    string                     `bson:"storage_uri,omitempty" json:"storage_uri,omitempty"`
	// interface{} 为types.TestReport
	TestReports map[string]interface{} `bson:"test_reports,omitempty" json:"test_reports,omitempty"`

	RwLock sync.Mutex `bson:"-" json:"-"`

	ResetImage bool `json:"resetImage" bson:"resetImage"`

	TriggerBy *models.TriggerBy `json:"trigger_by,omitempty" bson:"trigger_by,omitempty"`

	Features        []string `bson:"features" json:"features"`
	IsRestart       bool     `bson:"is_restart"                      json:"is_restart"`
	StorageEndpoint string   `bson:"storage_endpoint"            json:"storage_endpoint"`
}

func (Task) TableName

func (Task) TableName() string

type Testing

type Testing struct {
	TaskType     config.TaskType   `bson:"type"                            json:"type"`
	Enabled      bool              `bson:"enabled"                         json:"enabled"`
	TaskStatus   config.Status     `bson:"status"                          json:"status"`
	TestName     string            `bson:"test_name"                       json:"test_name"`
	Timeout      int               `bson:"timeout,omitempty"               json:"timeout,omitempty"`
	Error        string            `bson:"error,omitempty"                 json:"error,omitempty"`
	StartTime    int64             `bson:"start_time,omitempty"            json:"start_time,omitempty"`
	EndTime      int64             `bson:"end_time,omitempty"              json:"end_time,omitempty"`
	JobCtx       JobCtx            `bson:"job_ctx"                         json:"job_ctx"`
	InstallItems []*models.Item    `bson:"install_items"                   json:"install_items"`
	InstallCtx   []*models.Install `bson:"-"                               json:"install_ctx"`
	BuildOS      string            `bson:"build_os"                        json:"build_os,omitempty"`
	ImageFrom    string            `bson:"image_from"                      json:"image_from,omitempty"`
	ImageID      string            `bson:"image_id"                        json:"image_id"`
	// ResReq defines job requested resources
	ResReq         config.Request              `bson:"res_req"                         json:"res_req"`
	LogFile        string                      `bson:"log_file"                        json:"log_file"`
	TestModuleName string                      `bson:"test_module_name"                json:"test_module_name"`
	ReportReady    bool                        `bson:"report_ready"                    json:"report_ready"`
	IsRestart      bool                        `bson:"is_restart"                      json:"is_restart"`
	Registries     []*models.RegistryNamespace `bson:"-"                               json:"registries"`
}

func (*Testing) ToSubTask

func (t *Testing) ToSubTask() (map[string]interface{}, error)

type UTStatus

type UTStatus struct {
	StepStatus

	Repos []RepoCoverage `bson:"repos" json:"repos"`
}

Jump to

Keyboard shortcuts

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