models

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageFromKoderover = "koderover"
	ImageFromCustom    = "custom"
)

Variables

This section is empty.

Functions

func IToi

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

Types

type ActivityCommit

type ActivityCommit struct {
	Address       string `bson:"address"                   json:"address"`
	Source        string `bson:"source,omitempty"          json:"source,omitempty"`
	RepoOwner     string `bson:"repo_owner"                json:"repo_owner"`
	RepoName      string `bson:"repo_name"                 json:"repo_name"`
	Branch        string `bson:"branch"                    json:"branch"`
	PR            int    `bson:"pr,omitempty"              json:"pr,omitempty"`
	Tag           string `bson:"tag,omitempty"             json:"tag,omitempty"`
	CommitID      string `bson:"commit_id,omitempty"       json:"commit_id,omitempty"`
	CommitMessage string `bson:"commit_message,omitempty"  json:"commit_message,omitempty"`
	AuthorName    string `bson:"author_name,omitempty"     json:"author_name,omitempty"`
}

type AnnouncementCtx

type AnnouncementCtx struct {
	Title     string `bson:"title"                 json:"title"`      // 公告标题
	Priority  int    `bson:"priority"              json:"priority"`   // 公告级别
	Content   string `bson:"content"               json:"content"`    // 公告内容
	StartTime int64  `bson:"start_time"            json:"start_time"` // 公告开始时间
	EndTime   int64  `bson:"end_time"              json:"end_time"`   // 公告结束时间
}

type ArtifactArgs

type ArtifactArgs struct {
	Name         string      `bson:"name"                                json:"name"`
	ServiceName  string      `bson:"service_name"                        json:"service_name"`
	Image        string      `bson:"image,omitempty"                     json:"image,omitempty"`
	Deploy       []DeployEnv `bson:"deploy"                              json:"deploy"`
	WorkflowName string      `bson:"workflow_name,omitempty"             json:"workflow_name,omitempty"`
	TaskID       int64       `bson:"task_id,omitempty"                   json:"task_id,omitempty"`
	FileName     string      `bson:"file_name,omitempty"                 json:"file_name,omitempty"`
	URL          string      `bson:"url,omitempty"                       json:"url,omitempty"`
}

type ArtifactModule

type ArtifactModule struct {
	Target *ServiceModuleTarget `bson:"target"                 json:"target"`
}

ArtifactModule ...

type ArtifactStage

type ArtifactStage struct {
	Enabled bool              `bson:"enabled"                json:"enabled"`
	Modules []*ArtifactModule `bson:"modules"                json:"modules"`
}

type AslanConfig

type AslanConfig struct {
	URL              string
	WarpdriveService string
}

type BasicImage

type BasicImage struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"          json:"id,omitempty"`
	Value      string             `bson:"value"                  json:"value"`
	Label      string             `bson:"label"                  json:"label"`
	ImageFrom  string             `bson:"image_from"             json:"image_from"`
	CreateTime int64              `bson:"create_time"            json:"create_time"`
	UpdateTime int64              `bson:"update_time"            json:"update_time"`
	UpdateBy   string             `bson:"update_by"              json:"update_by"`
}

BasicImage ...

func (BasicImage) TableName

func (BasicImage) TableName() string

type Build

type Build struct {
	ID      primitive.ObjectID `bson:"_id,omitempty"                json:"id,omitempty"`
	Name    string             `bson:"name"                         json:"name"`
	Team    string             `bson:"team,omitempty"               json:"team,omitempty"`
	Source  string             `bson:"source,omitempty"             json:"source,omitempty"`
	Timeout int                `bson:"timeout"                      json:"timeout"`
	// 在任一编译配置模板中只能出现一次
	// 对于k8s部署是传入容器名称
	// 对于物理机部署是服务名称
	Targets         []*ServiceModuleTarget `bson:"targets"                       json:"targets"`
	Description     string                 `bson:"desc,omitempty"                json:"desc"`
	UpdateTime      int64                  `bson:"update_time"                   json:"update_time"`
	UpdateBy        string                 `bson:"update_by"                     json:"update_by"`
	Repos           []*types.Repository    `bson:"repos"                         json:"repos"`
	PreBuild        *PreBuild              `bson:"pre_build"                     json:"pre_build"`
	JenkinsBuild    *JenkinsBuild          `bson:"jenkins_build,omitempty"       json:"jenkins_build,omitempty"`
	Scripts         string                 `bson:"scripts"                       json:"scripts"`
	PostBuild       *PostBuild             `bson:"post_build,omitempty"          json:"post_build"`
	Caches          []string               `bson:"caches"                        json:"caches"`
	ProductName     string                 `bson:"product_name"                  json:"product_name"`
	SSHs            []string               `bson:"sshs,omitempty"                json:"sshs,omitempty"`
	PMDeployScripts string                 `bson:"pm_deploy_scripts"             json:"pm_deploy_scripts"`
}

func (Build) TableName

func (Build) TableName() string

type BuildArgs

type BuildArgs struct {
	Repos []*types.Repository `bson:"repos"               json:"repos"`
}

type BuildConfig

type BuildConfig struct {
	KubeNamespace string
}

type BuildModule

type BuildModule struct {
	Target         *ServiceModuleTarget `bson:"target"                 json:"target"`
	BuildModuleVer string               `bson:"build_module_ver"       json:"build_module_ver"`
}

BuildModule ...

type BuildModuleArgs added in v1.6.0

type BuildModuleArgs struct {
	BuildName    string
	Target       string
	ServiceName  string
	ProductName  string
	Variables    []*KeyVal
	Env          *Product
	WorkflowName string
	TaskID       int64
	FileName     string
	URL          string
	TaskType     string
}

type BuildObj

type BuildObj struct {
	Targets     []string
	Description string
	Repos       []*types.Repository
	PreBuild    *PreBuild
	Scripts     string
	MainFile    string
	PostBuild   *PostBuild
	Caches      []string
}

type BuildStage

type BuildStage struct {
	Enabled bool           `bson:"enabled"                json:"enabled"`
	Modules []*BuildModule `bson:"modules"                json:"modules"`
}

type CapacityStrategy

type CapacityStrategy struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"  json:"id,omitempty"`
	Target    CapacityTarget     `bson:"target"         json:"target"` // 配额策略的对象,不重复
	Retention *RetentionConfig   `bson:"retention"      json:"retention,omitempty"`
}

CapacityStrategy 系统配额策略

func (CapacityStrategy) TableName

func (CapacityStrategy) TableName() string

type CapacityTarget

type CapacityTarget string

CapacityTarget 系统配额的配置对象

const (
	// 工作流任务的留存
	WorkflowTaskRetention CapacityTarget = "WorkflowTaskRetention"
)

type Commit

type Commit struct {
	SHA     string `bson:"sha"              json:"sha"`
	Message string `bson:"message"          json:"message"`
}

Commit ...

type ConfigPayload

type ConfigPayload struct {
	Proxy     Proxy          `json:"proxy"`
	S3Storage S3Config       `json:"s3_storage"`
	Github    GithubConfig   `json:"github"`
	Gitlab    GitlabConfig   `json:"gitlab"`
	Build     BuildConfig    `json:"build"`
	Test      TestConfig     `json:"test"`
	Registry  RegistryConfig `json:"registry"`
	Release   ReleaseConfig  `json:"release"`
	// 推送线上镜像需要的用户名密码, 根据pipeline镜像发布模块动态配置
	ImageRelease ImageReleaseConfig `json:"image_release"`
	Docker       DockerConfig       `json:"docker"`

	ClassicBuild bool `json:"classic_build"`

	CustomDNSSupported bool `json:"custom_dns_supported"`
	HubServerAddr      string
	DeployClusterID    string

	RepoConfigs map[string]*RegistryNamespace

	// IgnoreCache means ignore docker build cache
	IgnoreCache bool `json:"ignore_cache"`

	// ResetCache means ignore workspace cache
	ResetCache         bool               `json:"reset_cache"`
	JenkinsBuildConfig JenkinsBuildConfig `json:"jenkins_build_config"`
	PrivateKeys        []*PrivateKey      `json:"private_keys"`
}

type Container

type Container struct {
	Name      string         `bson:"name"           json:"name"`
	Image     string         `bson:"image"          json:"image"`
	ImagePath *ImagePathSpec `bson:"image_path,omitempty"          json:"imagePath,omitempty"`
}

Container ...

type Counter

type Counter struct {
	ID  string `bson:"_id"`
	Seq int64  `bson:"seq"`
}

func (Counter) TableName

func (Counter) TableName() string

type CreateFromChartTemplate added in v1.6.0

type CreateFromChartTemplate struct {
	YamlData     *templatemodels.CustomYaml `bson:"yaml_data,omitempty"   json:"yaml_data,omitempty"`
	TemplateName string                     `bson:"template_name" json:"template_name"`
	ServiceName  string                     `bson:"service_name" json:"service_name"`
	Variables    []*Variable                `bson:"variables" json:"variables"`
}

type CreateFromPublicRepo added in v1.6.0

type CreateFromPublicRepo struct {
	RepoLink string `bson:"repo_link" json:"repo_link"`
	LoadPath string `bson:"load_path,omitempty"        json:"load_path,omitempty"`
}

type CreateFromRepo added in v1.6.0

type CreateFromRepo struct {
	GitRepoConfig *templatemodels.GitRepoConfig `bson:"git_repo_config,omitempty"            json:"git_repo_config,omitempty"`
	LoadPath      string                        `bson:"load_path,omitempty"            json:"load_path,omitempty"`
}

type Cronjob

type Cronjob struct {
	ID           primitive.ObjectID `bson:"_id,omitempty"`
	Name         string             `bson:"name"`
	Type         string             `bson:"type"`
	Number       uint64             `bson:"number"`
	Frequency    string             `bson:"frequency"`
	Time         string             `bson:"time"`
	Cron         string             `bson:"cron"`
	ProductName  string             `bson:"product_name,omitempty"`
	MaxFailure   int                `bson:"max_failures,omitempty"`
	TaskArgs     *TaskArgs          `bson:"task_args,omitempty"`
	WorkflowArgs *WorkflowTaskArgs  `bson:"workflow_args,omitempty"`
	TestArgs     *TestTaskArgs      `bson:"test_args,omitempty"`
	JobType      string             `bson:"job_type"`
	Enabled      bool               `bson:"enabled"`
}

func (Cronjob) TableName

func (Cronjob) TableName() string

type DeliveryActivity

type DeliveryActivity struct {
	ArtifactID        primitive.ObjectID `bson:"artifact_id"                  json:"artifact_id"`
	Type              string             `bson:"type"                         json:"type"`
	Content           string             `bson:"content,omitempty"            json:"content,omitempty"`
	URL               string             `bson:"url,omitempty"                json:"url,omitempty"`
	Commits           []*ActivityCommit  `bson:"commits,omitempty"            json:"commits,omitempty"`
	Issues            []string           `bson:"issues,omitempty"             json:"issues,omitempty"`
	Namespace         string             `bson:"namespace,omitempty"          json:"namespace,omitempty"`
	EnvName           string             `bson:"env_name,omitempty"           json:"env_name,omitempty"`
	PublishHosts      []string           `bson:"publish_hosts,omitempty"      json:"publish_hosts,omitempty"`
	PublishNamespaces []string           `bson:"publish_namespaces,omitempty" json:"publish_namespaces,omitempty"`
	RemoteFileKey     string             `bson:"remote_file_key,omitempty"    json:"remote_file_key,omitempty"`
	DistStorageURL    string             `bson:"dist_storage_url,omitempty"   json:"dist_storage_url,omitempty"`
	SrcStorageURL     string             `bson:"src_storage_url,omitempty"    json:"src_storage_url,omitempty"`
	StartTime         int64              `bson:"start_time,omitempty"         json:"start_time,omitempty"`
	EndTime           int64              `bson:"end_time,omitempty"           json:"end_time,omitempty"`
	CreatedBy         string             `bson:"created_by"                   json:"created_by"`
	CreatedTime       int64              `bson:"created_time"                 json:"created_time"`
}

func (DeliveryActivity) TableName

func (DeliveryActivity) TableName() string

type DeliveryArtifact

type DeliveryArtifact struct {
	ID                  primitive.ObjectID `bson:"_id,omitempty"                   json:"id"`
	Name                string             `bson:"name"                            json:"name"`
	Type                string             `bson:"type"                            json:"type"`
	Source              string             `bson:"source"                          json:"source"`
	Image               string             `bson:"image,omitempty"                 json:"image,omitempty"`
	ImageHash           string             `bson:"image_hash,omitempty"            json:"image_hash,omitempty"`
	ImageTag            string             `bson:"image_tag"                       json:"image_tag"`
	ImageDigest         string             `bson:"image_digest,omitempty"          json:"image_digest,omitempty"`
	ImageSize           int64              `bson:"image_size,omitempty"            json:"image_size,omitempty"`
	Architecture        string             `bson:"architecture,omitempty"          json:"architecture,omitempty"`
	Os                  string             `bson:"os,omitempty"                    json:"os,omitempty"`
	DockerFile          string             `bson:"docker_file,omitempty"           json:"docker_file,omitempty"`
	Layers              []Descriptor       `bson:"layers,omitempty"                json:"layers,omitempty"`
	PackageFileLocation string             `bson:"package_file_location,omitempty" json:"package_file_location,omitempty"`
	PackageStorageURI   string             `bson:"package_storage_uri,omitempty"   json:"package_storage_uri,omitempty"`
	CreatedBy           string             `bson:"created_by"                      json:"created_by"`
	CreatedTime         int64              `bson:"created_time"                    json:"created_time"`
}

func (DeliveryArtifact) TableName

func (DeliveryArtifact) TableName() string

type DeliveryBuild

type DeliveryBuild struct {
	ID          primitive.ObjectID  `bson:"_id,omitempty"                json:"id,omitempty"`
	ReleaseID   primitive.ObjectID  `bson:"release_id"           json:"releaseId"`
	ServiceName string              `bson:"service_name"         json:"serviceName"`
	ImageInfo   *DeliveryImage      `bson:"image_info"           json:"imageInfo"`
	ImageName   string              `bson:"image_name"           json:"imageName"`
	PackageInfo *DeliveryPackage    `bson:"package_info"         json:"packageInfo"`
	Issues      []*JiraIssue        `bson:"issues"               json:"issues"`
	Commits     []*types.Repository `bson:"commits"              json:"commits"`
	StartTime   int64               `bson:"start_time"           json:"start_time,omitempty"`
	EndTime     int64               `bson:"end_time"             json:"end_time,omitempty"`
	CreatedAt   int64               `bson:"created_at"           json:"created_at"`
	DeletedAt   int64               `bson:"deleted_at"           json:"deleted_at"`
}

func (DeliveryBuild) TableName

func (DeliveryBuild) TableName() string

type DeliveryDeploy

type DeliveryDeploy struct {
	ID              primitive.ObjectID `bson:"_id,omitempty"                json:"id,omitempty"`
	ReleaseID       primitive.ObjectID `bson:"release_id"                  json:"releaseId"`
	ServiceName     string             `bson:"service_name"                json:"serviceName"`
	ContainerName   string             `bson:"container_name"              json:"containerName"`
	Image           string             `bson:"image,omitempty"             json:"image,omitempty"`
	RegistryID      string             `bson:"registry_id,omitempty"       json:"registry_id,omitempty"`
	YamlContents    []string           `bson:"yaml_contents"               json:"yamlContents"`
	Envs            []EnvObjects       `bson:"envs"                        json:"envs"`
	OrderedServices [][]string         `bson:"ordered_services"            json:"orderedServices"`
	StartTime       int64              `bson:"start_time,omitempty"        json:"start_time,omitempty"`
	EndTime         int64              `bson:"end_time,omitempty"          json:"end_time,omitempty"`
	CreatedAt       int64              `bson:"created_at"                  json:"created_at"`
	DeletedAt       int64              `bson:"deleted_at"                  json:"deleted_at"`
}

func (DeliveryDeploy) TableName

func (DeliveryDeploy) TableName() string

type DeliveryDistribute

type DeliveryDistribute struct {
	ID             primitive.ObjectID    `bson:"_id,omitempty"                json:"id,omitempty"`
	ReleaseID      primitive.ObjectID    `bson:"release_id"             json:"releaseId"`
	ServiceName    string                `bson:"service_name"           json:"serviceName"`
	DistributeType config.DistributeType `bson:"distribute_type"        json:"distributeType"`
	RegistryName   string                `bson:"registry_name"          json:"registryName"`
	Namespace      string                `bson:"namespace"              json:"namespace"`
	PackageFile    string                `bson:"package_file"           json:"packageFile"`
	RemoteFileKey  string                `bson:"remote_file_key"        json:"remoteFileKey"`
	DestStorageURL string                `bson:"dest_storage_url"       json:"destStorageUrl"`
	SrcStorageURL  string                `bson:"src_storage_url"        json:"srcStorageUrl"`
	StartTime      int64                 `bson:"start_time,omitempty"   json:"start_time,omitempty"`
	EndTime        int64                 `bson:"end_time,omitempty"     json:"end_time,omitempty"`
	CreatedAt      int64                 `bson:"created_at"             json:"created_at"`
	DeletedAt      int64                 `bson:"deleted_at"             json:"deleted_at"`
}

func (DeliveryDistribute) TableName

func (DeliveryDistribute) TableName() string

type DeliveryImage

type DeliveryImage struct {
	RepoName      string `bson:"repo_name"       json:"repoName"`
	TagName       string `bson:"tag_name"        json:"tagName"`
	ImageSize     int64  `bson:"image_size"      json:"imageSize"`
	ImageDigest   string `bson:"image_digest"    json:"imageDigest"`
	Author        string `bson:"author"          json:"author"`
	Architecture  string `bson:"architecture"    json:"architecture"`
	DockerVersion string `bson:"docker_version"  json:"dockerVersion"`
	Os            string `bson:"os"              json:"os"`
	CreationTime  string `bson:"creation_time"   json:"creationTime"`
	UpdateTime    string `bson:"update_time"     json:"updateTime"`
}

type DeliveryPackage

type DeliveryPackage struct {
	PackageFileLocation string `bson:"package_file_location"        json:"packageFileLocation"`
	PackageFileName     string `bson:"package_file_name"            json:"packageFileName"`
	PackageStorageURI   string `bson:"package_storage_uri"          json:"packageStorageUri"`
}

type DeliverySecurity

type DeliverySecurity struct {
	ID            primitive.ObjectID `bson:"_id,omitempty"         json:"id,omitempty"`
	ImageID       string             `bson:"image_id"              json:"imageId"`
	ImageName     string             `bson:"image_name"            json:"imageName"`
	LayerID       string             `bson:"layer_id"              json:"layerId"`
	Vulnerability Vulnerability      `bson:"vulnerability"         json:"vulnerability"`
	Feature       Feature            `bson:"feature"               json:"feature"`
	Severity      string             `bson:"severity"              json:"severity"`
	CreatedAt     int64              `bson:"created_at"            json:"created_at"`
	DeletedAt     int64              `bson:"deleted_at"            json:"deleted_at"`
}

func (DeliverySecurity) TableName

func (DeliverySecurity) TableName() string

type DeliveryTest

type DeliveryTest struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"                json:"id,omitempty"`
	ReleaseID   primitive.ObjectID `bson:"release_id"           json:"releaseId"`
	TestReports []TestReportObject `bson:"test_reports"         json:"testReports"`
	StartTime   int64              `bson:"start_time,omitempty" json:"start_time,omitempty"`
	EndTime     int64              `bson:"end_time,omitempty"   json:"end_time,omitempty"`
	CreatedAt   int64              `bson:"created_at"           json:"created_at"`
	DeletedAt   int64              `bson:"deleted_at"           json:"deleted_at"`
}

func (DeliveryTest) TableName

func (DeliveryTest) TableName() string

type DeliveryVersion

type DeliveryVersion struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"           json:"id,omitempty"`
	Version        string             `bson:"version"                 json:"version"`
	ProductName    string             `bson:"product_name"            json:"productName"`
	WorkflowName   string             `bson:"workflow_name"           json:"workflowName"`
	TaskID         int                `bson:"task_id"                 json:"taskId"`
	Desc           string             `bson:"desc"                    json:"desc"`
	Labels         []string           `bson:"labels"                  json:"labels"`
	ProductEnvInfo *Product           `bson:"product_env_info"        json:"productEnvInfo"`
	CreatedBy      string             `bson:"created_by"              json:"createdBy"`
	CreatedAt      int64              `bson:"created_at"              json:"created_at"`
	DeletedAt      int64              `bson:"deleted_at"              json:"deleted_at"`
}

func (DeliveryVersion) TableName

func (DeliveryVersion) TableName() string

type DeployArgs

type DeployArgs struct {
	// 目标部署环境
	Namespace string `json:"namespace"`
	// 镜像或者二进制名称后缀, 一般为branch或者PR
	Tag string `json:"suffix"`
	// 部署镜像名称
	// 格式: xxx.com/{namespace}/{service name}:{timestamp}-{suffix}}
	// timestamp format: 20060102150405
	Image string `json:"image"`
	// 部署二进制包名称
	// 格式: {service name}-{timestamp}-{suffix}}.tar.gz
	// timestamp format: 20060102150405
	PackageFile string `json:"package_file"`
}

type DeployEnv

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

type Descriptor

type Descriptor struct {
	MediaType string   `bson:"mediatype" json:"media_type,omitempty"`
	Size      int64    `bson:"size" json:"size"`
	Digest    string   `bson:"digest" json:"digest,omitempty"`
	URLs      []string `bson:"urls" json:"urls,omitempty"`
}

type DiffNote

type DiffNote struct {
	ObjectID       primitive.ObjectID `bson:"_id,omitempty"            json:"_id"`
	Repo           *RepoInfo          `bson:"repo"                     json:"repo"`
	MergeRequestID int                `bson:"merge_request_id"         json:"merge_request_id"`
	CommitID       string             `bson:"commit_id"                json:"commit_id"`
	Body           string             `bson:"body"                     json:"body"`
	Resolved       bool               `bson:"resolved"                 json:"resolved"`
	DiscussionID   string             `bson:"discussion_id"            json:"discussion_id"`
	NoteID         int                `bson:"note_id"                  json:"note_id"`
	CreateTime     int64              `bson:"create_time"              json:"create_time"`
}

func (DiffNote) TableName

func (DiffNote) TableName() string

type DindClean

type DindClean struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"       json:"_id,omitempty"`
	Name           string             `bson:"name"                json:"-"`
	Status         string             `bson:"status"              json:"status"`
	UpdateTime     int64              `bson:"update_time"         json:"update_time"`
	DindCleanInfos []*DindCleanInfo   `bson:"dind_clean_infos"    json:"dind_clean_infos"`
}

func (DindClean) TableName

func (DindClean) TableName() string

type DindCleanInfo

type DindCleanInfo struct {
	StartTime    int64  `bson:"start_time"                  json:"start_time"`
	PodName      string `bson:"pod_name"                    json:"pod_name"`
	CleanInfo    string `bson:"clean_info"                  json:"clean_info"`
	EndTime      int64  `bson:"end_time"                    json:"end_time"`
	ErrorMessage string `bson:"error_message,omitempty"     json:"error_message"`
}

type DistributeStage

type DistributeStage struct {
	Enabled     bool                 `bson:"enabled"              json:"enabled"`
	S3StorageID string               `bson:"s3_storage_id"        json:"s3_storage_id"`
	ImageRepo   string               `bson:"image_repo"           json:"image_repo"`
	JumpBoxHost string               `bson:"jump_box_host"        json:"jump_box_host"`
	Distributes []*ProductDistribute `bson:"distributes"          json:"distributes"`

	// repos to release images
	Releases []RepoImage `bson:"releases" json:"releases"`
}

func (*DistributeStage) IsDistributeS3Enabled

func (d *DistributeStage) IsDistributeS3Enabled() bool

type DockerBuild

type DockerBuild struct {
	// WorkDir docker run path
	WorkDir string `bson:"work_dir"                  json:"work_dir"`
	// DockerFile name, default is Dockerfile
	DockerFile string `bson:"docker_file"            json:"docker_file"`
	// BuildArgs docker build args
	BuildArgs string `bson:"build_args,omitempty"    json:"build_args"`
	// Source whether dockerfile comes from template or existing file
	Source string `bson:"source"                     json:"source"`
	// TemplateId is the id of the template dockerfile
	TemplateID string `bson:"template_id"            json:"template_id"`
	// TemplateName is the name of the template dockerfile
	TemplateName string `bson:"template_name"        json:"template_name"`
}

type DockerConfig

type DockerConfig struct {
	HostList []string
}

type EnvConfig

type EnvConfig struct {
	EnvName string   `bson:"env_name,omitempty" json:"env_name"`
	HostIDs []string `bson:"host_ids,omitempty" json:"host_ids"`
	Labels  []string `bson:"labels,omitempty"   json:"labels"`
}

type EnvObjects

type EnvObjects struct {
	Key   string `bson:"key"               json:"key"`
	Value string `bson:"value"             json:"value"`
}

type EnvStatus

type EnvStatus struct {
	HostID  string `bson:"host_id,omitempty"           json:"host_id"`
	EnvName string `bson:"env_name,omitempty"          json:"env_name"`
	Address string `bson:"address,omitempty"           json:"address"`
	Status  string `bson:"status,omitempty"            json:"status"`
}

type Error

type Error struct {
	Message string `bson:"message"  json:"message" xml:"message,attr"`
	Type    string `bson:"type"     json:"type"    xml:"type,attr"`
	Text    string `bson:"text"     json:"text"    xml:",chardata"`
}
type ExternalLink struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"          json:"id,omitempty"`
	Name       string             `bson:"name"                   json:"name"`
	URL        string             `bson:"url"                    json:"url"`
	CreateTime int64              `bson:"create_time"            json:"create_time"`
	UpdateTime int64              `bson:"update_time"            json:"update_time"`
	UpdateBy   string             `bson:"update_by"              json:"update_by"`
}

func (ExternalLink) TableName added in v1.7.0

func (ExternalLink) TableName() string

type Failure

type Failure struct {
	Message string `bson:"message"  json:"message" xml:"message,attr"`
	Type    string `bson:"type"     json:"type"    xml:"type,attr"`
	Text    string `bson:"text"     json:"text"    xml:",chardata"`
}

type Favorite

type Favorite struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"         json:"id,omitempty"`
	UserID      string             `bson:"user_id"                json:"user_id"`
	ProductName string             `bson:"product_name"           json:"product_name"`
	Name        string             `bson:"name"                   json:"name"`
	Type        string             `bson:"type"                   json:"type"`
	CreateTime  int64              `bson:"create_time"            json:"create_time"`
}

func (Favorite) TableName

func (Favorite) TableName() string

type Feature

type Feature struct {
	Name            string          `json:"name,omitempty"`
	NamespaceName   string          `json:"namespaceName,omitempty"`
	VersionFormat   string          `json:"versionFormat,omitempty"`
	Version         string          `json:"version,omitempty"`
	Vulnerabilities []Vulnerability `json:"vulnerabilities,omitempty"`
	AddedBy         string          `json:"addedBy,omitempty"`
}

type FileArchive

type FileArchive struct {
	FileLocation string `bson:"file_location" json:"file_location"`
}

type GUIConfig

type GUIConfig struct {
	Deployment interface{} `bson:"deployment,omitempty"           json:"deployment,omitempty"`
	Ingress    interface{} `bson:"ingress,omitempty"              json:"ingress,omitempty"`
	Service    interface{} `bson:"service,omitempty"              json:"service,omitempty"`
}

type GitHook

type GitHook struct {
	Name         string   `bson:"name,omitempty"           json:"name,omitempty"`
	Description  string   `bson:"description,omitempty"    json:"description,omitempty"`
	Owner        string   `bson:"repo_owner"               json:"repo_owner"`
	Repo         string   `bson:"repo"                     json:"repo"`
	Branch       string   `bson:"branch"                   json:"branch"`
	Events       []string `bson:"events"                   json:"events"`
	MatchFolders []string `bson:"match_folders"            json:"match_folders,omitempty"`
	CodehostID   int      `bson:"codehost_id"              json:"codehost_id"`
	AutoCancel   bool     `bson:"auto_cancel"              json:"auto_cancel"`
}

GitHook Events: push, pull_request MatchFolders: 包含目录或者文件后缀 以!开头的目录或者后缀名为不运行pipeline的过滤条件

type GithubApp

type GithubApp struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"   json:"id,omitempty"`
	AppID          int                `bson:"app_id"          json:"app_id"`
	AppKey         string             `bson:"app_key"         json:"app_key"`
	CreatedAt      int64              `bson:"created_at"      json:"created_at"`
	EnableGitCheck bool               `bson:"-"               json:"enable_git_check"`
}

func (GithubApp) TableName

func (GithubApp) TableName() string

type GithubConfig

type GithubConfig struct {
	// github API access token
	AccessToken string `json:"access_token"`
	// github ssh key with base64 encoded
	SSHKey string `json:"ssh_key"`
	// github knownhost
	KnownHost string `json:"known_host"`
	// github app private key
	AppKey string `json:"app_key"`
	// gihhub app id
	AppID int `json:"app_id"`
}

type GitlabConfig

type GitlabConfig struct {
	APIServer string
	// Github API access token
	AccessToken string
	// gitlab ssh key with base64 encoded
	SSHKey string
	// gitlab knownhost
	KnownHost string
}

type HelmChart

type HelmChart struct {
	Name       string `bson:"name"               json:"name"`
	Version    string `bson:"version"     json:"version"`
	ValuesYaml string `bson:"values_yaml"        json:"values_yaml"`
}

type HelmRepo

type HelmRepo struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"         json:"id,omitempty"`
	RepoName  string             `bson:"repo_name,omitempty"   json:"repo_name,omitempty"`
	URL       string             `bson:"url"                   json:"url"`
	Username  string             `bson:"username"              json:"username"`
	Password  string             `bson:"password"              json:"password"`
	UpdateBy  string             `bson:"update_by"             json:"update_by"`
	CreatedAt int64              `bson:"created_at"            json:"created_at"`
	UpdatedAt int64              `bson:"updated_at"            json:"updated_at"`
}

func (HelmRepo) TableName

func (h HelmRepo) TableName() string

type HelmService

type HelmService struct {
	ProductName string       `json:"product_name"`
	Project     string       `json:"project"`
	Visibility  string       `json:"visibility"`
	Type        string       `json:"type"`
	CreateBy    string       `json:"create_by"`
	Revision    int64        `json:"revision"`
	HelmCharts  []*HelmChart `json:"helm_charts"`
}

type HelmServiceArgs

type HelmServiceArgs struct {
	ProductName      string             `json:"product_name"`
	CreateBy         string             `json:"create_by"`
	HelmServiceInfos []*HelmServiceInfo `json:"helm_service_infos"`
}

type HelmServiceInfo

type HelmServiceInfo struct {
	ServiceName string `json:"service_name"`
	FilePath    string `json:"file_path"`
	FileName    string `json:"file_name"`
	FileContent string `json:"file_content"`
}

type HelmServiceResp

type HelmServiceResp struct {
	ProductName   string `json:"product_name"`
	ServiceName   string `json:"service_name"`
	Type          string `json:"type"`
	Revision      int64  `json:"revision"`
	LatestVersion string `json:"latest_version"`
	ValuesYaml    string `json:"values_yaml"`
}

type HelmServiceRespArgs

type HelmServiceRespArgs struct {
	HelmServices []*HelmServiceResp `json:"helm_services"`
}

type HelmVersions

type HelmVersions struct {
	ServiceName       string `json:"service_name"`
	CurrentVersion    string `json:"current_version"`
	CurrentValuesYaml string `json:"current_values_yaml"`
	LatestVersion     string `json:"latest_version"`
	LatestValuesYaml  string `json:"latest_values_yaml"`
}

type Hook

type Hook struct {
	Enabled  bool      `bson:"enabled"             json:"enabled"`
	GitHooks []GitHook `bson:"git_hooks"           json:"git_hooks,omitempty"`
}

type HookPayload

type HookPayload struct {
	Owner      string `bson:"owner"          json:"owner,omitempty"`
	Repo       string `bson:"repo"           json:"repo,omitempty"`
	Branch     string `bson:"branch"         json:"branch,omitempty"`
	Ref        string `bson:"ref"            json:"ref,omitempty"`
	IsPr       bool   `bson:"is_pr"          json:"is_pr,omitempty"`
	CheckRunID int64  `bson:"check_run_id"   json:"check_run_id,omitempty"`
	DeliveryID string `bson:"delivery_id"    json:"delivery_id,omitempty"`
}

type ImagePathSpec added in v1.5.0

type ImagePathSpec struct {
	Repo  string `bson:"repo,omitempty"           json:"repo,omitempty"`
	Image string `bson:"image,omitempty"           json:"image,omitempty"`
	Tag   string `bson:"tag,omitempty"           json:"tag,omitempty"`
}

ImagePathSpec paths in yaml used to parse image

type ImageReleaseConfig

type ImageReleaseConfig struct {
	Addr      string
	AccessKey string
	SecretKey string
}

type Install

type Install struct {
	ObjectIDHex  string   `bson:"-"                      json:"-"`
	Name         string   `bson:"name"                   json:"name"`
	Version      string   `bson:"version"                json:"version"`
	Scripts      string   `bson:"scripts"                json:"scripts"`
	UpdateTime   int64    `bson:"update_time"            json:"update_time"`
	UpdateBy     string   `bson:"update_by"              json:"update_by"`
	Envs         []string `bson:"env"                    json:"env"`
	BinPath      string   `bson:"bin_path"               json:"bin_path"`
	Enabled      bool     `bson:"enabled"                json:"enabled"`
	DownloadPath string   `bson:"download_path"          json:"download_path"`
}

func (Install) TableName

func (Install) TableName() string

type ItReport

type ItReport struct {
	PipelineName         string                  `bson:"pipeline_name"           json:"pipeline_name"`
	PipelineTaskID       int64                   `bson:"pipeline_task_id"        json:"pipeline_task_id"`
	TestName             string                  `bson:"test_name"               json:"test_name"`
	TestJobName          string                  `bson:"test_job_name"           json:"test_job_name"`
	TestSuiteSummary     TestSuiteSummary        `bson:"testsuite"               json:"testsuite"`
	PerformanceTestSuite []*PerformanceTestSuite `bson:"performace_test_suite"   json:"performace_test_suite"`
	Created              int64                   `bson:"create,omitempty"        json:"create,omitempty"`
	Error                string                  `bson:"error,omitempty"         json:"error,omitempty"`
}

func (ItReport) TableName

func (ItReport) TableName() string

type Item

type Item struct {
	Name    string `bson:"name"                   json:"name"`
	Version string `bson:"version"                json:"version"`
}

type JenkinsBuild

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

type JenkinsBuildArgs

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

type JenkinsBuildConfig

type JenkinsBuildConfig struct {
	JenkinsBuildImage string
}

type JenkinsBuildParam

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

type JenkinsIntegration

type JenkinsIntegration struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"         json:"id,omitempty"`
	URL       string             `bson:"url"                   json:"url"`
	Username  string             `bson:"username"              json:"username"`
	Password  string             `bson:"password"              json:"password"`
	UpdateBy  string             `bson:"update_by"             json:"update_by"`
	UpdatedAt int64              `bson:"updated_at"            json:"updated_at"`
}

func (JenkinsIntegration) TableName

func (j JenkinsIntegration) TableName() string

type JiraIssue

type JiraIssue struct {
	ID          string `bson:"id,omitempty"                    json:"id,omitempty"`
	Key         string `bson:"key,omitempty"                   json:"key,omitempty"`
	URL         string `bson:"url,omitempty"                   json:"url,omitempty"`
	Summary     string `bson:"summary"                         json:"summary"`
	Description string `bson:"description,omitempty"           json:"description,omitempty"`
	Priority    string `bson:"priority,omitempty"              json:"priority,omitempty"`
	Creator     string `bson:"creator,omitempty"               json:"creator,omitempty"`
	Assignee    string `bson:"assignee,omitempty"              json:"assignee,omitempty"`
	Reporter    string `bson:"reporter,omitempty"              json:"reporter,omitempty"`
}

JiraIssue ...

type K8SCluster

type K8SCluster struct {
	ID           primitive.ObjectID      `json:"id,omitempty"                bson:"_id,omitempty"`
	Name         string                  `json:"name" bson:"name"`
	Tags         []string                `json:"tags" bson:"tags"`
	Description  string                  `json:"description" bson:"description"`
	Namespace    string                  `json:"namespace" bson:"namespace"`
	Info         *K8SClusterInfo         `json:"info,omitempty" bson:"info,omitempty"`
	Status       config.K8SClusterStatus `json:"status" bson:"status"`
	Error        string                  `json:"error" bson:"error"`
	Yaml         string                  `json:"yaml" bson:"yaml"`
	Production   bool                    `json:"production" bson:"production"`
	CreatedAt    int64                   `json:"createdAt" bson:"createdAt"`
	CreatedBy    string                  `json:"createdBy" bson:"createdBy"`
	Disconnected bool                    `json:"-" bson:"disconnected"`
	Token        string                  `json:"token" bson:"-"`
	Provider     int8                    `json:"provider"       bson:"provider"`
}

func (*K8SCluster) Clean

func (k *K8SCluster) Clean() error

func (K8SCluster) TableName

func (K8SCluster) TableName() string

type K8SClusterInfo

type K8SClusterInfo struct {
	Nodes   int    `json:"nodes" bson:"nodes"`
	Version string `json:"version" bson:"version"`
	CPU     string `json:"cpu" bson:"cpu"`
	Memory  string `json:"memory" bson:"memory"`
}

type KeyVal

type KeyVal struct {
	Key          string `bson:"key"                 json:"key"`
	Value        string `bson:"value"               json:"value"`
	IsCredential bool   `bson:"is_credential"       json:"is_credential"`
}

type MainHookRepo

type MainHookRepo struct {
	Name         string                 `bson:"name,omitempty"            json:"name,omitempty"`
	Description  string                 `bson:"description,omitempty"     json:"description,omitempty"`
	Source       string                 `bson:"source,omitempty"          json:"source,omitempty"`
	RepoOwner    string                 `bson:"repo_owner"                json:"repo_owner"`
	RepoName     string                 `bson:"repo_name"                 json:"repo_name"`
	Branch       string                 `bson:"branch"                    json:"branch"`
	MatchFolders []string               `bson:"match_folders"             json:"match_folders,omitempty"`
	CodehostID   int                    `bson:"codehost_id"               json:"codehost_id"`
	Events       []config.HookEventType `bson:"events"                    json:"events"`
	Label        string                 `bson:"label"                     json:"label"`
	Revision     string                 `bson:"revision"                  json:"revision"`
	IsRegular    bool                   `bson:"is_regular"                json:"is_regular"`
}

func (MainHookRepo) GetLabelValue

func (m MainHookRepo) GetLabelValue() string

type MessageCtx

type MessageCtx struct {
	ReqID   string `bson:"req_id"                json:"req_id"`
	Title   string `bson:"title"                 json:"title"`   // 消息标题
	Content string `bson:"content"               json:"content"` // 消息内容
}

type Notification

type Notification struct {
	ID         primitive.ObjectID  `bson:"_id,omitempty"           json:"id,omitempty"`
	CodehostID int                 `bson:"codehost_id"                  json:"codehost_id"`
	Tasks      []*NotificationTask `bson:"tasks,omitempty"              json:"tasks,omitempty"`
	PrID       int                 `bson:"pr_id"                        json:"pr_id"`
	CommentID  string              `bson:"comment_id"                   json:"comment_id"`
	ProjectID  string              `bson:"project_id"                   json:"project_id"`
	Created    int64               `bson:"create"                       json:"create"`
	BaseURI    string              `bson:"base_uri"                     json:"base_uri"`
	IsPipeline bool                `bson:"is_pipeline"                  json:"is_pipeline"`
	IsTest     bool                `bson:"is_test"                      json:"is_test"`
	ErrInfo    string              `bson:"err_info"                     json:"err_info"`
	PrTask     *PrTaskInfo         `bson:"pr_task_info,omitempty"       json:"pr_task_info,omitempty"`
	Label      string              `bson:"label"                        json:"label"  `
	Revision   string              `bson:"revision"                     json:"revision"`
}

func (*Notification) CreateCommentBody

func (n *Notification) CreateCommentBody() (comment string, err error)

func (Notification) TableName

func (Notification) TableName() string

func (*Notification) ToString

func (n *Notification) ToString() string

type NotificationTask

type NotificationTask struct {
	ProductName  string            `bson:"product_name"    json:"product_name"`
	WorkflowName string            `bson:"workflow_name"   json:"workflow_name"`
	PipelineName string            `bson:"pipeline_name"   json:"pipeline_name"`
	TestName     string            `bson:"test_name"       json:"test_name"`
	ID           int64             `bson:"id"              json:"id"`
	Status       config.TaskStatus `bson:"status"          json:"status"`
	TestReports  []*TestSuite      `bson:"test_reports,omitempty" json:"test_reports,omitempty"`

	FirstCommented bool `json:"first_commented,omitempty" bson:"first_commented,omitempty"`
}

func (NotificationTask) StatusVerbose

func (t NotificationTask) StatusVerbose() string

type Notify

type Notify struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"           json:"id,omitempty"`  // 主键
	Type       config.NotifyType  `bson:"type"                      json:"type"`        // 消息类型
	Receiver   string             `bson:"receiver"                  json:"receiver"`    // 发送者
	Content    interface{}        `bson:"content"                   json:"content"`     // 消息内容
	CreateTime int64              `bson:"create_time"               json:"create_time"` // 消息创建时间
	IsRead     bool               `bson:"is_read"                   json:"is_read"`     // 是否已读
}

func (Notify) TableName

func (Notify) TableName() string

type NotifyCtl

type NotifyCtl struct {
	Enabled         bool     `bson:"enabled"                          json:"enabled"`
	WebHookType     string   `bson:"webhook_type"                     json:"webhook_type"`
	WeChatWebHook   string   `bson:"weChat_webHook,omitempty"         json:"weChat_webHook,omitempty"`
	DingDingWebHook string   `bson:"dingding_webhook,omitempty"       json:"dingding_webhook,omitempty"`
	FeiShuWebHook   string   `bson:"feishu_webhook,omitempty"         json:"feishu_webhook,omitempty"`
	AtMobiles       []string `bson:"at_mobiles,omitempty"             json:"at_mobiles,omitempty"`
	IsAtAll         bool     `bson:"is_at_all,omitempty"              json:"is_at_all,omitempty"`
	NotifyTypes     []string `bson:"notify_type"                      json:"notify_type"`
}

type ParamVal

type ParamVal struct {
	Target string `bson:"target"                 json:"target"`
	Value  string `bson:"value"                  json:"value"`
}

ParamVal 参数化过程服务配置值

type Parameter

type Parameter struct {
	Name         string      `bson:"name"                   json:"name"`
	DefaultValue string      `bson:"default_value"          json:"default_value"`
	ParamVal     []*ParamVal `bson:"param_val"              json:"param_val"`
}

type PerformanceTestSuite

type PerformanceTestSuite struct {
	Label      string `bson:"label"        json:"label"`
	Samples    string `bson:"samples"      json:"samples"`
	Average    string `bson:"average"      json:"average"`
	Min        string `bson:"min"          json:"min"`
	Max        string `bson:"max"          json:"max"`
	Line       string `bson:"line"         json:"line"`
	StdDev     string `bson:"std_dev"      json:"stdDev"`
	Error      string `bson:"error"        json:"error"`
	Throughput string `bson:"throughput"   json:"throughput"`
	ReceivedKb string `bson:"received_kb"  json:"receivedKb"`
	AvgByte    string `bson:"avg_byte"     json:"avgByte"`
}

type Pipeline

type Pipeline struct {
	ID          primitive.ObjectID  `bson:"_id,omitempty"           json:"id,omitempty"`
	Name        string              `bson:"name"                         json:"name"`
	Type        config.PipelineType `bson:"type"                         json:"type"`
	Enabled     bool                `bson:"enabled"                      json:"enabled"`
	TeamName    string              `bson:"team"                         json:"team"`
	ProductName string              `bson:"product_name"                 json:"product_name"`
	// target 服务名称, k8s为容器名称, 物理机为服务名
	Target string `bson:"target"                    json:"target"`
	// 使用预定义编译管理模块中的内容生成SubTasks,
	// 查询条件为 服务名称: Target, 版本: BuildModuleVer
	// 如果为空,则使用pipeline自定义SubTasks
	BuildModuleVer string                   `bson:"build_module_ver"             json:"build_module_ver"`
	SubTasks       []map[string]interface{} `bson:"sub_tasks"                    json:"sub_tasks"`
	Description    string                   `bson:"description,omitempty"        json:"description,omitempty"`
	UpdateBy       string                   `bson:"update_by"                    json:"update_by,omitempty"`
	CreateTime     int64                    `bson:"create_time"                  json:"create_time,omitempty"`
	UpdateTime     int64                    `bson:"update_time"                  json:"update_time,omitempty"`
	Schedules      ScheduleCtrl             `bson:"schedules,omitempty"          json:"schedules,omitempty"`
	Hook           *Hook                    `bson:"hook,omitempty"               json:"hook,omitempty"`
	Notifiers      []string                 `bson:"notifiers,omitempty"          json:"notifiers,omitempty"`
	RunCount       int                      `bson:"run_count,omitempty"          json:"run_count,omitempty"`
	DailyRunCount  float32                  `bson:"daily_run_count,omitempty"    json:"daily_run_count,omitempty"`
	PassRate       float32                  `bson:"pass_rate,omitempty"          json:"pass_rate,omitempty"`
	IsDeleted      bool                     `bson:"is_deleted"                   json:"is_deleted"`
	Slack          *Slack                   `bson:"slack"                        json:"slack"`
	NotifyCtl      *NotifyCtl               `bson:"notify_ctl"                   json:"notify_ctl"`
	IsFavorite     bool                     `bson:"-"                            json:"is_favorite"`
	// 是否允许同时运行多次
	MultiRun bool `bson:"multi_run"                    json:"multi_run"`
}

func (Pipeline) TableName

func (Pipeline) TableName() string

type PipelineStatusCtx

type PipelineStatusCtx struct {
	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"`
	TeamName     string              `bson:"team"                      json:"team"`
}

type PmHealthCheck

type PmHealthCheck struct {
	Protocol            string `bson:"protocol,omitempty"              json:"protocol,omitempty"`
	Port                int    `bson:"port,omitempty"                  json:"port,omitempty"`
	Path                string `bson:"path,omitempty"                  json:"path,omitempty"`
	TimeOut             int64  `bson:"time_out,omitempty"              json:"time_out,omitempty"`
	Interval            uint64 `bson:"interval,omitempty"              json:"interval,omitempty"`
	HealthyThreshold    int    `bson:"healthy_threshold,omitempty"     json:"healthy_threshold,omitempty"`
	UnhealthyThreshold  int    `bson:"unhealthy_threshold,omitempty"   json:"unhealthy_threshold,omitempty"`
	CurrentHealthyNum   int    `bson:"current_healthy_num,omitempty"   json:"current_healthy_num,omitempty"`
	CurrentUnhealthyNum int    `bson:"current_unhealthy_num,omitempty" json:"current_unhealthy_num,omitempty"`
}

type Port

type Port struct {
	Name string `bson:"-"           json:"name"`
	Port int    `bson:"-"           json:"port"`
}

type PostBuild

type PostBuild struct {
	DockerBuild *DockerBuild `bson:"docker_build,omitempty" json:"docker_build"`
	FileArchive *FileArchive `bson:"file_archive,omitempty" json:"file_archive,omitempty"`
	Scripts     string       `bson:"scripts"             json:"scripts"`
}

type PrTaskInfo

type PrTaskInfo struct {
	EnvStatus        string `bson:"env_status,omitempty"                json:"env_status,omitempty"`
	EnvName          string `bson:"env_name,omitempty"                  json:"env_name,omitempty"`
	EnvRecyclePolicy string `bson:"env_recycle_policy,omitempty"        json:"env_recycle_policy,omitempty"`
	ProductName      string `bson:"product_name,omitempty"              json:"product_name,omitempty"`
}

type PreBuild

type PreBuild struct {
	CleanWorkspace bool `bson:"clean_workspace"            json:"clean_workspace"`
	// ResReq defines job requested resources
	ResReq setting.Request `bson:"res_req"                json:"res_req"`
	// BuildOS defines job image OS, it supports 12.04, 14.04, 16.04
	BuildOS   string `bson:"build_os"                      json:"build_os"`
	ImageFrom string `bson:"image_from"                    json:"image_from"`
	ImageID   string `bson:"image_id"                      json:"image_id"`
	// Installs defines apps to be installed for build
	Installs []*Item `bson:"installs,omitempty"    json:"installs"`
	// Envs stores user defined env key val for build
	Envs []*KeyVal `bson:"envs,omitempty"              json:"envs"`
	// EnableProxy
	EnableProxy bool `bson:"enable_proxy,omitempty"        json:"enable_proxy"`
	// Parameters
	Parameters []*Parameter `bson:"parameters,omitempty"   json:"parameters"`
	// UploadPkg uploads package to s3
	UploadPkg bool `bson:"upload_pkg"                      json:"upload_pkg"`
}

PreBuild prepares an environment for a job

type PreTest

type PreTest struct {
	CleanWorkspace bool `bson:"clean_workspace"            json:"clean_workspace"`
	// BuildOS defines job image OS, it supports 12.04, 14.04, 16.04
	BuildOS   string `bson:"build_os"                        json:"build_os"`
	ImageFrom string `bson:"image_from"                      json:"image_from"`
	ImageID   string `bson:"image_id"                        json:"image_id"`
	// ResReq defines job requested resources
	ResReq config.Request `bson:"res_req"                json:"res_req"`
	// Installs defines apps to be installed for build
	Installs []*Item `bson:"installs,omitempty"    json:"installs"`
	// Envs stores user defined env key val for build
	Envs []*KeyVal `bson:"envs,omitempty"              json:"envs"`
	// EnableProxy
	EnableProxy bool `bson:"enable_proxy"           json:"enable_proxy"`
}

PreTest prepares an environment for a job

type Preview

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

type PrivateKey

type PrivateKey struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"          json:"id,omitempty"`
	Name       string             `bson:"name"                   json:"name"`
	UserName   string             `bson:"user_name"              json:"user_name"`
	IP         string             `bson:"ip"                     json:"ip"`
	Label      string             `bson:"label"                  json:"label"`
	IsProd     bool               `bson:"is_prod"                json:"is_prod"`
	PrivateKey string             `bson:"private_key"            json:"private_key"`
	CreateTime int64              `bson:"create_time"            json:"create_time"`
	UpdateTime int64              `bson:"update_time"            json:"update_time"`
	UpdateBy   string             `bson:"update_by"              json:"update_by"`
	Provider   int8               `bson:"provider"               json:"provider"`
}

func (PrivateKey) TableName

func (PrivateKey) TableName() string

type Product

type Product struct {
	ID           primitive.ObjectID            `bson:"_id,omitempty"             json:"id,omitempty"`
	ProductName  string                        `bson:"product_name"              json:"product_name"`
	CreateTime   int64                         `bson:"create_time"               json:"create_time"`
	UpdateTime   int64                         `bson:"update_time"               json:"update_time"`
	Namespace    string                        `bson:"namespace,omitempty"       json:"namespace,omitempty"`
	Status       string                        `bson:"status"                    json:"status"`
	Revision     int64                         `bson:"revision"                  json:"revision"`
	Enabled      bool                          `bson:"enabled"                   json:"enabled"`
	EnvName      string                        `bson:"env_name"                  json:"env_name"`
	UpdateBy     string                        `bson:"update_by"                 json:"update_by"`
	Auth         []*ProductAuth                `bson:"auth"                      json:"auth"`
	Visibility   string                        `bson:"-"                         json:"visibility"`
	Services     [][]*ProductService           `bson:"services"                  json:"services"`
	Render       *RenderInfo                   `bson:"render"                    json:"render"`
	Error        string                        `bson:"error"                     json:"error"`
	Vars         []*templatemodels.RenderKV    `bson:"vars,omitempty"            json:"vars,omitempty"`
	ChartInfos   []*templatemodels.RenderChart `bson:"-"                         json:"chart_infos,omitempty"`
	IsPublic     bool                          `bson:"is_public"                 json:"isPublic"`
	RoleIDs      []int64                       `bson:"role_ids"                  json:"roleIds"`
	ClusterID    string                        `bson:"cluster_id,omitempty"      json:"cluster_id,omitempty"`
	RecycleDay   int                           `bson:"recycle_day"               json:"recycle_day"`
	Source       string                        `bson:"source"                    json:"source"`
	IsOpenSource bool                          `bson:"is_opensource"             json:"is_opensource"`
	// TODO: temp flag
	IsForkedProduct bool `bson:"-" json:"-"`
}

Vars不做保存,只做input参数

func (*Product) GetGroupServiceNames

func (p *Product) GetGroupServiceNames() [][]string

func (*Product) GetNamespace

func (p *Product) GetNamespace() string

TODO: LOU: what namespace is it??

func (*Product) GetServiceMap

func (p *Product) GetServiceMap() map[string]*ProductService

func (Product) TableName

func (Product) TableName() string

type ProductAuth

type ProductAuth struct {
	Type        ProductAuthType     `bson:"type"          json:"type"`
	Name        string              `bson:"name"          json:"name"`
	Permissions []ProductPermission `bson:"permissions"   json:"permissions"`
}

type ProductAuthType

type ProductAuthType string

type ProductDistribute

type ProductDistribute struct {
	Target            *ServiceModuleTarget `bson:"target"                 json:"target"`
	ImageDistribute   bool                 `bson:"image_distribute"       json:"image_distribute"`
	JumpBoxDistribute bool                 `bson:"jump_box_distribute"    json:"jump_box_distribute"`
	QstackDistribute  bool                 `bson:"qstack_distribute"      json:"qstack_distribute"`
}

type ProductPermission

type ProductPermission string

type ProductService

type ProductService struct {
	ServiceName string       `bson:"service_name"               json:"service_name"`
	ProductName string       `bson:"product_name"               json:"product_name"`
	Type        string       `bson:"type"                       json:"type"`
	Revision    int64        `bson:"revision"                   json:"revision"`
	Containers  []*Container `bson:"containers"                 json:"containers,omitempty"`
	Render      *RenderInfo  `bson:"render,omitempty"           json:"render,omitempty"` // 记录每个服务render信息 便于更新单个服务
	EnvConfigs  []*EnvConfig `bson:"-"                          json:"env_configs,omitempty"`
}

type Proxy

type Proxy struct {
	ID primitive.ObjectID `bson:"_id,omitempty"           json:"id,omitempty"`
	// http或socks5 暂时只支持http代理
	Type         string `bson:"type"                         json:"type"`
	Address      string `bson:"address"                      json:"address"`
	Port         int    `bson:"port"                         json:"port"`
	NeedPassword bool   `bson:"need_password"                json:"need_password"`
	Username     string `bson:"username"                     json:"username"`
	Password     string `bson:"password"                     json:"password"`
	// 代理用途,app表示应用代理,repo表示代码库代理。保留字段,暂时默认设置为default,以后可能用到。
	Usage                  string `bson:"usage"                        json:"usage"`
	EnableRepoProxy        bool   `bson:"enable_repo_proxy"            json:"enable_repo_proxy"`
	EnableApplicationProxy bool   `bson:"enable_application_proxy"     json:"enable_application_proxy"`
	CreateTime             int64  `bson:"create_time"                  json:"create_time"`
	UpdateTime             int64  `bson:"update_time"                  json:"update_time"`
	UpdateBy               string `bson:"update_by"                    json:"update_by"`
}

func (*Proxy) GetProxyURL

func (p *Proxy) GetProxyURL() string

func (Proxy) TableName

func (Proxy) TableName() string

type ProxyConfig

type ProxyConfig struct {
	HTTPAddr   string
	HTTPSAddr  string
	Socks5Addr string
	NoProxy    string
}

type Queue

type Queue 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"`
	Namespace    string                   `bson:"namespace,omitempty"       json:"namespace,omitempty"`
	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       []*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"`
	TeamID       int                      `bson:"team_id,omitempty"         json:"team_id,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 *TaskArgs `bson:"task_args,omitempty"         json:"task_args,omitempty"`
	// WorkflowArgs 多服务工作流任务参数
	WorkflowArgs *WorkflowTaskArgs `bson:"workflow_args"         json:"workflow_args,omitempty"`
	// TestArgs 测试任务参数
	TestArgs *TestTaskArgs `bson:"test_args,omitempty"         json:"test_args,omitempty"`
	// ServiceTaskArgs 脚本部署工作流任务参数
	ServiceTaskArgs *ServiceTaskArgs    `bson:"service_args,omitempty"         json:"service_args,omitempty"`
	ConfigPayload   *ConfigPayload      `json:"config_payload,omitempty"`
	Error           string              `bson:"error,omitempty"                json:"error,omitempty"`
	Services        [][]*ProductService `bson:"services"                  json:"services"`
	Render          *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 *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 (Queue) TableName

func (Queue) TableName() string

type RegistryConfig

type RegistryConfig struct {
	Addr        string
	AccessKey   string
	SecretKey   string
	Namespace   string
	RepoAddress string
}

type RegistryNamespace

type RegistryNamespace struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"               json:"id,omitempty"`
	RegAddr     string             `bson:"reg_addr"                    json:"reg_addr"`
	RegType     string             `bson:"reg_type"                    json:"reg_type"`
	RegProvider string             `bson:"reg_provider"                json:"reg_provider"`
	IsDefault   bool               `bson:"is_default"                  json:"is_default"`
	Namespace   string             `bson:"namespace"                   json:"namespace"`
	AccessKey   string             `bson:"access_key"                  json:"access_key"`
	SecretKey   string             `bson:"secret_key"                  json:"secret_key"`
	Region      string             `bson:"region,omitempty"            json:"region,omitempty"`
	UpdateTime  int64              `bson:"update_time"                 json:"update_time"`
	UpdateBy    string             `bson:"update_by"                   json:"update_by"`
}

func (RegistryNamespace) TableName

func (RegistryNamespace) TableName() string

func (*RegistryNamespace) Validate

func (ns *RegistryNamespace) Validate() error

type ReleaseConfig

type ReleaseConfig struct {
	// ReaperImage sets build job image
	// e.g. xxx.com/resources/reaper-plugin:1.0.0
	ReaperImage string
	// ReaperBinaryFile sets download url of reaper binary file in build job
	// e.g. http://resource.koderover.com/reaper-20201014203000
	ReaperBinaryFile string
	// PredatorImage sets docker build image
	// e.g. xxx.com/resources/predator-plugin:v0.1.0
	PredatorImage string
}

type RenderInfo

type RenderInfo struct {
	Name        string `bson:"name"                     json:"name"`
	Revision    int64  `bson:"revision"                 json:"revision"`
	ProductTmpl string `bson:"product_tmpl"             json:"product_tmpl"`
	Description string `bson:"description"              json:"description"`
}

type RenderSet

type RenderSet struct {
	// Name = EnvName == "" ? ProductTmpl : (EnvName + "-" + ProductTempl)
	Name     string `bson:"name"                     json:"name"`
	Revision int64  `bson:"revision"                 json:"revision"`
	// 可以为空,空时为产品模板默认的渲染集,非空时为环境的渲染集
	EnvName       string                        `bson:"env_name,omitempty"       json:"env_name,omitempty"`
	ProductTmpl   string                        `bson:"product_tmpl"             json:"product_tmpl"`
	Team          string                        `bson:"team,omitempty"           json:"team,omitempty"`
	UpdateTime    int64                         `bson:"update_time"              json:"update_time"`
	UpdateBy      string                        `bson:"update_by"                json:"update_by"`
	IsDefault     bool                          `bson:"is_default"               json:"is_default"`                          // 是否是默认配置
	DefaultValues string                        `bson:"default_values,omitempty"            json:"default_values,omitempty"` //环境默认变量 yaml content
	KVs           []*templatemodels.RenderKV    `bson:"kvs,omitempty"            json:"kvs,omitempty"`
	ChartInfos    []*templatemodels.RenderChart `bson:"chart_infos,omitempty"    json:"chart_infos,omitempty"`
	Description   string                        `bson:"description,omitempty"    json:"description,omitempty"`
}

RenderSet ...

func (*RenderSet) Diff

func (m *RenderSet) Diff(target *RenderSet) bool

func (*RenderSet) GetKeyValueMap

func (m *RenderSet) GetKeyValueMap() map[string]string

func (*RenderSet) HelmRenderDiff

func (m *RenderSet) HelmRenderDiff(target *RenderSet) bool

func (*RenderSet) SetKVAlias

func (m *RenderSet) SetKVAlias()

SetKVAlias ...

func (RenderSet) TableName

func (RenderSet) TableName() string

type RepoImage

type RepoImage struct {
	RepoID    string `json:"repo_id" bson:"repo_id"`
	Name      string `json:"name" bson:"name" yaml:"name"`
	Username  string `json:"-" yaml:"username"`
	Password  string `json:"-" yaml:"password"`
	Host      string `json:"host" yaml:"host"`
	Namespace string `json:"namespace" yaml:"namespace"`
}

type RepoInfo

type RepoInfo struct {
	CodehostID int    `bson:"codehost_id"                json:"codehost_id"`
	Source     string `bson:"source"                     json:"source"`
	ProjectID  string `bson:"project_id"                 json:"project_id"`
	Address    string `bson:"address"                    json:"address"`
	OauthToken string `bson:"oauth_token"                json:"oauth_token"`
}

type RetentionConfig

type RetentionConfig struct {
	MaxDays  int `bson:"max_days"      json:"max_days"`  // 最多几天
	MaxItems int `bson:"max_items"     json:"max_items"` // 最多几条
}

RetentionConfig 资源留存相关的配置

type S3Config

type S3Config struct {
	Ak       string
	Sk       string
	Endpoint string
	Bucket   string
	Path     string
	Protocol string
}

type S3Storage

type S3Storage struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"id"`
	Ak          string             `bson:"ak"             json:"ak"`
	Sk          string             `bson:"-"              json:"sk"`
	Endpoint    string             `bson:"endpoint"       json:"endpoint"`
	Bucket      string             `bson:"bucket"         json:"bucket"`
	Subfolder   string             `bson:"subfolder"      json:"subfolder"`
	Insecure    bool               `bson:"insecure"       json:"insecure"`
	IsDefault   bool               `bson:"is_default"     json:"is_default"`
	EncryptedSk string             `bson:"encryptedSk"    json:"-"`
	UpdatedBy   string             `bson:"updated_by"     json:"updated_by"`
	UpdateTime  int64              `bson:"update_time"    json:"update_time"`
	Provider    int8               `bson:"provider"       json:"provider"`
}

func (S3Storage) TableName

func (s S3Storage) TableName() string

type Schedule

type Schedule struct {
	ID           primitive.ObjectID  `bson:"_id,omitempty"                 json:"id,omitempty"`
	Number       uint64              `bson:"number"                        json:"number"`
	Frequency    string              `bson:"frequency"                     json:"frequency"`
	Time         string              `bson:"time"                          json:"time"`
	MaxFailures  int                 `bson:"max_failures,omitempty"        json:"max_failures,omitempty"`
	TaskArgs     *TaskArgs           `bson:"task_args,omitempty"           json:"task_args,omitempty"`
	WorkflowArgs *WorkflowTaskArgs   `bson:"workflow_args,omitempty"       json:"workflow_args,omitempty"`
	TestArgs     *TestTaskArgs       `bson:"test_args,omitempty"           json:"test_args,omitempty"`
	Type         config.ScheduleType `bson:"type"                          json:"type"`
	Cron         string              `bson:"cron"                          json:"cron"`
	IsModified   bool                `bson:"-"                             json:"-"`
	// 自由编排工作流的开关是放在schedule里面的
	Enabled bool `bson:"enabled"                       json:"enabled"`
}

func (*Schedule) Validate

func (schedule *Schedule) Validate() error

Validate validate schedule setting

type ScheduleCtrl

type ScheduleCtrl struct {
	Enabled bool        `bson:"enabled"    json:"enabled"`
	Items   []*Schedule `bson:"items"      json:"items"`
}

type SecurityStage

type SecurityStage struct {
	Enabled bool `bson:"enabled"                    json:"enabled"`
}

type Service

type Service struct {
	ServiceName      string           `bson:"service_name"                   json:"service_name"`
	Type             string           `bson:"type"                           json:"type"`
	Team             string           `bson:"team,omitempty"                 json:"team,omitempty"`
	ProductName      string           `bson:"product_name"                   json:"product_name"`
	Revision         int64            `bson:"revision"                       json:"revision"`
	Source           string           `bson:"source,omitempty"               json:"source,omitempty"`
	GUIConfig        *GUIConfig       `bson:"gui_config,omitempty"           json:"gui_config,omitempty"`
	Yaml             string           `bson:"yaml,omitempty"                 json:"yaml"`
	SrcPath          string           `bson:"src_path,omitempty"             json:"src_path,omitempty"`
	Commit           *Commit          `bson:"commit,omitempty"               json:"commit,omitempty"`
	KubeYamls        []string         `bson:"-"                              json:"-"`
	Hash             string           `bson:"hash256,omitempty"              json:"hash256,omitempty"`
	CreateTime       int64            `bson:"create_time"                    json:"create_time"`
	CreateBy         string           `bson:"create_by"                      json:"create_by"`
	Containers       []*Container     `bson:"containers,omitempty"           json:"containers,omitempty"`
	Description      string           `bson:"description,omitempty"          json:"description,omitempty"`
	Visibility       string           `bson:"visibility,omitempty"           json:"visibility,omitempty"`
	Status           string           `bson:"status,omitempty"               json:"status,omitempty"`
	GerritRepoName   string           `bson:"gerrit_repo_name,omitempty"     json:"gerrit_repo_name,omitempty"`
	GerritBranchName string           `bson:"gerrit_branch_name,omitempty"   json:"gerrit_branch_name,omitempty"`
	GerritRemoteName string           `bson:"gerrit_remote_name,omitempty"   json:"gerrit_remote_name,omitempty"`
	GerritPath       string           `bson:"gerrit_path,omitempty"          json:"gerrit_path,omitempty"`
	GerritCodeHostID int              `bson:"gerrit_codeHost_id,omitempty"   json:"gerrit_codeHost_id,omitempty"`
	BuildName        string           `bson:"build_name,omitempty"           json:"build_name,omitempty"`
	HelmChart        *HelmChart       `bson:"helm_chart,omitempty"           json:"helm_chart,omitempty"`
	EnvConfigs       []*EnvConfig     `bson:"env_configs,omitempty"          json:"env_configs,omitempty"`
	EnvStatuses      []*EnvStatus     `bson:"env_statuses,omitempty"         json:"env_statuses,omitempty"`
	CodehostID       int              `bson:"codehost_id,omitempty"          json:"codehost_id,omitempty"`
	RepoOwner        string           `bson:"repo_owner,omitempty"           json:"repo_owner,omitempty"`
	RepoName         string           `bson:"repo_name,omitempty"            json:"repo_name,omitempty"`
	RepoUUID         string           `bson:"repo_uuid,omitempty"            json:"repo_uuid,omitempty"`
	BranchName       string           `bson:"branch_name,omitempty"          json:"branch_name,omitempty"`
	LoadPath         string           `bson:"load_path,omitempty"            json:"load_path,omitempty"`
	LoadFromDir      bool             `bson:"is_dir,omitempty"               json:"is_dir,omitempty"`
	CreateFrom       interface{}      `bson:"create_from,omitempty"               json:"create_from,omitempty"`
	HealthChecks     []*PmHealthCheck `bson:"health_checks,omitempty"        json:"health_checks,omitempty"`
	WorkloadType     string           `bson:"workload_type,omitempty"        json:"workload_type,omitempty"`
	EnvName          string           `bson:"env_name,omitempty"             json:"env_name,omitempty"`
	TemplateID       string           `bson:"template_id,omitempty"          json:"template_id,omitempty"`
}

Service : service template struct Service template config has 3 types mainly. 1. Kubernetes service, and yaml+config is held in aslan: type == "k8s"; source == "spock"; yaml != "" 2. Kubernetes service, and yaml+config is held in gitlab: type == "k8s"; source == "gitlab"; src_path != ""

func (Service) TableName

func (Service) TableName() string

type ServiceConfig

type ServiceConfig struct {
	ConfigName string `bson:"config_name"           json:"config_name"`
	Revision   int64  `bson:"revision"              json:"revision"`
}

type ServiceModuleTarget

type ServiceModuleTarget struct {
	ProductName   string `bson:"product_name"                  json:"product_name"`
	ServiceName   string `bson:"service_name"                  json:"service_name"`
	ServiceModule string `bson:"service_module"                json:"service_module"`
}

type ServiceTaskArgs

type ServiceTaskArgs struct {
	ProductName        string   `bson:"product_name"            json:"product_name"`
	ServiceName        string   `bson:"service_name"            json:"service_name"`
	Revision           int64    `bson:"revision"                json:"revision"`
	BuildName          string   `bson:"build_name"              json:"build_name"`
	EnvNames           []string `bson:"env_names"               json:"env_names"`
	ServiceTaskCreator string   `bson:"service_task_creator"    json:"service_task_creator"`
	Namespace          string   `bson:"namespace"               json:"namespace"`
	K8sNamespace       string   `bson:"k8s_namespace"           json:"k8s_namespace"`
	Updatable          bool     `bson:"updatable"               json:"updatable"`
}

type ServiceTmplPipeResp

type ServiceTmplPipeResp struct {
	ID               ServiceTmplRevision `bson:"_id"                            json:"_id"`
	Revision         int64               `bson:"revision"                       json:"revision"`
	SrcPath          string              `bson:"src_path"                       json:"src_path"`
	Visibility       string              `bson:"visibility,omitempty"           json:"visibility,omitempty"`
	Containers       []*Container        `bson:"containers,omitempty"           json:"containers,omitempty"`
	Source           string              `bson:"source"                         json:"source"`
	CodehostID       int                 `bson:"codehost_id"                    json:"codehost_id"`
	RepoOwner        string              `bson:"repo_owner"                     json:"repo_owner"`
	RepoName         string              `bson:"repo_name"                      json:"repo_name"`
	RepoUUID         string              `bson:"repo_uuid"                      json:"repo_uuid"`
	BranchName       string              `bson:"branch_name"                    json:"branch_name"`
	LoadPath         string              `bson:"load_path"                      json:"load_path"`
	LoadFromDir      bool                `bson:"is_dir"                         json:"is_dir"`
	GerritRemoteName string              `bson:"gerrit_remote_name,omitempty"   json:"gerrit_remote_name,omitempty"`
}

ServiceTmplPipeResp ...router

type ServiceTmplRevision

type ServiceTmplRevision struct {
	ProductName      string `bson:"product_name"                   json:"product_name"`
	ServiceName      string `bson:"service_name"                   json:"service_name"`
	Type             string `bson:"type"                           json:"type"`
	Revision         int64  `bson:"revision,omitempty"             json:"revision,omitempty"`
	Source           string `bson:"source"                         json:"source"`
	CodehostID       int    `bson:"codehost_id"                    json:"codehost_id"`
	RepoOwner        string `bson:"repo_owner"                     json:"repo_owner"`
	RepoName         string `bson:"repo_name"                      json:"repo_name"`
	BranchName       string `bson:"branch_name"                    json:"branch_name"`
	LoadPath         string `bson:"load_path"                      json:"load_path"`
	LoadFromDir      bool   `bson:"is_dir"                         json:"is_dir"`
	GerritRemoteName string `bson:"gerrit_remote_name,omitempty"   json:"gerrit_remote_name,omitempty"`
}

ServiceTmplRevision ...

type ServicesInExternalEnv added in v1.6.0

type ServicesInExternalEnv struct {
	ProductName string `bson:"product_name"         json:"product_name"`
	ServiceName string `bson:"service_name"         json:"service_name"`
	EnvName     string `bson:"env_name"             json:"env_name"`
	Namespace   string `bson:"namespace"            json:"namespace"`
	ClusterID   string `bson:"cluster_id"           json:"cluster_id"`
}

func (ServicesInExternalEnv) TableName added in v1.6.0

func (ServicesInExternalEnv) TableName() string

type Skipped

type Skipped struct {
}

type Slack

type Slack struct {
	Channel    string                 `bson:"channel"      json:"channel"`
	Enabled    bool                   `bson:"enabled"      json:"enabled"`
	Notifiers  []string               `bson:"notifiers"    json:"notifiers"`
	NotifyType config.SlackNotifyType `bson:"notify_type"  json:"notify_type"`
}

type Spec

type Spec struct {
	Ports []Port `bson:"-"           json:"ports"`
}

type Stage

type Stage struct {
	// 注意: 同一个stage暂时不能运行不同类型的Task
	TaskType    config.TaskType                   `bson:"type"               json:"type"`
	Status      config.Status                     `bson:"status"             json:"status"`
	RunParallel bool                              `bson:"run_parallel"       json:"run_parallel"`
	Desc        string                            `bson:"desc,omitempty"     json:"desc,omitempty"`
	SubTasks    map[string]map[string]interface{} `bson:"sub_tasks"          json:"sub_tasks"`
	AfterAll    bool                              `json:"after_all" bson:"after_all"`
}

Stage ...

type Stats

type Stats struct {
	ReqID     string            `bson:"req_id"         json:"req_id"`
	User      string            `bson:"user"           json:"user"`
	Event     string            `bson:"event"          json:"event"`
	StartTime int64             `bson:"start_time"     json:"start_time"`
	EndTime   int64             `bson:"end_time"       json:"end_time"`
	Context   map[string]string `bson:"ctx"            json:"ctx"`
}

func (Stats) TableName

func (Stats) TableName() string

type SubTask

type SubTask map[string]interface{}

func (*SubTask) ToBuildTask

func (sb *SubTask) ToBuildTask() (*Build, error)

ToBuildTask ...

func (*SubTask) ToPreview

func (sb *SubTask) ToPreview() (*Preview, error)

func (*SubTask) ToTestingTask

func (sb *SubTask) ToTestingTask() (*Testing, error)

ToTestingTask ...

type Subscription

type Subscription struct {
	Subscriber     string            `bson:"subscriber"                   json:"subscriber,omitempty"`     // 订阅人
	Type           config.NotifyType `bson:"type"                         json:"type"`                     // 消息类型
	CreateTime     int64             `bson:"create_time"                  json:"create_time,omitempty"`    // 创建时间
	PipelineStatus config.Status     `bson:"pipelinestatus"               json:"pipelinestatus,omitempty"` // pipeline 状态关注
}

func (Subscription) TableName

func (Subscription) TableName() string

type TarInfo added in v1.6.0

type TarInfo struct {
	URL          string `bson:"url"                 json:"url"`
	Name         string `bson:"name"                json:"name"`
	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 TargetArgs

type TargetArgs struct {
	Name             string            `bson:"name"                      json:"name"`
	ServiceName      string            `bson:"service_name"              json:"service_name"`
	ProductName      string            `bson:"product_name"              json:"product_name"`
	Build            *BuildArgs        `bson:"build"                     json:"build"`
	Deploy           []DeployEnv       `bson:"deloy"                     json:"deploy"`
	Image            string            `bson:"image"                     json:"image"`
	BinFile          string            `bson:"bin_file"                  json:"bin_file"`
	Envs             []*KeyVal         `bson:"envs"                      json:"envs"`
	HasBuild         bool              `bson:"has_build"                 json:"has_build"`
	JenkinsBuildArgs *JenkinsBuildArgs `bson:"jenkins_build_args"        json:"jenkins_build_args"`
}

type TaskArgs

type TaskArgs struct {
	ProductName    string              `bson:"product_name"            json:"product_name"`
	PipelineName   string              `bson:"pipeline_name"           json:"pipeline_name"`
	Builds         []*types.Repository `bson:"builds"                  json:"builds"`
	BuildArgs      []*KeyVal           `bson:"build_args"              json:"build_args"`
	Deploy         DeployArgs          `bson:"deploy"                  json:"deploy"`
	Test           TestArgs            `bson:"test"                    json:"test,omitempty"`
	HookPayload    *HookPayload        `bson:"hook_payload"            json:"hook_payload,omitempty"`
	TaskCreator    string              `bson:"task_creator"            json:"task_creator,omitempty"`
	ReqID          string              `bson:"req_id"                  json:"req_id"`
	IsQiNiu        bool                `bson:"is_qiniu"                json:"is_qiniu"`
	NotificationID string              `bson:"notification_id"         json:"notification_id"`
	CodeHostID     int                 `bson:"codehost_id"             json:"codehost_id"`
}

TaskArgs 单服务工作流任务参数

type TaskInfo

type TaskInfo struct {
	TaskID       int64         `bson:"task_id"               json:"task_id"`
	PipelineName string        `bson:"pipeline_name"         json:"pipeline_name"`
	Status       config.Status `bson:"status"                json:"status"`
}

type TestArgs

type TestArgs struct {
	Namespace      string              `bson:"namespace" json:"namespace"`
	TestModuleName string              `bson:"test_module_name" json:"test_module_name"`
	Envs           []*KeyVal           `bson:"envs" json:"envs"`
	Builds         []*types.Repository `bson:"builds" json:"builds"`
}

type TestCase

type TestCase struct {
	Name      string   `bson:"tc_name"                 json:"tc_name"      xml:"name,attr"`
	ClassName string   `bson:"classname"               json:"classname"    xml:"classname,attr"`
	Time      float64  `bson:"time"                    json:"time"         xml:"time,attr"`
	Failure   *Failure `bson:"failure,omitempty"       json:"failure"      xml:"failure,omitempty"`
	Skipped   *Skipped `bson:"skipped,omitempty"       json:"skipped"      xml:"skipped,omitempty"`
	SystemOut string   `bson:"system_out,omitempty"    json:"system_out"   xml:"system-out,omitempty"`
	SystemErr string   `bson:"system-err,omitempty"    json:"system_err"   xml:"system-err,omitempty"`
	Error     *Error   `bson:"error,omitempty"         json:"error"        xml:"error,omitempty"`
}

type TestConfig

type TestConfig struct {
	KubeNamespace string
}

type TestExecArgs

type TestExecArgs struct {
	Name string    `bson:"test_name"             json:"test_name"`
	Envs []*KeyVal `bson:"envs"           json:"envs"`
}

TestExecArgs ...

type TestReport

type TestReport struct {
	FunctionTestSuite     *TestSuite                `bson:"function_test_suite,omitempty"         json:"functionTestSuite,omitempty"`
	PerformanceTestSuites []*PerformanceTestSuite   `bson:"performance_test_suite,omitempty"      json:"performanceTestSuite,omitempty"`
	Security              map[string]map[string]int `bson:"security,omitempty"                    json:"security,omitempty"`
}

type TestReportObject

type TestReportObject struct {
	TestResultPath        string                  `bson:"test_result_path"       json:"testResultPath"`
	WorkflowName          string                  `bson:"workflow_name"          json:"workflowName"`
	TaskID                int64                   `bson:"task_id"                json:"taskId"`
	TestName              string                  `bson:"test_name"              json:"testName"`
	FunctionTestSuite     *TestSuite              `bson:"test_suite"             json:"testSuite"`
	PerformanceTestSuites []*PerformanceTestSuite `bson:"performance_test_suite" json:"performanceTestSuite"`
	StartTime             int64                   `bson:"start_time,omitempty"   json:"start_time,omitempty"`
	EndTime               int64                   `bson:"end_time,omitempty"     json:"end_time,omitempty"`
}

TestReportObject ...

type TestStage

type TestStage struct {
	Enabled   bool            `bson:"enabled"                    json:"enabled"`
	TestNames []string        `bson:"test_names,omitempty"       json:"test_names,omitempty"`
	Tests     []*TestExecArgs `bson:"tests,omitempty"     json:"tests,omitempty"`
}

type TestSuite

type TestSuite struct {
	// 总数=tests+skips 成功=tests-failures-errors
	Tests     int        `bson:"tests"                   json:"tests"                    xml:"tests,attr"`
	Failures  int        `bson:"failures"                json:"failures"                 xml:"failures,attr"`
	Successes int        `bson:"successes,omitempty"     json:"successes,omitempty"      xml:"successes,attr,omitempty"`
	Skips     int        `bson:"skips"                   json:"skips"                    xml:"skips,attr"`
	Errors    int        `bson:"errors,omitempty"        json:"errors"                   xml:"errors,attr,omitempty"`
	Time      float64    `bson:"time"                    json:"time"                     xml:"time,attr"`
	SystemOut string     `bson:"system_out,omitempty"    json:"system_out"               xml:"system-out,omitempty"`
	SystemErr string     `bson:"system-err,omitempty"    json:"system_err"               xml:"system-err,omitempty"`
	TestCases []TestCase `bson:"testcase"                json:"testcase"                 xml:"testcase"`
	SuiteType string     `bson:"-"                       json:"-"                        xml:"-"`
	Name      string     `bson:"name"                    json:"-"                        xml:"-"`
}

type TestSuiteSummary

type TestSuiteSummary struct {
	Tests    int     `bson:"tests"         json:"tests"          xml:"tests,attr"`
	Failures int     `bson:"failures"      json:"failures"       xml:"failures,attr"`
	Skips    int     `bson:"skips"         json:"skips"          xml:"skips,attr"`
	Errors   int     `bson:"errors"        json:"errors"         xml:"errors,attr"`
	Time     float64 `bson:"time"          json:"time"           xml:"time,attr"`
}

type TestTaskArgs

type TestTaskArgs struct {
	ProductName     string `bson:"product_name"            json:"product_name"`
	TestName        string `bson:"test_name"               json:"test_name"`
	TestTaskCreator string `bson:"test_task_creator"       json:"test_task_creator"`
	NotificationID  string `bson:"notification_id"         json:"notification_id"`
	ReqID           string `bson:"req_id"                  json:"req_id"`
	// webhook触发测试任务时,触发任务的repo、prID和commitID
	MergeRequestID string `bson:"merge_request_id" json:"merge_request_id"`
	CommitID       string `bson:"commit_id"        json:"commit_id"`
	Source         string `bson:"source"           json:"source"`
	CodehostID     int    `bson:"codehost_id"      json:"codehost_id"`
	RepoOwner      string `bson:"repo_owner"       json:"repo_owner"`
	RepoName       string `bson:"repo_name"        json:"repo_name"`
}

type TestTaskStat

type TestTaskStat struct {
	Name          string `bson:"name"                    json:"name"`
	TotalSuccess  int    `bson:"total_success"           json:"totalSuccess"`
	TotalFailure  int    `bson:"total_failure"           json:"totalFailure"`
	TotalDuration int64  `bson:"total_duration"          json:"totalDuration"`
	TestCaseNum   int    `bson:"test_case_num"           json:"testCaseNum"`
	CreateTime    int64  `bson:"create_time"             json:"createTime"`
	UpdateTime    int64  `bson:"update_time"             json:"updateTime"`
}

func (TestTaskStat) TableName

func (TestTaskStat) TableName() string

type Testing

type Testing struct {
	ID          primitive.ObjectID  `bson:"_id,omitempty"            json:"id,omitempty"`
	Name        string              `bson:"name"                     json:"name"`
	ProductName string              `bson:"product_name"             json:"product_name"`
	Desc        string              `bson:"desc"                     json:"desc"`
	Timeout     int                 `bson:"timeout"                  json:"timeout"`
	Team        string              `bson:"team"                     json:"team"`
	Repos       []*types.Repository `bson:"repos,omitempty"          json:"repos"`
	PreTest     *PreTest            `bson:"pre_test"                 json:"pre_test"`
	Scripts     string              `bson:"scripts"                  json:"scripts"`
	UpdateTime  int64               `bson:"update_time"              json:"update_time"`
	UpdateBy    string              `bson:"update_by"                json:"update_by"`
	// Junit 测试报告
	TestResultPath string `bson:"test_result_path"         json:"test_result_path"`
	// html 测试报告
	TestReportPath  string           `bson:"test_report_path"         json:"test_report_path"`
	Threshold       int              `bson:"threshold"                json:"threshold"`
	TestType        string           `bson:"test_type"                json:"test_type"`
	Caches          []string         `bson:"caches"                   json:"caches"`
	ArtifactPaths   []string         `bson:"artifact_paths,omitempty" json:"artifact_paths,omitempty"`
	TestCaseNum     int              `bson:"-"                        json:"test_case_num,omitempty"`
	ExecuteNum      int              `bson:"-"                        json:"execute_num,omitempty"`
	PassRate        float64          `bson:"-"                        json:"pass_rate,omitempty"`
	AvgDuration     float64          `bson:"-"                        json:"avg_duration,omitempty"`
	Workflows       []*Workflow      `bson:"-"                        json:"workflows,omitempty"`
	Schedules       *ScheduleCtrl    `bson:"schedules,omitempty"      json:"schedules,omitempty"`
	HookCtl         *TestingHookCtrl `bson:"hook_ctl"                 json:"hook_ctl"`
	ScheduleEnabled bool             `bson:"schedule_enabled"         json:"-"`
}

func (Testing) TableName

func (Testing) TableName() string

type TestingHook

type TestingHook struct {
	AutoCancel bool          `bson:"auto_cancel" json:"auto_cancel"`
	MainRepo   *MainHookRepo `bson:"main_repo"   json:"main_repo"`
	TestArgs   *TestTaskArgs `bson:"test_args"   json:"test_args"`
}

type TestingHookCtrl

type TestingHookCtrl struct {
	Enabled bool           `bson:"enabled" json:"enabled"`
	Items   []*TestingHook `bson:"items" json:"items"`
}

type TriggerBy

type TriggerBy struct {
	// 触发此次任务的代码库信息
	CodehostID int    `bson:"codehost_id,omitempty"      json:"codehost_id,omitempty"`
	RepoOwner  string `bson:"repo_owner,omitempty"       json:"repo_owner,omitempty"`
	RepoName   string `bson:"repo_name,omitempty"        json:"repo_name,omitempty"`
	Source     string `json:"source,omitempty" bson:"source,omitempty"`
	// 触发此次任务的merge request id,用于判断多个任务对应的commit是否属于同一个merge request
	MergeRequestID string `json:"merge_request_id,omitempty" bson:"merge_request_id,omitempty"`
	// 触发此次任务的commit id
	CommitID string `json:"commit_id,omitempty" bson:"commit_id,omitempty"`
}

type Variable added in v1.6.0

type Variable struct {
	Key   string `bson:"key"   json:"key"`
	Value string `bson:"value" json:"value"`
}

type VersionArgs

type VersionArgs struct {
	Enabled bool     `bson:"enabled" json:"enabled"`
	Version string   `bson:"version" json:"version"`
	Desc    string   `bson:"desc"    json:"desc"`
	Labels  []string `bson:"labels"  json:"labels"`
}

type Vulnerability

type Vulnerability struct {
	Name          string                 `json:"name,omitempty"`
	NamespaceName string                 `json:"namespaceName,omitempty"`
	Description   string                 `json:"description,omitempty"`
	Link          string                 `json:"link,omitempty"`
	Severity      string                 `json:"severity,omitempty"`
	Metadata      map[string]interface{} `json:"metadata,omitempty"`
	FixedBy       string                 `json:"fixedBy,omitempty"`
	FixedIn       []Feature              `json:"fixedIn,omitempty"`
}

type WebHook

type WebHook struct {
	ID      primitive.ObjectID `bson:"_id,omitempty"       json:"id,omitempty"`
	Owner   string             `bson:"owner"               json:"owner"`
	Repo    string             `bson:"repo"                json:"repo"`
	Address string             `bson:"address"             json:"address"`
	HookID  string             `bson:"hook_id,omitempty"   json:"hook_id,omitempty"`
	// References is a record to store all the workflows/services who are using this webhook
	References []string `bson:"references"    json:"references"`
}

func (WebHook) TableName

func (WebHook) TableName() string

type WebHookUser

type WebHookUser struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"          json:"id,omitempty"`
	Domain    string             `bson:"domain,omitempty"       json:"domain,omitempty"`
	UserName  string             `bson:"user_name"              json:"user_name"`
	Email     string             `bson:"email"                  json:"email"`
	Source    string             `bson:"source"                 json:"source"`
	CreatedAt int64              `bson:"created_at"             json:"created_at"`
}

func (WebHookUser) TableName

func (WebHookUser) TableName() string

type Workflow

type Workflow struct {
	ID              primitive.ObjectID `bson:"_id,omitempty"                json:"id,omitempty"`
	Name            string             `bson:"name"                         json:"name"`
	Enabled         bool               `bson:"enabled"                      json:"enabled"`
	ProductTmplName string             `bson:"product_tmpl_name"            json:"product_tmpl_name"`
	Team            string             `bson:"team,omitempty"               json:"team,omitempty"`
	EnvName         string             `bson:"env_name"                     json:"env_name,omitempty"`
	Description     string             `bson:"description,omitempty"        json:"description,omitempty"`
	UpdateBy        string             `bson:"update_by"                    json:"update_by,omitempty"`
	CreateBy        string             `bson:"create_by"                    json:"create_by,omitempty"`
	UpdateTime      int64              `bson:"update_time"                  json:"update_time"`
	CreateTime      int64              `bson:"create_time"                  json:"create_time"`
	Schedules       *ScheduleCtrl      `bson:"schedules,omitempty"          json:"schedules,omitempty"`
	ScheduleEnabled bool               `bson:"schedule_enabled"             json:"schedule_enabled"`
	Slack           *Slack             `bson:"slack,omitempty"              json:"slack,omitempty"`
	BuildStage      *BuildStage        `bson:"build_stage"                  json:"build_stage"`
	ArtifactStage   *ArtifactStage     `bson:"artifact_stage,omitempty"     json:"artifact_stage,omitempty"`
	TestStage       *TestStage         `bson:"test_stage"                   json:"test_stage"`
	SecurityStage   *SecurityStage     `bson:"security_stage"               json:"security_stage"`
	DistributeStage *DistributeStage   `bson:"distribute_stage"             json:"distribute_stage"`
	NotifyCtl       *NotifyCtl         `bson:"notify_ctl,omitempty"         json:"notify_ctl,omitempty"`
	HookCtl         *WorkflowHookCtrl  `bson:"hook_ctl"                     json:"hook_ctl"`
	IsFavorite      bool               `bson:"-"                            json:"is_favorite"`
	LastestTask     *TaskInfo          `bson:"-"                            json:"lastest_task"`
	LastSucessTask  *TaskInfo          `bson:"-"                            json:"last_task_success"`
	LastFailureTask *TaskInfo          `bson:"-"                            json:"last_task_failure"`
	TotalDuration   int64              `bson:"-"                            json:"total_duration"`
	TotalNum        int                `bson:"-"                            json:"total_num"`
	TotalSuccess    int                `bson:"-"                            json:"total_success"`

	// ResetImage indicate whether reset image to original version after completion
	ResetImage bool `json:"reset_image" bson:"reset_image"`
	// IsParallel 控制单一工作流的任务是否支持并行处理
	IsParallel bool `json:"is_parallel" bson:"is_parallel"`
}

func (Workflow) TableName

func (Workflow) TableName() string

type WorkflowHook

type WorkflowHook struct {
	AutoCancel          bool              `bson:"auto_cancel"             json:"auto_cancel"`
	CheckPatchSetChange bool              `bson:"check_patch_set_change"  json:"check_patch_set_change"`
	MainRepo            *MainHookRepo     `bson:"main_repo"               json:"main_repo"`
	WorkflowArgs        *WorkflowTaskArgs `bson:"workflow_args"           json:"workflow_args"`
}

type WorkflowHookCtrl

type WorkflowHookCtrl struct {
	Enabled bool            `bson:"enabled" json:"enabled"`
	Items   []*WorkflowHook `bson:"items" json:"items"`
}

type WorkflowStat

type WorkflowStat struct {
	ID            primitive.ObjectID `bson:"_id,omitempty"   json:"id,omitempty"`
	ProductName   string             `bson:"product_name"    json:"product_name"`
	Name          string             `bson:"name"            json:"name"`
	Type          string             `bson:"type"            json:"type"`
	TotalDuration int64              `bson:"total_duration"  json:"total_duration"`
	TotalSuccess  int                `bson:"total_success"   json:"total_success"`
	TotalFailure  int                `bson:"total_failure"   json:"total_failure"`
	CreatedAt     int64              `bson:"created_at"      json:"created_at"`
	UpdatedAt     int64              `bson:"updated_at"      json:"updated_at"`
}

func (WorkflowStat) TableName

func (WorkflowStat) TableName() string

type WorkflowTaskArgs

type WorkflowTaskArgs struct {
	WorkflowName    string `bson:"workflow_name"                json:"workflow_name"`
	ProductTmplName string `bson:"product_tmpl_name"            json:"product_tmpl_name"`
	Description     string `bson:"description,omitempty"        json:"description,omitempty"`
	//为了兼容老数据,namespace可能会存多个环境名称,用逗号隔开
	Namespace           string          `bson:"namespace"                    json:"namespace"`
	BaseNamespace       string          `bson:"base_namespace,omitempty"     json:"base_namespace,omitempty"`
	EnvRecyclePolicy    string          `bson:"env_recycle_policy,omitempty" json:"env_recycle_policy,omitempty"`
	EnvUpdatePolicy     string          `bson:"env_update_policy,omitempty"  json:"env_update_policy,omitempty"`
	Target              []*TargetArgs   `bson:"targets"                      json:"targets"`
	Artifact            []*ArtifactArgs `bson:"artifact_args"                json:"artifact_args"`
	Tests               []*TestArgs     `bson:"tests"                        json:"tests"`
	VersionArgs         *VersionArgs    `bson:"version_args,omitempty"       json:"version_args,omitempty"`
	ReqID               string          `bson:"req_id"                       json:"req_id"`
	RegistryID          string          `bson:"registry_id,omitempty"        json:"registry_id,omitempty"`
	StorageID           string          `bson:"storage_id,omitempty"         json:"storage_id,omitempty"`
	DistributeEnabled   bool            `bson:"distribute_enabled"           json:"distribute_enabled"`
	WorkflowTaskCreator string          `bson:"workflow_task_creator"        json:"workflow_task_creator"`
	// Ignore docker build cache
	IgnoreCache bool `json:"ignore_cache" bson:"ignore_cache"`
	// Ignore workspace cache and reset volume
	ResetCache bool `json:"reset_cache" bson:"reset_cache"`

	// NotificationID is the id of scmnotify.Notification
	NotificationID string `bson:"notification_id" json:"notification_id"`

	// webhook触发工作流任务时,触发任务的repo信息、prID和commitID
	MergeRequestID string `bson:"merge_request_id" json:"merge_request_id"`
	CommitID       string `bson:"commit_id"        json:"commit_id"`
	Source         string `bson:"source"           json:"source"`
	CodehostID     int    `bson:"codehost_id"      json:"codehost_id"`
	RepoOwner      string `bson:"repo_owner"       json:"repo_owner"`
	RepoName       string `bson:"repo_name"        json:"repo_name"`

	//github check run
	HookPayload *HookPayload `bson:"hook_payload"            json:"hook_payload,omitempty"`
	// 请求模式,openAPI表示外部客户调用
	RequestMode string `json:"request_mode,omitempty"`
	IsParallel  bool   `json:"is_parallel" bson:"is_parallel"`
}

WorkflowTaskArgs 多服务工作流任务参数

type Workload added in v1.5.0

type Workload struct {
	EnvName     string `bson:"env_name"         json:"env_name"`
	Name        string `bson:"name"             json:"name"`
	Type        string `bson:"type"             json:"type"`
	ProductName string `bson:"product_name"     json:"product_name"`
}

type WorkloadStat added in v1.5.0

type WorkloadStat struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"         json:"id,omitempty"`
	ClusterID string             `bson:"cluster_id"            json:"cluster_id"`
	Namespace string             `bson:"namespace"             json:"namespace"`
	Workloads []Workload         `bson:"workloads"             json:"workloads"`
}

func (WorkloadStat) TableName added in v1.5.0

func (WorkloadStat) TableName() string

type YamlPreview

type YamlPreview struct {
	Kind string `bson:"-"           json:"kind"`
}

type YamlPreviewForPorts

type YamlPreviewForPorts struct {
	Kind string `bson:"-"           json:"kind"`
	Spec *Spec  `bson:"-"           json:"spec"`
}

type YamlTemplate added in v1.6.0

type YamlTemplate struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Name      string             `bson:"name"          json:"name"`
	Content   string             `bson:"content"       json:"content"`
	Variables []*Variable        `bson:"variables"     json:"variables"`
}

func (YamlTemplate) TableName added in v1.6.0

func (YamlTemplate) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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