models

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageFromKoderover = "koderover"
	ImageFromCustom    = "custom"
)
View Source
const (
	// 工作流任务的留存
	WorkflowTaskRetention     CapacityTarget = "WorkflowTaskRetention"
	DefaultWorkflowRemainDays int            = 365
)

Variables

View Source
var DefaultWorkflowTaskRetention = &CapacityStrategy{
	Target: WorkflowTaskRetention,
	Retention: &RetentionConfig{
		MaxDays: DefaultWorkflowRemainDays,
	},
}

Functions

func IToi

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

func IToiYaml

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

Types

type APIConfig

type APIConfig struct {
	ExternalSystemId string           `json:"external_system_id"`
	ApiPath          string           `json:"api_path"`
	Queries          []*util.KeyValue `json:"queries"`
}

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"`
	PRs           []int  `bson:"prs,omitempty"             json:"prs,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 AdvancedConfig

type AdvancedConfig struct {
	Strategy          string                     `json:"strategy,omitempty"       bson:"strategy,omitempty"`
	NodeLabels        []*NodeSelectorRequirement `json:"node_labels,omitempty"    bson:"node_labels,omitempty"`
	ProjectNames      []string                   `json:"-"                        bson:"-"`
	Tolerations       string                     `json:"tolerations"              bson:"tolerations"`
	ClusterAccessYaml string                     `json:"cluster_access_yaml"      bson:"cluster_access_yaml"`
	ScheduleWorkflow  bool                       `json:"schedule_workflow"        bson:"schedule_workflow"`
	ScheduleStrategy  []*ScheduleStrategy        `json:"schedule_strategy"        bson:"schedule_strategy"`
}

type AnalysisConfig

type AnalysisConfig struct {
	ResourceTypes []ResourceType `bson:"resource_types" json:"resource_types"`
}

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 ApolloAuthConfig

type ApolloAuthConfig struct {
	// User is the username of apollo for update config
	User  string `json:"user"`
	Token string `json:"token" bson:"token"`
}

type ApolloConfig

type ApolloConfig struct {
	ServerAddress string `json:"server_address"`
	*ApolloAuthConfig
}

type ApolloJobSpec

type ApolloJobSpec struct {
	ApolloID            string             `bson:"apolloID"      json:"apolloID"       yaml:"apolloID"`
	NamespaceList       []*ApolloNamespace `bson:"namespaceList" json:"namespaceList"  yaml:"namespaceList"`
	NamespaceListOption []*ApolloNamespace `bson:"-" json:"namespaceListOption"  yaml:"namespaceListOption"`
}

type ApolloKV

type ApolloKV struct {
	Key string `bson:"key" json:"key" yaml:"key"`
	Val string `bson:"val" json:"val" yaml:"val"`
}

type ApolloNamespace

type ApolloNamespace struct {
	AppID          string      `bson:"appID"             json:"appID"                       yaml:"appID"`
	ClusterID      string      `bson:"clusterID"         json:"clusterID"                   yaml:"clusterID"`
	Env            string      `bson:"env"               json:"env"                         yaml:"env"`
	Namespace      string      `bson:"namespace"         json:"namespace"                   yaml:"namespace"`
	Type           string      `bson:"type"              json:"type"                        yaml:"type"`
	OriginalConfig []*ApolloKV `bson:"original_config"   json:"original_config,omitempty"   yaml:"original_config"`
	KeyValList     []*ApolloKV `bson:"kv"                json:"kv"                          yaml:"kv"`
}

type Approval

type Approval struct {
	Enabled          bool                `bson:"enabled"                     yaml:"enabled"                       json:"enabled"`
	Status           config.Status       `bson:"status"                      yaml:"status"                        json:"status"`
	Type             config.ApprovalType `bson:"type"                        yaml:"type"                          json:"type"`
	Description      string              `bson:"description"                 yaml:"description"                   json:"description"`
	StartTime        int64               `bson:"start_time"                  yaml:"start_time,omitempty"          json:"start_time,omitempty"`
	EndTime          int64               `bson:"end_time"                    yaml:"end_time,omitempty"            json:"end_time,omitempty"`
	NativeApproval   *NativeApproval     `bson:"native_approval"             yaml:"native_approval,omitempty"     json:"native_approval,omitempty"`
	LarkApproval     *LarkApproval       `bson:"lark_approval"               yaml:"lark_approval,omitempty"       json:"lark_approval,omitempty"`
	DingTalkApproval *DingTalkApproval   `bson:"dingtalk_approval"           yaml:"dingtalk_approval,omitempty"   json:"dingtalk_approval,omitempty"`
}

type ArtifactArgs

type ArtifactArgs struct {
	Name         string      `bson:"name"                                json:"name"`
	ImageName    string      `bson:"image_name,omitempty"                json:"image_name,omitempty"`
	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 {
	HideServiceModule bool                 `bson:"hide_service_module"    json:"hide_service_module"`
	Target            *ServiceModuleTarget `bson:"target"                 json:"target"`
}

ArtifactModule ...

type ArtifactPackageTaskArgs

type ArtifactPackageTaskArgs struct {
	ProjectName      string             `bson:"project_name"            json:"project_name"`
	EnvName          string             `bson:"env_name"                json:"env_name"`
	Images           []*ImagesByService `bson:"images"                  json:"images"`
	SourceRegistries []string           `bson:"source_registries"       json:"source_registries"`
	TargetRegistries []string           `bson:"target_registries"       json:"target_registries"`
}

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"`
	// New field since 1.12
	// ImageType is the type of the image, currently only one type is supported called sonar
	ImageType string `bson:"image_type" json:"image_type"`
}

BasicImage ...

func (BasicImage) TableName

func (BasicImage) TableName() string

type BlueGreenDeployJobSpec

type BlueGreenDeployJobSpec struct {
	ClusterID        string             `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace        string             `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	DockerRegistryID string             `bson:"docker_registry_id"     json:"docker_registry_id"    yaml:"docker_registry_id"`
	Targets          []*BlueGreenTarget `bson:"targets"                json:"targets"               yaml:"targets"`
}

type BlueGreenDeployV2JobSpec

type BlueGreenDeployV2JobSpec struct {
	Version    string                                `bson:"version"               json:"version"              yaml:"version"`
	Production bool                                  `bson:"production"            json:"production"           yaml:"production"`
	Env        string                                `bson:"env"                   json:"env"                  yaml:"env"`
	EnvOptions []*ZadigBlueGreenDeployEnvInformation `bson:"-"                     json:"env_options"          yaml:"env_options"`
	Source     string                                `bson:"source"                json:"source"               yaml:"source"`
	Services   []*BlueGreenDeployV2Service           `bson:"services"              json:"services"             yaml:"services"`
}

type BlueGreenDeployV2Service

type BlueGreenDeployV2Service struct {
	// ServiceName is zadig service name
	ServiceName         string                                    `bson:"service_name" json:"service_name" yaml:"service_name"`
	BlueServiceYaml     string                                    `bson:"blue_service_yaml" json:"blue_service_yaml" yaml:"blue_service_yaml"`
	BlueServiceName     string                                    `bson:"blue_service_name,omitempty" json:"blue_service_name,omitempty" yaml:"blue_service_name,omitempty"`
	BlueDeploymentYaml  string                                    `bson:"blue_deployment_yaml,omitempty" json:"blue_deployment_yaml,omitempty" yaml:"blue_deployment_yaml,omitempty"`
	BlueDeploymentName  string                                    `bson:"blue_deployment_name,omitempty" json:"blue_deployment_name,omitempty" yaml:"blue_deployment_name,omitempty"`
	GreenDeploymentName string                                    `bson:"green_deployment_name,omitempty" json:"green_deployment_name,omitempty" yaml:"green_deployment_name,omitempty"`
	GreenServiceName    string                                    `bson:"green_service_name,omitempty" json:"green_service_name,omitempty" yaml:"green_service_name,omitempty"`
	ServiceAndImage     []*BlueGreenDeployV2ServiceModuleAndImage `bson:"service_and_image" json:"service_and_image" yaml:"service_and_image"`
}

type BlueGreenDeployV2ServiceModuleAndImage

type BlueGreenDeployV2ServiceModuleAndImage struct {
	ServiceModule string `bson:"service_module" json:"service_module" yaml:"service_module"`
	Image         string `bson:"image"          json:"image"          yaml:"image"`
	// Following fields only save for frontend
	ImageName string `bson:"image_name"     json:"image_name"     yaml:"image_name"`
	// Name is the service module name for the sake of old data.
	Name        string `bson:"name"           json:"name"           yaml:"name"`
	ServiceName string `bson:"service_name"   json:"service_name"   yaml:"service_name"`
	Value       string `bson:"value"          json:"value"          yaml:"value"`
}

type BlueGreenReleaseJobSpec

type BlueGreenReleaseJobSpec struct {
	FromJob string `bson:"from_job"               json:"from_job"              yaml:"from_job"`
}

type BlueGreenReleaseV2JobSpec

type BlueGreenReleaseV2JobSpec struct {
	FromJob string `bson:"from_job"               json:"from_job"              yaml:"from_job"`
}

type BlueGreenTarget

type BlueGreenTarget struct {
	K8sServiceName     string `bson:"k8s_service_name"       json:"k8s_service_name"      yaml:"k8s_service_name"`
	BlueK8sServiceName string `bson:"blue_k8s_service_name"  json:"blue_k8s_service_name" yaml:"-"`
	ContainerName      string `bson:"container_name"         json:"container_name"        yaml:"container_name"`
	Image              string `bson:"image"                  json:"image"                 yaml:"image"`
	// unit is minute.
	DeployTimeout    int64  `bson:"deploy_timeout"         json:"deploy_timeout"        yaml:"deploy_timeout"`
	WorkloadName     string `bson:"workload_name"          json:"workload_name"         yaml:"workload_name"`
	BlueWorkloadName string `bson:"blue_workload_name"     json:"blue_workload_name"    yaml:"-"`
	WorkloadType     string `bson:"workload_type"          json:"workload_type"         yaml:"workload_type"`
	Version          string `bson:"version"                json:"version"               yaml:"-"`
}

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"`
	TemplateID string             `bson:"template_id"                  json:"template_id"`
	Timeout    int                `bson:"timeout"                      json:"timeout"`
	// 在任一编译配置模板中只能出现一次
	// 对于k8s部署是传入容器名称
	// 对于物理机部署是服务名称
	Targets        []*ServiceModuleTarget `bson:"targets"                       json:"targets"`
	TargetRepos    []*TargetRepo          `bson:"-"                             json:"target_repos"`
	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"`
	Infrastructure string                 `bson:"infrastructure"                json:"infrastructure"`
	VMLabels       []string               `bson:"vm_labels"                     json:"vm_labels"`
	JenkinsBuild   *JenkinsBuild          `bson:"jenkins_build,omitempty"       json:"jenkins_build,omitempty"`
	ScriptType     types.ScriptType       `bson:"script_type"                   json:"script_type"`
	Scripts        string                 `bson:"scripts"                       json:"scripts"`
	PostBuild      *PostBuild             `bson:"post_build,omitempty"          json:"post_build"`

	// TODO: Deprecated.
	Caches               []string            `bson:"caches"                        json:"caches"`
	ProductName          string              `bson:"product_name"                  json:"product_name"`
	SSHs                 []string            `bson:"sshs"                          json:"sshs"`
	PreDeploy            *PreDeploy          `bson:"pre_deploy"                    json:"pre_deploy"`
	DeployInfrastructure string              `bson:"deploy_infrastructure"         json:"deploy_infrastructure"`
	DeployVMLabels       []string            `bson:"deploy_vm_labels"              json:"deploy_vm_labels"`
	DeployRepos          []*types.Repository `bson:"deploy_repos"                  json:"deploy_repos"`
	PMDeployScriptType   types.ScriptType    `bson:"pm_deploy_script_type"         json:"pm_deploy_script_type"`
	PMDeployScripts      string              `bson:"pm_deploy_scripts"             json:"pm_deploy_scripts"`

	// New since V1.10.0.
	CacheEnable  bool               `bson:"cache_enable"   json:"cache_enable"`
	CacheDirType types.CacheDirType `bson:"cache_dir_type" json:"cache_dir_type"`
	CacheUserDir string             `bson:"cache_user_dir" json:"cache_user_dir"`
	// New since V1.10.0. Only to tell the webpage should the advanced settings be displayed
	AdvancedSettingsModified bool      `bson:"advanced_setting_modified" json:"advanced_setting_modified"`
	Outputs                  []*Output `bson:"outputs"                   json:"outputs"`
}

func (*Build) SafeRepos

func (build *Build) SafeRepos() []*types.Repository

func (*Build) SafeReposDeepCopy

func (build *Build) SafeReposDeepCopy() []*types.Repository

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"`
	HideServiceModule bool                      `bson:"hide_service_module"    json:"hide_service_module"`
	BuildModuleVer    string                    `bson:"build_module_ver"       json:"build_module_ver"`
	BranchFilter      []*types.BranchFilterInfo `bson:"branch_filter"          json:"branch_filter"`
}

BuildModule ...

type BuildModuleArgs

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 BuildTemplate

type BuildTemplate 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"`
	UpdateTime               int64              `bson:"update_time"                   json:"update_time"`
	UpdateBy                 string             `bson:"update_by"                     json:"update_by"`
	PreBuild                 *PreBuild          `bson:"pre_build"                     json:"pre_build"`
	JenkinsBuild             *JenkinsBuild      `bson:"jenkins_build,omitempty"       json:"jenkins_build,omitempty"`
	ScriptType               types.ScriptType   `bson:"script_type"                   json:"script_type"`
	Scripts                  string             `bson:"scripts"                       json:"scripts"`
	PostBuild                *PostBuild         `bson:"post_build,omitempty"          json:"post_build"`
	SSHs                     []string           `bson:"sshs"                          json:"sshs"`
	PMDeployScripts          string             `bson:"pm_deploy_scripts"             json:"pm_deploy_scripts"`
	CacheEnable              bool               `bson:"cache_enable"                  json:"cache_enable"`
	CacheDirType             types.CacheDirType `bson:"cache_dir_type"                json:"cache_dir_type"`
	CacheUserDir             string             `bson:"cache_user_dir"                json:"cache_user_dir"`
	AdvancedSettingsModified bool               `bson:"advanced_setting_modified"     json:"advanced_setting_modified"`
	Outputs                  []*Output          `bson:"outputs"                       json:"outputs"`
	Infrastructure           string             `bson:"infrastructure"                json:"infrastructure"`
	VmLabels                 []string           `bson:"vm_labels"                     json:"vm_labels"`
}

func (BuildTemplate) TableName

func (BuildTemplate) TableName() string

type CallbackArgs

type CallbackArgs struct {
	CallbackUrl  string                 `bson:"callback_url" json:"callback_url"`   // url-encoded full path
	CallbackVars map[string]interface{} `bson:"callback_vars" json:"callback_vars"` // custom defied vars, will be set to body of callback request
}

type CallbackRequest

type CallbackRequest struct {
	ID   primitive.ObjectID `bson:"_id,omitempty"  json:"id,omitempty"`
	Type string             `bson:"type"           json:"type"`
	// this is called pipeline name because it is called so all around this system
	PipelineName  string                 `bson:"task_name"      json:"task_name"`
	ProjectName   string                 `bson:"project_name"   json:"project_name"`
	TaskID        int64                  `bson:"task_id"        json:"task_id"`
	Status        string                 `bson:"status"         json:"status"`
	StatusMessage string                 `bson:"status_message" json:"status_message"`
	Payload       map[string]interface{} `bson:"payload"        json:"payload"`
}

func (CallbackRequest) TableName

func (CallbackRequest) TableName() string

type CanaryDeployJobSpec

type CanaryDeployJobSpec struct {
	ClusterID        string          `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace        string          `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	DockerRegistryID string          `bson:"docker_registry_id"     json:"docker_registry_id"    yaml:"docker_registry_id"`
	Targets          []*CanaryTarget `bson:"targets"                json:"targets"               yaml:"targets"`
	TargetOptions    []*CanaryTarget `bson:"target_options"         json:"target_options"        yaml:"target_options"`
}

type CanaryReleaseJobSpec

type CanaryReleaseJobSpec struct {
	FromJob string `bson:"from_job"               json:"from_job"              yaml:"from_job"`
	// unit is minute.
	ReleaseTimeout int64 `bson:"release_timeout"        json:"release_timeout"       yaml:"release_timeout"`
}

type CanaryTarget

type CanaryTarget struct {
	K8sServiceName   string `bson:"k8s_service_name"       json:"k8s_service_name"      yaml:"k8s_service_name"`
	ContainerName    string `bson:"container_name"         json:"container_name"        yaml:"container_name"`
	Image            string `bson:"image"                  json:"image"                 yaml:"image"`
	CanaryPercentage int    `bson:"canary_percentage"      json:"canary_percentage"     yaml:"canary_percentage"`
	// unit is minute.
	DeployTimeout int64  `bson:"deploy_timeout"         json:"deploy_timeout"        yaml:"deploy_timeout"`
	WorkloadName  string `bson:"workload_name"          json:"workload_name"         yaml:"workload_name"`
	WorkloadType  string `bson:"workload_type"          json:"workload_type"         yaml:"workload_type"`
}

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 系统配额的配置对象

type CardConfig

type CardConfig struct {
	ID     string      `bson:"id"`
	Name   string      `bson:"name"`
	Type   string      `bson:"type"`
	Config interface{} `bson:"config,omitempty"`
}

type Chart

type Chart struct {
	ID             primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Name           string             `bson:"name"          json:"name"`
	Source         string             `bson:"source"        json:"source"`
	Owner          string             `bson:"owner"         json:"owner"`
	Namespace      string             `bson:"namespace"     json:"namespace"`
	Repo           string             `bson:"repo"          json:"repo"`
	Path           string             `bson:"path"          json:"path"`
	Branch         string             `bson:"branch"        json:"branch"`
	CodeHostID     int                `bson:"codehost_id"   json:"codeHostID"`
	Revision       int64              `bson:"revision"      json:"revision"`
	ChartVariables []*ChartVariable   `bson:"variables"     json:"variables"`
	Sha1           string             `bson:"sha1"          json:"sha1"`
}

func (*Chart) GetNamespace

func (chart *Chart) GetNamespace() string

func (*Chart) GetVariableMap

func (chart *Chart) GetVariableMap() map[string]*ChartVariable

func (Chart) TableName

func (Chart) TableName() string

type ChartVariable

type ChartVariable struct {
	Key         string `json:"key"`
	Value       string `json:"value,omitempty"`
	Description string `json:"description,omitempty"`
}

type ClusterBrief added in v2.3.0

type ClusterBrief struct {
	ClusterID   string                  `json:"cluster_id"   yaml:"cluster_id"`
	ClusterName string                  `json:"cluster_name" yaml:"cluster_name"`
	Strategies  []*ClusterStrategyBrief `json:"strategies"   yaml:"strategies"`
}

type ClusterStrategyBrief added in v2.3.0

type ClusterStrategyBrief struct {
	StrategyID   string `json:"strategy_id"`
	StrategyName string `json:"strategy_name"`
}

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
	AesKey             string `json:"aes_key"`

	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"`
	K8SClusters        []*K8SClusterResp  `json:"k8s_clusters"`

	// RegistryID is the id of product registry
	RegistryID string `json:"registry_id"`

	// build concurrency settings
	BuildConcurrency int64 `json:"build_concurrency"`
}

type ConfigurationManagement

type ConfigurationManagement struct {
	ID             primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	SystemIdentity string             `json:"system_identity" bson:"system_identity" binding:"required"`
	Type           string             `json:"type" bson:"type" binding:"required"`
	AuthConfig     interface{}        `json:"auth_config" bson:"auth_config"`
	ServerAddress  string             `json:"server_address" bson:"server_address" binding:"required"`
	UpdateTime     int64              `json:"update_time" bson:"update_time"`
}

func (ConfigurationManagement) TableName

func (ConfigurationManagement) TableName() string

type Container

type Container struct {
	Name      string         `bson:"name"                          json:"name"`
	Image     string         `bson:"image"                         json:"image"`
	ImageName string         `bson:"image_name,omitempty"          json:"image_name,omitempty"`
	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 CreateFromChartRepo

type CreateFromChartRepo struct {
	ChartRepoName string `json:"chart_repo_name" bson:"chart_repo_name"`
	ChartName     string `json:"chart_name"      bson:"chart_name"`
	ChartVersion  string `json:"chart_version"   bson:"chart_version"`
}

type CreateFromChartTemplate

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

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

type CreateFromRepo

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 CreateFromYamlTemplate

type CreateFromYamlTemplate struct {
	TemplateID   string      `bson:"template_id"   json:"template_id"`
	Variables    []*Variable `bson:"variables"     json:"variables"` // Deprecated since 1.16.0
	VariableYaml string      `bson:"variable_yaml" json:"variable_yaml"`
}

type CreateUpdateCommonEnvCfgArgs

type CreateUpdateCommonEnvCfgArgs struct {
	EnvName              string                        `json:"env_name"`
	ProductName          string                        `json:"product_name"`
	ServiceName          string                        `json:"service_name"`
	Name                 string                        `json:"name"`
	YamlData             string                        `json:"yaml_data"`
	RestartAssociatedSvc bool                          `json:"restart_associated_svc"`
	CommonEnvCfgType     config.CommonEnvCfgType       `json:"common_env_cfg_type"`
	Services             []string                      `json:"services"`
	GitRepoConfig        *templatemodels.GitRepoConfig `json:"git_repo_config"`
	SourceDetail         *CreateFromRepo               `json:"-"`
	AutoSync             bool                          `json:"auto_sync"`
	LatestEnvResource    *EnvResource                  `json:"-"`
	Production           bool                          `json:"production"`
}

type Cronjob

type Cronjob struct {
	ID              primitive.ObjectID `bson:"_id,omitempty"                       json:"id"`
	Name            string             `bson:"name"                                json:"name"`
	Type            string             `bson:"type"                                json:"type"`
	Number          uint64             `bson:"number"                              json:"number"`
	Frequency       string             `bson:"frequency"                           json:"frequency"`
	Time            string             `bson:"time"                                json:"time"`
	Cron            string             `bson:"cron"                                json:"cron"`
	ProductName     string             `bson:"product_name,omitempty"              json:"product_name,omitempty"`
	MaxFailure      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"`
	WorkflowV4Args  *WorkflowV4        `bson:"workflow_v4_args"                    json:"workflow_v4_args"`
	TestArgs        *TestTaskArgs      `bson:"test_args,omitempty"                 json:"test_args,omitempty"`
	EnvAnalysisArgs *EnvArgs           `bson:"env_analysis_args,omitempty"         json:"env_analysis_args,omitempty"`
	EnvArgs         *EnvArgs           `bson:"env_args,omitempty"                  json:"env_args,omitempty"`
	JobType         string             `bson:"job_type"                            json:"job_type"`
	Enabled         bool               `bson:"enabled"                             json:"enabled"`
}

func (Cronjob) TableName

func (Cronjob) TableName() string

type CustomDeployJobSpec

type CustomDeployJobSpec struct {
	Namespace          string `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	ClusterID          string `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	DockerRegistryID   string `bson:"docker_registry_id"     json:"docker_registry_id"    yaml:"docker_registry_id"`
	SkipCheckRunStatus bool   `bson:"skip_check_run_status"  json:"skip_check_run_status" yaml:"skip_check_run_status"`
	// support two sources, runtime/fixed.
	Source string `bson:"source"                 json:"source"                yaml:"source"`
	// unit is minute.
	Timeout       int64            `bson:"timeout"                json:"timeout"               yaml:"timeout"`
	Targets       []*DeployTargets `bson:"targets"                json:"targets"               yaml:"targets"`
	TargetOptions []*DeployTargets `bson:"-"                      json:"target_options"        yaml:"target_options"`
}

type CustomField

type CustomField struct {
	TaskID                 int            `bson:"task_id"                             json:"task_id"`
	Status                 int            `bson:"status"                              json:"status"`
	Duration               int            `bson:"duration"                            json:"duration"`
	Executor               int            `bson:"executor"                            json:"executor"`
	BuildServiceComponent  map[string]int `bson:"build_service_component,omitempty"   json:"build_service_component,omitempty"`
	BuildCodeMsg           map[string]int `bson:"build_code_msg,omitempty"            json:"build_code_msg,omitempty"`
	DeployServiceComponent map[string]int `bson:"deploy_service_component,omitempty"  json:"deploy_service_component,omitempty"`
	DeployEnv              map[string]int `bson:"deploy_env,omitempty"                json:"deploy_env,omitempty"`
	TestResult             map[string]int `bson:"test_result,omitempty"               json:"test_result,omitempty"`
}

CustomField use to display custom field of workflow history tasks

type CustomTheme

type CustomTheme struct {
	BorderGray               string `bson:"border_gray" json:"border_gray"`
	FontGray                 string `bson:"font_gray" json:"font_gray"`
	FontLightGray            string `bson:"font_light_gray" json:"font_light_gray"`
	ThemeColor               string `bson:"theme_color" json:"theme_color"`
	ThemeBorderColor         string `bson:"theme_border_color" json:"theme_border_color"`
	ThemeBackgroundColor     string `bson:"theme_background_color" json:"theme_background_color"`
	ThemeLightColor          string `bson:"theme_light_color" json:"theme_light_color"`
	BackgroundColor          string `bson:"background_color" json:"background_color"`
	GlobalBackgroundColor    string `bson:"global_background_color" json:"global_background_color"`
	Success                  string `bson:"success" json:"success"`
	Danger                   string `bson:"danger" json:"danger"`
	Warning                  string `bson:"warning" json:"warning"`
	Info                     string `bson:"info" json:"info"`
	Primary                  string `bson:"primary" json:"primary"`
	WarningLight             string `bson:"warning_light" json:"warning_light"`
	NotRunning               string `bson:"not_running" json:"not_running"`
	PrimaryColor             string `bson:"primary_color" json:"primary_color"`
	SecondaryColor           string `bson:"secondary_color" json:"secondary_color"`
	SidebarBg                string `bson:"sidebar_bg" json:"sidebar_bg"`
	SidebarActiveColor       string `bson:"sidebar_active_color" json:"sidebar_active_color"`
	ProjectItemIconColor     string `bson:"project_item_icon_color" json:"project_item_icon_color"`
	ProjectNameColor         string `bson:"project_name_color" json:"project_name_color"`
	TableCellBackgroundColor string `bson:"table_cell_background_color" json:"table_cell_background_color"`
	LinkColor                string `bson:"link_color" json:"link_color"`
}

type CustomWorkflowTestReport

type CustomWorkflowTestReport struct {
	ID               primitive.ObjectID `bson:"_id,omitempty"`
	WorkflowName     string             `bson:"workflow_name"`
	JobName          string             `bson:"job_name"`
	TaskID           int64              `bson:"task_id"`
	ServiceName      string             `bson:"service_name"`
	ServiceModule    string             `bson:"service_module"`
	ZadigTestName    string             `bson:"zadig_test_name"`
	ZadigTestProject string             `bson:"zadig_test_project"`
	TestName         string             `bson:"test_name"`
	TestCaseNum      int                `bson:"test_case_num"`
	SuccessCaseNum   int                `bson:"success_case_num"`
	SkipCaseNum      int                `bson:"skip_case_num"`
	FailedCaseNum    int                `bson:"failed_case_num"`
	ErrorCaseNum     int                `bson:"error_case_num"`
	TestTime         float64            `bson:"test_time"`
	TestCases        []TestCase         `bson:"test_cases"`
}

func (CustomWorkflowTestReport) TableName

func (CustomWorkflowTestReport) TableName() string

type DBInstance

type DBInstance struct {
	ID        primitive.ObjectID    `bson:"_id,omitempty"         json:"id,omitempty"`
	Type      config.DBInstanceType `bson:"type"                  json:"type"`
	Name      string                `bson:"name"                  json:"name"`
	Projects  []string              `bson:"projects"              json:"projects"`
	Host      string                `bson:"host"                  json:"host"`
	Port      string                `bson:"port"                  json:"port"`
	Username  string                `bson:"username"              json:"username"`
	Password  string                `bson:"password"              json:"password,omitempty"`
	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 (DBInstance) TableName

func (h DBInstance) TableName() string

type DashboardConfig

type DashboardConfig struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"`
	Cards      []*CardConfig      `bson:"cards"`
	UserID     string             `bson:"user_id"`
	UserName   string             `bson:"user_name"`
	UpdateTime int64              `bson:"update_time"`
}

func (DashboardConfig) TableName

func (d DashboardConfig) 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"`
	JobTaskName       string             `bson:"job_task_name,omitempty"      json:"job_task_name,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"`
	// for frontend display
	RealServiceName string `bson:"-" json:"real_service_name"`
	ServiceModule   string `bson:"-" json:"service_module"`
	ImageName       string `bson:"-" json:"image_name"`
}

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,omitempty"`
	DistributeType config.DistributeType `bson:"distribute_type"        json:"distributeType"`
	RegistryName   string                `bson:"registry_name"          json:"registryName"`
	ChartVersion   string                `bson:"chart_version"          json:"chartVersion,omitempty"`
	ChartName      string                `bson:"chart_name"             json:"chartName,omitempty"`
	ChartRepoName  string                `bson:"chart_repo_name"        json:"chartRepoName,omitempty"`
	SubDistributes []*DeliveryDistribute `bson:"-"                      json:"subDistributes,omitempty"`
	Namespace      string                `bson:"namespace"              json:"namespace,omitempty"`
	PackageFile    string                `bson:"package_file"           json:"packageFile,omitempty"`
	RemoteFileKey  string                `bson:"remote_file_key"        json:"remoteFileKey,omitempty"`
	DestStorageURL string                `bson:"dest_storage_url"       json:"destStorageUrl,omitempty"`
	S3StorageID    string                `bson:"s3_storage_id"          json:"s3StorageID"`
	StorageURL     string                `bson:"-"                      json:"storageUrl"`
	StorageBucket  string                `bson:"-"                      json:"storageBucket"`
	SrcStorageURL  string                `bson:"src_storage_url"        json:"srcStorageUrl,omitempty"`
	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"`

	ImageName     string `bson:"-" json:"image_name"`
	ServiceModule string `bson:"-" json:"service_module"`
	Image         string `bson:"-" json:"image"`
}

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"`
	WorkflowDisplayName string                   `bson:"workflow_display_name"   json:"workflowDisplayName"`
	Type                string                   `bson:"type"                    json:"type"`
	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"`
	Status              string                   `bson:"status"                  json:"status"`
	Error               string                   `bson:"error"                   json:"-"`
	Progress            *DeliveryVersionProgress `bson:"-"                       json:"progress"`
	CreateArgument      interface{}              `bson:"createArgument"          json:"-"`
	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 DeliveryVersionProgress

type DeliveryVersionProgress struct {
	SuccessCount int    `json:"successCount"`
	TotalCount   int    `json:"totalCount"`
	UploadStatus string `json:"uploadStatus"`
	Error        string `json:"error"`
}

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 DeployHelmChart

type DeployHelmChart struct {
	ReleaseName  string `bson:"release_name"          yaml:"release_name"             json:"release_name"`
	ChartRepo    string `bson:"chart_repo"            yaml:"chart_repo"               json:"chart_repo"`
	ChartName    string `bson:"chart_name"            yaml:"chart_name"               json:"chart_name"`
	ChartVersion string `bson:"chart_version"         yaml:"chart_version"            json:"chart_version"`
	ValuesYaml   string `bson:"values_yaml"           yaml:"values_yaml"              json:"values_yaml"`
}

type DeployModuleInfo added in v2.3.0

type DeployModuleInfo struct {
	ServiceModule string `bson:"service_module"      yaml:"service_module"   json:"service_module"`
	Image         string `bson:"image"               yaml:"image"            json:"image"`
	ImageName     string `bson:"image_name"          yaml:"image_name"       json:"image_name"`
}

type DeployService

type DeployService struct {
	ServiceName string `bson:"service_name"        yaml:"service_name"     json:"service_name"`
	// VariableConfigs added since 1.18
	VariableConfigs []*DeployVariableConfig `bson:"variable_configs"                 json:"variable_configs"                    yaml:"variable_configs"`
	// VariableKVs added since 1.18
	VariableKVs []*commontypes.RenderVariableKV `bson:"variable_kvs"       yaml:"variable_kvs"    json:"variable_kvs"`
	// LatestVariableKVs added since 1.18
	LatestVariableKVs []*commontypes.RenderVariableKV `bson:"latest_variable_kvs"       yaml:"latest_variable_kvs"    json:"latest_variable_kvs"`
	// VariableYaml added since 1.18, used for helm production environments
	VariableYaml string `bson:"variable_yaml" yaml:"variable_yaml" json:"variable_yaml"`
	// KeyVals Deprecated since 1.18
	KeyVals []*ServiceKeyVal `bson:"key_vals"            yaml:"key_vals"         json:"key_vals"`
	// LatestKeyVals Deprecated since 1.18
	LatestKeyVals []*ServiceKeyVal `bson:"latest_key_vals"     yaml:"latest_key_vals"  json:"latest_key_vals"`
	UpdateConfig  bool             `bson:"update_config"       yaml:"update_config"    json:"update_config"`
	Updatable     bool             `bson:"updatable"           yaml:"updatable"        json:"updatable"`
}

type DeployServiceInfo added in v2.3.0

type DeployServiceInfo struct {
	ServiceName string `bson:"service_name"                     yaml:"service_name"                        json:"service_name"`
	// VariableConfigs used to determine if a variable is visible to the workflow user.
	VariableConfigs   []*DeployVariableConfig         `bson:"variable_configs"                 yaml:"variable_configs,omitempty"          json:"variable_configs,omitempty"`
	VariableKVs       []*commontypes.RenderVariableKV `bson:"variable_kvs"                     yaml:"variable_kvs"                        json:"variable_kvs"`
	LatestVariableKVs []*commontypes.RenderVariableKV `bson:"latest_variable_kvs"              yaml:"latest_variable_kvs"                 json:"latest_variable_kvs"`
	VariableYaml      string                          `bson:"variable_yaml"                    yaml:"variable_yaml"                       json:"variable_yaml"`
	UpdateConfig      bool                            `bson:"update_config"                    yaml:"update_config"                       json:"update_config"`
	Updatable         bool                            `bson:"-"                        yaml:"updatable"                           json:"updatable"`
	Deployed          bool                            `bson:"-"                                yaml:"deployed"                            json:"deployed"`
	Modules           []*DeployModuleInfo             `bson:"modules"                          yaml:"modules"                             json:"modules"`
	// Deprecated since 1.18
	KeyVals       []*ServiceKeyVal `bson:"key_vals"            yaml:"key_vals"         json:"key_vals"`
	LatestKeyVals []*ServiceKeyVal `bson:"latest_key_vals"     yaml:"latest_key_vals"  json:"latest_key_vals"`
}

type DeployServiceModule

type DeployServiceModule struct {
	ServiceModule string `bson:"service_module"                   json:"service_module"                      yaml:"service_module"`
	Image         string `bson:"image"                            json:"image"                               yaml:"image"`
	ImageName     string `bson:"image_name"                       json:"image_name"                          yaml:"image_name"`
}

type DeployTargets

type DeployTargets struct {
	// workload_type/workload_name/container_name.
	Target    string `bson:"target"           json:"target"            yaml:"target"`
	Image     string `bson:"image,omitempty"  json:"image,omitempty"   yaml:"image,omitempty"`
	ImageName string `bson:"image_name,omitempty"  json:"image_name,omitempty"   yaml:"image_name,omitempty"`
}

type DeployVariableConfig added in v2.3.0

type DeployVariableConfig struct {
	VariableKey       string `bson:"variable_key"                     json:"variable_key"                        yaml:"variable_key"`
	UseGlobalVariable bool   `bson:"use_global_variable"              json:"use_global_variable"                 yaml:"use_global_variable"`
}

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 DindCfg

type DindCfg struct {
	Replicas  int          `json:"replicas"   bson:"replicas"`
	Resources *Resources   `json:"resources"  bson:"resources"`
	Storage   *DindStorage `json:"storage"    bson:"storage"`
}

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"`
	Cron           string             `bson:"cron"                json:"cron"`
	CronEnabled    bool               `bson:"cron_enabled"        json:"cron_enabled"`
}

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 DindStorage

type DindStorage struct {
	Type             DindStorageType `json:"type"                bson:"type"`
	StorageClass     string          `json:"storage_class"       bson:"storage_class"`
	StorageSizeInGiB int64           `json:"storage_size_in_gib" bson:"storage_size_in_gib"`
}

type DindStorageType

type DindStorageType string
const (
	DindStorageRootfs  DindStorageType = "rootfs"
	DindStorageDynamic DindStorageType = "dynamic"
)

type DingTalkApproval

type DingTalkApproval struct {
	Timeout int `bson:"timeout"                     yaml:"timeout"                    json:"timeout"`
	// ID: dintalk im app mongodb id
	ID string `bson:"approval_id"                 yaml:"approval_id"                json:"approval_id"`
	// DefaultApprovalInitiator if not set, use workflow task creator as approval initiator
	DefaultApprovalInitiator *DingTalkApprovalUser   `bson:"default_approval_initiator" yaml:"default_approval_initiator" json:"default_approval_initiator"`
	ApprovalNodes            []*DingTalkApprovalNode `bson:"approval_nodes"             yaml:"approval_nodes"             json:"approval_nodes"`
	// InstanceCode: dingtalk approval instance code
	InstanceCode string `bson:"instance_code"              yaml:"instance_code"              json:"instance_code"`
}

type DingTalkApprovalNode

type DingTalkApprovalNode struct {
	ApproveUsers    []*DingTalkApprovalUser `bson:"approve_users"               yaml:"approve_users"              json:"approve_users"`
	Type            dingtalk.ApprovalAction `bson:"type"                        yaml:"type"                       json:"type"`
	RejectOrApprove config.ApproveOrReject  `bson:"reject_or_approve"           yaml:"-"                          json:"reject_or_approve"`
}

type DingTalkApprovalUser

type DingTalkApprovalUser struct {
	ID              string                 `bson:"id"                          yaml:"id"                         json:"id"`
	Name            string                 `bson:"name"                        yaml:"name"                       json:"name"`
	Avatar          string                 `bson:"avatar"                      yaml:"avatar"                     json:"avatar"`
	RejectOrApprove config.ApproveOrReject `bson:"reject_or_approve,omitempty"           yaml:"-"                          json:"reject_or_approve,omitempty"`
	Comment         string                 `bson:"comment,omitempty"                     yaml:"-"                          json:"comment,omitempty"`
	OperationTime   int64                  `bson:"operation_time,omitempty"              yaml:"-"                          json:"operation_time,omitempty"`
}

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 DistributeTarget

type DistributeTarget struct {
	ServiceName   string `bson:"service_name"              yaml:"service_name"               json:"service_name"`
	ServiceModule string `bson:"service_module"            yaml:"service_module"             json:"service_module"`
	SourceTag     string `bson:"source_tag,omitempty"      yaml:"source_tag,omitempty"       json:"source_tag,omitempty"`
	TargetTag     string `bson:"target_tag,omitempty"      yaml:"target_tag,omitempty"       json:"target_tag,omitempty"`
	ImageName     string `bson:"image_name,omitempty"      yaml:"image_name,omitempty"       json:"image_name,omitempty"`
	SourceImage   string `bson:"source_image,omitempty"    yaml:"source_image,omitempty"     json:"source_image,omitempty"`
	TargetImage   string `bson:"target_image,omitempty"    yaml:"target_image,omitempty"     json:"target_image,omitempty"`
	// if UpdateTag was false, use SourceTag as TargetTag.
	UpdateTag bool `bson:"update_tag"                yaml:"update_tag"                json:"update_tag"`
}

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 DockerfileTemplate

type DockerfileTemplate struct {
	ID      primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Name    string             `bson:"name"          json:"name"`
	Content string             `bson:"content"       json:"content"`
}

func (DockerfileTemplate) TableName

func (DockerfileTemplate) TableName() string

type Env

type Env struct {
	Name  string `bson:"name"             json:"name"             yaml:"name"`
	Value string `bson:"value"            json:"value"            yaml:"value"`
}

type EnvArgs

type EnvArgs struct {
	Name        string `bson:"name"                    json:"name"`
	ProductName string `bson:"product_name"            json:"product_name"`
	EnvName     string `bson:"env_name"                json:"env_name"`
	Production  bool   `bson:"production"              json:"production"`
}

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 EnvResource

type EnvResource struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"             json:"id,omitempty"`
	Type           string             `bson:"type"                      json:"type"`
	ProductName    string             `bson:"product_name"              json:"product_name"`
	CreateTime     int64              `bson:"create_time"               json:"create_time"`
	UpdateUserName string             `bson:"update_user_name"          json:"update_user_name"`
	DeletedAt      int64              `bson:"deleted_at"                json:"deleted_at" `
	Namespace      string             `bson:"namespace,omitempty"       json:"namespace,omitempty"`
	EnvName        string             `bson:"env_name"                  json:"env_name"`
	Name           string             `bson:"name"                      json:"name"`
	YamlData       string             `bson:"yaml_data"                 json:"yaml_data"`
	SourceDetail   *CreateFromRepo    `bson:"source_detail"             json:"source_detail"`
	AutoSync       bool               `bson:"auto_sync"                 json:"auto_sync"`
}

func (EnvResource) TableName

func (EnvResource) TableName() string

type EnvServiceVersion

type EnvServiceVersion struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"             json:"id,omitempty"`
	ProductName string             `bson:"product_name"              json:"product_name"`
	EnvName     string             `bson:"env_name"                  json:"env_name"`
	Namespace   string             `bson:"namespace"                 json:"namespace"`
	Production  bool               `bson:"production"                json:"production"`
	Revision    int64              `bson:"revision"                  json:"revision"`
	Service     *ProductService    `bson:"service"                   json:"service"`
	// env global variables
	// GlobalValues for helm projects
	DefaultValues string                     `bson:"default_values,omitempty"       json:"default_values,omitempty"`
	YamlData      *templatemodels.CustomYaml `bson:"yaml_data,omitempty"            json:"yaml_data,omitempty"`
	// GlobalValues for k8s projects
	GlobalVariables []*commontypes.GlobalVariableKV `bson:"global_variables,omitempty"     json:"global_variables,omitempty"`
	CreateBy        string                          `bson:"create_by"                 json:"create_by"`
	CreateTime      int64                           `bson:"create_time"               json:"create_time"`
	UpdateTime      int64                           `bson:"update_time"               json:"update_time"`
}

func (EnvServiceVersion) TableName

func (EnvServiceVersion) TableName() string

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"`
	PmInfo  *PmInfo `bson:"-"                           json:"pm_info"`
}

type EnvSvcDepend

type EnvSvcDepend struct {
	ID            primitive.ObjectID `bson:"_id,omitempty"             json:"id,omitempty"`
	ProductName   string             `bson:"product_name"              json:"product_name"`
	Namespace     string             `bson:"namespace,omitempty"       json:"namespace,omitempty"`
	EnvName       string             `bson:"env_name"                  json:"env_name"`
	ServiceName   string             `bson:"service_name"              json:"service_name"`
	ServiceModule string             `bson:"service_module"            json:"service_module"`
	WorkloadType  string             `bson:"workload_type"             json:"workload_type"`
	Pvcs          []string           `bson:"pvcs"                      json:"pvcs"`
	ConfigMaps    []string           `bson:"configmaps"                json:"configmaps"`
	Secrets       []string           `bson:"secrets"                   json:"secrets"`
	CreateTime    int64              `bson:"create_time"               json:"create_time"`
}

func (EnvSvcDepend) TableName

func (EnvSvcDepend) TableName() string

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 Event

type Event struct {
	EventType string `bson:"event_type"             json:"event_type"            yaml:"event_type"`
	Time      string `bson:"time"                   json:"time"                  yaml:"time"`
	Message   string `bson:"message"                json:"message"               yaml:"message"`
}

type Events

type Events []*Event

func (*Events) Error

func (e *Events) Error(message string)

func (*Events) Info

func (e *Events) Info(message string)

type ExtensionStage

type ExtensionStage struct {
	Enabled    bool      `bson:"enabled"              json:"enabled"`
	URL        string    `bson:"url"                  json:"url"`
	Path       string    `bson:"path"                 json:"path"`
	IsCallback bool      `bson:"is_callback"          json:"is_callback"`
	Timeout    int       `bson:"timeout"              json:"timeout"`
	Headers    []*KeyVal `bson:"headers"              json:"headers"`
}
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

func (ExternalLink) TableName() string

type ExternalParamMapping

type ExternalParamMapping struct {
	// zadig变量名称
	ParamKey string `bson:"param_key" json:"param_key"`
	// 返回中的key的位置
	ResponseKey string `bson:"response_key" json:"response_key"`
	Display     bool   `bson:"display"      json:"display"`
}

type ExternalSetting

type ExternalSetting struct {
	SystemID string                  `bson:"system_id" json:"system_id"`
	Endpoint string                  `bson:"endpoint" json:"endpoint"`
	Method   string                  `bson:"method" json:"method"`
	Headers  []*KV                   `bson:"headers" json:"headers"`
	Body     string                  `bson:"body" json:"body"`
	Params   []*ExternalParamMapping `bson:"params" json:"params"`
}

type ExternalSystem

type ExternalSystem struct {
	ID      primitive.ObjectID `bson:"_id,omitempty"`
	Name    string             `bson:"name"`
	Server  string             `bson:"server"`
	Headers []*util.KeyValue   `bson:"headers"`
	//@2023-04-14 APIToken is deprecated after 1.4.0-ee
	APIToken string `bson:"api_token"`
}

func (ExternalSystem) TableName

func (ExternalSystem) 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 FreestyleJobSpec

type FreestyleJobSpec struct {
	Properties *JobProperties `bson:"properties"     yaml:"properties"    json:"properties"`
	Steps      []*Step        `bson:"steps"          yaml:"steps"         json:"steps"`
	Outputs    []*Output      `bson:"outputs"        yaml:"outputs"       json:"outputs"`
}

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 GeneralHook

type GeneralHook struct {
	Name        string      `bson:"name" json:"name"`
	Enabled     bool        `bson:"enabled" json:"enabled"`
	Description string      `bson:"description" json:"description"`
	WorkflowArg *WorkflowV4 `bson:"workflow_arg" json:"workflow_arg"`
}

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"`
	IsManual     bool     `bson:"is_manual"                json:"is_manual"`
}

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 GrafanaAlert

type GrafanaAlert struct {
	ID     string `bson:"id" json:"id" yaml:"id"`
	Name   string `bson:"name" json:"name" yaml:"name"`
	Status string `bson:"status,omitempty" json:"status,omitempty" yaml:"status,omitempty"`
	Url    string `bson:"url,omitempty" json:"url,omitempty" yaml:"url,omitempty"`
}

type GrafanaJobSpec

type GrafanaJobSpec struct {
	ID   string `bson:"id" json:"id" yaml:"id"`
	Name string `bson:"name" json:"name" yaml:"name"`
	// CheckTime minute
	CheckTime int64           `bson:"check_time" json:"check_time" yaml:"check_time"`
	CheckMode string          `bson:"check_mode" json:"check_mode" yaml:"check_mode"`
	Alerts    []*GrafanaAlert `bson:"alerts" json:"alerts" yaml:"alerts"`
}

type GrayReleaseJobSpec

type GrayReleaseJobSpec struct {
	ClusterID        string `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace        string `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	DockerRegistryID string `bson:"docker_registry_id"     json:"docker_registry_id"    yaml:"docker_registry_id"`
	FromJob          string `bson:"from_job"               json:"from_job"              yaml:"from_job"`
	// unit is minute.
	DeployTimeout int64                `bson:"deploy_timeout"         json:"deploy_timeout"        yaml:"deploy_timeout"`
	GrayScale     int                  `bson:"gray_scale"             json:"gray_scale"            yaml:"gray_scale"`
	Targets       []*GrayReleaseTarget `bson:"targets"                json:"targets"               yaml:"targets"`
	TargetOptions []*GrayReleaseTarget `bson:"-"                      json:"target_options"        yaml:"target_options"`
}

type GrayReleaseTarget

type GrayReleaseTarget struct {
	WorkloadType  string `bson:"workload_type"             json:"workload_type"            yaml:"workload_type"`
	WorkloadName  string `bson:"workload_name"             json:"workload_name"            yaml:"workload_name"`
	Replica       int    `bson:"replica,omitempty"         json:"replica,omitempty"        yaml:"replica,omitempty"`
	ContainerName string `bson:"container_name"            json:"container_name"           yaml:"container_name"`
	Image         string `bson:"image,omitempty"           json:"image,omitempty"          yaml:"image,omitempty"`
}

type GrayRollbackJobSpec

type GrayRollbackJobSpec struct {
	ClusterID string `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace string `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	// unit is minute.
	RollbackTimeout int64                 `bson:"rollback_timeout"       json:"rollback_timeout"      yaml:"rollback_timeout"`
	Targets         []*GrayRollbackTarget `bson:"targets"                json:"targets"               yaml:"targets"`
	TargetOptions   []*GrayRollbackTarget `bson:"-"                      json:"target_options"        yaml:"target_options"`
}

type GrayRollbackTarget

type GrayRollbackTarget struct {
	WorkloadType  string `bson:"workload_type"             json:"workload_type"            yaml:"workload_type"`
	WorkloadName  string `bson:"workload_name"             json:"workload_name"            yaml:"workload_name"`
	OriginImage   string `bson:"-"                         json:"origin_image"             yaml:"origin_image,omitempty"`
	OriginReplica int    `bson:"-"                         json:"origin_replica"           yaml:"origin_replica,omitempty"`
}

type GrayscaleStrategyType

type GrayscaleStrategyType string
var (
	GrayscaleStrategyWeight      GrayscaleStrategyType = "weight"
	GrayscaleStrategyHeaderMatch GrayscaleStrategyType = "header_match"
)

type GuanceyunCheckJobSpec

type GuanceyunCheckJobSpec struct {
	ID   string `bson:"id" json:"id" yaml:"id"`
	Name string `bson:"name" json:"name" yaml:"name"`
	// CheckTime minute
	CheckTime int64               `bson:"check_time" json:"check_time" yaml:"check_time"`
	CheckMode string              `bson:"check_mode" json:"check_mode" yaml:"check_mode"`
	Monitors  []*GuanceyunMonitor `bson:"monitors" json:"monitors" yaml:"monitors"`
}

type GuanceyunMonitor

type GuanceyunMonitor struct {
	ID   string `bson:"id" json:"id" yaml:"id"`
	Name string `bson:"name" json:"name" yaml:"name"`
	// Level is the lowest level to trigger alarm
	Level  guanceyun.Level `bson:"level" json:"level" yaml:"level"`
	Status string          `bson:"status,omitempty" json:"status,omitempty" yaml:"status,omitempty"`
	Url    string          `bson:"url,omitempty" json:"url,omitempty" yaml:"url,omitempty"`
}

type HelmChart

type HelmChart struct {
	Name       string `bson:"name"               json:"name"`
	Repo       string `bson:"repo"               json:"repo"`
	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"`
	Projects  []string           `bson:"projects"              json:"projects"`
	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"`
	MergeRequestID string `bson:"merge_request_id" json:"merge_request_id,omitempty"`
	CommitID       string `bson:"commit_id"        json:"commit_id,omitempty"`
	DeliveryID     string `bson:"delivery_id"      json:"delivery_id,omitempty"`
	CodehostID     int    `bson:"codehost_id"      json:"codehost_id"`
	EventType      string `bson:"event_type"       json:"event_type"`
}

type IMApp

type IMApp struct {
	ID         primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Type       string             `json:"type" bson:"type"`
	Name       string             `json:"name" bson:"name"`
	UpdateTime int64              `json:"update_time" bson:"update_time"`

	// Lark fields
	AppID      string `json:"app_id" bson:"app_id"`
	AppSecret  string `json:"app_secret" bson:"app_secret"`
	EncryptKey string `json:"encrypt_key" bson:"encrypt_key"`
	// Deprecated: use LarkApprovalCodeList instead
	LarkDefaultApprovalCode string `json:"-" bson:"lark_default_approval_code"`
	// LarkApprovalCodeList is a json string save all approval definition code
	LarkApprovalCodeList map[string]string `json:"-" bson:"lark_approval_code_list"`
	// LarkApprovalCodeListCommon is used for any source approval
	// because LarkApprovalCodeList title is fixed "Zadig 工作流", so we need a common approval code list
	LarkApprovalCodeListCommon map[string]string `json:"-" bson:"lark_approval_code_list_common"`

	// DingTalk fields
	DingTalkAppKey                  string `json:"dingtalk_app_key" bson:"dingtalk_app_key"`
	DingTalkAppSecret               string `json:"dingtalk_app_secret" bson:"dingtalk_app_secret"`
	DingTalkAesKey                  string `json:"dingtalk_aes_key" bson:"dingtalk_aes_key"`
	DingTalkToken                   string `json:"dingtalk_token" bson:"dingtalk_token"`
	DingTalkDefaultApprovalFormCode string `json:"-" bson:"dingtalk_default_approval_form_code"`
}

func (IMApp) TableName

func (IMApp) TableName() string

type ImageAndServiceModule

type ImageAndServiceModule struct {
	ServiceModule string `bson:"service_module"                     json:"service_module"                        yaml:"service_module"`
	Image         string `bson:"image"                              json:"image"                                 yaml:"image"`
}

type ImageData

type ImageData struct {
	ImageUrl   string `bson:"image_url"   json:"image_url"`
	ImageName  string `bson:"image_name"  json:"image_name"`
	ImageTag   string `bson:"image_tag"   json:"image_tag"`
	CustomTag  string `bson:"custom_tag"  json:"custom_tag"`
	RegistryID string `bson:"registry_id" json:"registry_id"`
}

type ImagePathSpec

type ImagePathSpec struct {
	Repo      string `bson:"repo,omitempty"           json:"repo,omitempty"`
	Namespace string `bson:"namespace,omitempty"      json:"namespace,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 ImageTag

type ImageTag struct {
	TagName string `bson:"tag_name" json:"tag_name"`
	Digest  string `bson:"digest" json:"digest"`
	Created string `bson:"created" json:"created"`
}

type ImageTags

type ImageTags struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	RegistryID  string             `bson:"registry_id" json:"registry_id"`
	RegProvider string             `bson:"reg_provider" json:"reg_provider"`
	ImageName   string             `bson:"image_name" json:"image_name"`
	Namespace   string             `bson:"namespace" json:"namespace"`
	ImageTags   []*ImageTag        `bson:"image_tags" json:"image_tags"`
}

func (ImageTags) TableName

func (ImageTags) TableName() string

type ImagesByService

type ImagesByService struct {
	ServiceName string       `bson:"service_name" json:"service_name"`
	Images      []*ImageData `bson:"images" json:"images"`
}

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 IssueID

type IssueID struct {
	Key    string `bson:"key" json:"key" yaml:"key"`
	Name   string `bson:"name" json:"name" yaml:"name"`
	Status string `bson:"status,omitempty" json:"status,omitempty" yaml:"status,omitempty"`
	Link   string `bson:"link,omitempty" json:"link,omitempty" yaml:"link,omitempty"`
}

type IstioGrayscale

type IstioGrayscale struct {
	Enable             bool                     `bson:"enable"   json:"enable"`
	IsBase             bool                     `bson:"is_base"  json:"is_base"`
	BaseEnv            string                   `bson:"base_env" json:"base_env"`
	GrayscaleStrategy  GrayscaleStrategyType    `bson:"grayscale_strategy" json:"grayscale_strategy"`
	WeightConfigs      []IstioWeightConfig      `bson:"weight_configs" json:"weight_configs"`
	HeaderMatchConfigs []IstioHeaderMatchConfig `bson:"header_match_configs" json:"header_match_configs"`
}

type IstioHeaderMatch

type IstioHeaderMatch struct {
	Key   string          `bson:"key"   json:"key"    yaml:"key"`
	Match StringMatchType `bson:"match" json:"match"  yaml:"match"`
	Value string          `bson:"value" json:"value"  yaml:"value"`
}

type IstioHeaderMatchConfig

type IstioHeaderMatchConfig struct {
	Env          string             `bson:"env"          json:"env"            yaml:"env"`
	HeaderMatchs []IstioHeaderMatch `bson:"header_match" json:"header_match"   yaml:"header_match"`
}

type IstioJobSpec

type IstioJobSpec struct {
	First             bool              `bson:"first"              json:"first"              yaml:"first"`
	ClusterID         string            `bson:"cluster_id"         json:"cluster_id"         yaml:"cluster_id"`
	FromJob           string            `bson:"from_job"           json:"from_job"           yaml:"from_job"`
	RegistryID        string            `bson:"registry_id"        json:"registry_id"        yaml:"registry_id"`
	Namespace         string            `bson:"namespace"          json:"namespace"          yaml:"namespace"`
	Timeout           int64             `bson:"timeout"            json:"timeout"            yaml:"timeout"`
	ReplicaPercentage int64             `bson:"replica_percentage" json:"replica_percentage" yaml:"replica_percentage"`
	Weight            int64             `bson:"weight"             json:"weight"             yaml:"weight"`
	Targets           []*IstioJobTarget `bson:"targets"            json:"targets"            yaml:"targets"`
	TargetOptions     []*IstioJobTarget `bson:"-"                  json:"target_options"     yaml:"target_options"`
}

type IstioJobTarget

type IstioJobTarget struct {
	WorkloadName       string `bson:"workload_name"             json:"workload_name"             yaml:"workload_name"`
	ContainerName      string `bson:"container_name"            json:"container_name"            yaml:"container_name"`
	VirtualServiceName string `bson:"virtual_service_name"      json:"virtual_service_name"      yaml:"virtual_service_name"`
	Host               string `bson:"host"                      json:"host"                      yaml:"host"`
	Image              string `bson:"image"                     json:"image"                     yaml:"image,omitempty"`
	CurrentReplica     int    `bson:"current_replica,omitempty" json:"current_replica,omitempty" yaml:"current_replica,omitempty"`
	TargetReplica      int    `bson:"target_replica,omitempty"  json:"target_replica,omitempty"  yaml:"target_replica,omitempty"`
}

type IstioRollBackJobSpec

type IstioRollBackJobSpec struct {
	ClusterID     string            `bson:"cluster_id"  json:"cluster_id"     yaml:"cluster_id"`
	Namespace     string            `bson:"namespace"   json:"namespace"      yaml:"namespace"`
	Timeout       int64             `bson:"timeout"     json:"timeout"        yaml:"timeout"`
	Targets       []*IstioJobTarget `bson:"targets"     json:"targets"        yaml:"targets"`
	TargetOptions []*IstioJobTarget `bson:"-"           json:"target_options" yaml:"target_options"`
}

type IstioWeightConfig

type IstioWeightConfig struct {
	Env    string `bson:"env"    json:"env"    yaml:"env"`
	Weight int32  `bson:"weight" json:"weight" yaml:"weight"`
}

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 {
	JenkinsID         string                     `bson:"jenkins_id"          json:"jenkins_id"`
	JobName           string                     `bson:"job_name"            json:"job_name"`
	JenkinsBuildParam []*types.JenkinsBuildParam `bson:"jenkins_build_param" json:"jenkins_build_params"`
}

type JenkinsBuildArgs

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

type JenkinsBuildConfig

type JenkinsBuildConfig struct {
	JenkinsBuildImage string
}

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 JenkinsJobInfo

type JenkinsJobInfo struct {
	JobName    string                 `bson:"job_name" json:"job_name" yaml:"job_name"`
	Parameters []*JenkinsJobParameter `bson:"parameters" json:"parameters" yaml:"parameters"`
}

type JenkinsJobParameter

type JenkinsJobParameter struct {
	Name    string           `bson:"name" json:"name" yaml:"name"`
	Value   string           `bson:"value" json:"value" yaml:"value"`
	Type    config.ParamType `bson:"type" json:"type" yaml:"type"`
	Choices []string         `bson:"choices,omitempty" json:"choices,omitempty" yaml:"choices,omitempty"`
	Source  string           `bson:"source" json:"source" yaml:"source"`
}

type JenkinsJobSpec

type JenkinsJobSpec struct {
	ID   string            `bson:"id" json:"id" yaml:"id"`
	Jobs []*JenkinsJobInfo `bson:"jobs" json:"jobs" yaml:"jobs"`
}

type JiraHook

type JiraHook struct {
	Name        string      `bson:"name" json:"name"`
	Enabled     bool        `bson:"enabled" json:"enabled"`
	Description string      `bson:"description" json:"description"`
	WorkflowArg *WorkflowV4 `bson:"workflow_arg" json:"workflow_arg"`
}

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 JiraJobSpec

type JiraJobSpec struct {
	ProjectID          string `bson:"project_id"  json:"project_id"  yaml:"project_id"`
	JiraID             string `bson:"jira_id" json:"jira_id" yaml:"jira_id"`
	JiraSystemIdentity string `bson:"jira_system_identity" json:"jira_system_identity" yaml:"jira_system_identity"`
	JiraURL            string `bson:"jira_url" json:"jira_url" yaml:"jira_url"`
	// QueryType: "" means common, "advanced" means use custom jql
	QueryType string `bson:"query_type" json:"query_type" yaml:"query_type"`
	// JQL: when query type is advanced, use this
	JQL string `bson:"jql" json:"jql" yaml:"jql"`

	IssueType    string     `bson:"issue_type"  json:"issue_type"  yaml:"issue_type"`
	Issues       []*IssueID `bson:"issues" json:"issues" yaml:"issues"`
	TargetStatus string     `bson:"target_status" json:"target_status" yaml:"target_status"`
	Source       string     `bson:"source" json:"source" yaml:"source"`
}

type Job

type Job struct {
	Name    string         `bson:"name"           yaml:"name"     json:"name"`
	JobType config.JobType `bson:"type"           yaml:"type"     json:"type"`
	// only for webhook workflow args to skip some tasks.
	Skipped        bool                     `bson:"skipped"        yaml:"skipped"    json:"skipped"`
	Spec           interface{}              `bson:"spec"           yaml:"spec"       json:"spec"`
	RunPolicy      config.JobRunPolicy      `bson:"run_policy"     yaml:"run_policy" json:"run_policy"`
	ServiceModules []*WorkflowServiceModule `bson:"service_modules"                  json:"service_modules"`
}

type JobInfo

type JobInfo struct {
	ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	// job type, this should be same as the job's type with some exceptions:
	Type string `bson:"type" json:"type"`
	// ProductName, WorkflowName, WorkflowDisplayName and TaskID marks the belongings of this job
	WorkflowName        string `bson:"workflow_name" json:"workflow_name"`
	WorkflowDisplayName string `bson:"workflow_display_name" json:"workflow_display_name"`
	TaskID              int64  `bson:"task_id" json:"task_id"`
	ProductName         string `bson:"product_name" json:"product_name"`
	// Status, StartTime, EndTime and Duration: basic information about the job
	Status    string `bson:"status" json:"status"`
	StartTime int64  `bson:"start_time" json:"start_time"`
	EndTime   int64  `bson:"end_time" json:"end_time"`
	Duration  int64  `bson:"duration" json:"duration"`
	// ServiceType, ServiceName and ServiceModule are used exclusively for build & deploy jobs
	ServiceType   string `bson:"service_type" json:"service_type"`
	ServiceName   string `bson:"service_name" json:"service_name"`
	ServiceModule string `bson:"service_module" json:"service_module"`
	// Production marks if this job is used for production environment
	// for now, this is only used for deploy jobs
	Production bool `bson:"production" json:"production"`
	// TargetEnv is the target environment for the deploy job
	TargetEnv string `bson:"target_env" json:"target_env"`
}

func (JobInfo) TableName

func (JobInfo) TableName() string

type JobIstioReleaseSpec

type JobIstioReleaseSpec struct {
	FirstJob          bool            `bson:"first_job"          json:"first_job"          yaml:"first_job"`
	Timeout           int64           `bson:"timeout"            json:"timeout"            yaml:"timeout"`
	ClusterID         string          `bson:"cluster_id"         json:"cluster_id"         yaml:"cluster_id"`
	ClusterName       string          `bson:"cluster_name"       json:"cluster_name"       yaml:"cluster_name"`
	Namespace         string          `bson:"namespace"          json:"namespace"          yaml:"namespace"`
	Weight            int64           `bson:"weight"             json:"weight"             yaml:"weight"`
	ReplicaPercentage int64           `bson:"replica_percentage" json:"replica_percentage" yaml:"replica_percentage"`
	Replicas          int64           `bson:"replicas"           json:"replicas"           yaml:"replicas"`
	Targets           *IstioJobTarget `bson:"targets"            json:"targets"            yaml:"targets"`
	Event             []*Event        `bson:"event"              json:"event"              yaml:"event"`
}

type JobIstioRollbackSpec

type JobIstioRollbackSpec struct {
	Namespace   string          `json:"namespace"    bson:"namespace"    yaml:"namespace"`
	ClusterID   string          `json:"cluster_id"   bson:"cluster_id"   yaml:"cluster_id"`
	ClusterName string          `json:"cluster_name" bson:"cluster_name" yaml:"cluster_name"`
	Image       string          `json:"image"        bson:"image"        yaml:"image"`
	Replicas    int             `json:"replicas"     bson:"replicas"     yaml:"replicas"`
	Targets     *IstioJobTarget `json:"targets"      bson:"targets"      yaml:"targets"`
	Timeout     int64           `json:"timeout"      bson:"timeout"      yaml:"timeout"`
}

type JobPreview

type JobPreview struct {
	Name           string                   `bson:"name"                json:"name"`
	JobType        string                   `bson:"type"                json:"type"`
	Status         config.Status            `bson:"status"              json:"status"`
	StartTime      int64                    `bson:"start_time"          json:"start_time,omitempty"`
	EndTime        int64                    `bson:"end_time"            json:"end_time,omitempty"`
	Error          string                   `bson:"error"               json:"error"`
	Timeout        int64                    `bson:"timeout"             json:"timeout"`
	Retry          int64                    `bson:"retry"               json:"retry"`
	ServiceModules []*WorkflowServiceModule `bson:"-"                   json:"service_modules"`
	TestModules    []*WorkflowTestModule    `bson:"-"                   json:"test_modules"`
	Envs           *WorkflowEnv             `bson:"-"                   json:"envs"`
}

type JobProperties

type JobProperties struct {
	Timeout         int64               `bson:"timeout"                json:"timeout"               yaml:"timeout"`
	Retry           int64               `bson:"retry"                  json:"retry"                 yaml:"retry"`
	ResourceRequest setting.Request     `bson:"res_req"                json:"res_req"               yaml:"res_req"`
	ResReqSpec      setting.RequestSpec `bson:"res_req_spec"           json:"res_req_spec"          yaml:"res_req_spec"`
	Infrastructure  string              `bson:"infrastructure"         json:"infrastructure"        yaml:"infrastructure"`
	VMLabels        []string            `bson:"vm_labels"              json:"vm_labels"             yaml:"vm_labels"`
	ClusterID       string              `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	StrategyID      string              `bson:"strategy_id"            json:"strategy_id"           yaml:"strategy_id"`
	BuildOS         string              `bson:"build_os"               json:"build_os"              yaml:"build_os,omitempty"`
	ImageFrom       string              `bson:"image_from"             json:"image_from"            yaml:"image_from,omitempty"`
	ImageID         string              `bson:"image_id"               json:"image_id"              yaml:"image_id,omitempty"`
	Namespace       string              `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	Envs            []*KeyVal           `bson:"envs"                   json:"envs"                  yaml:"envs"`
	// log user-defined variables, shows in workflow task detail.
	CustomEnvs          []*KeyVal            `bson:"custom_envs"            json:"custom_envs"           yaml:"custom_envs,omitempty"`
	Params              []*Param             `bson:"params"                 json:"params"                yaml:"params"`
	Paths               string               `bson:"-"                      json:"-"                     yaml:"-"`
	LogFileName         string               `bson:"log_file_name"          json:"log_file_name"         yaml:"log_file_name"`
	DockerHost          string               `bson:"-"                      json:"docker_host,omitempty" yaml:"docker_host,omitempty"`
	Registries          []*RegistryNamespace `bson:"registries"             json:"registries"            yaml:"registries"`
	Cache               types.Cache          `bson:"cache"                  json:"cache"                 yaml:"cache"`
	CacheEnable         bool                 `bson:"cache_enable"           json:"cache_enable"          yaml:"cache_enable"`
	CacheDirType        types.CacheDirType   `bson:"cache_dir_type"         json:"cache_dir_type"        yaml:"cache_dir_type"`
	CacheUserDir        string               `bson:"cache_user_dir"         json:"cache_user_dir"        yaml:"cache_user_dir"`
	ShareStorageInfo    *ShareStorageInfo    `bson:"share_storage_info"     json:"share_storage_info"    yaml:"share_storage_info"`
	ShareStorageDetails []*StorageDetail     `bson:"share_storage_details"  json:"share_storage_details" yaml:"-"`
	UseHostDockerDaemon bool                 `bson:"use_host_docker_daemon,omitempty" json:"use_host_docker_daemon,omitempty" yaml:"use_host_docker_daemon"`
}

type JobTasK8sPatchSpec

type JobTasK8sPatchSpec struct {
	ClusterID  string           `bson:"cluster_id"             json:"cluster_id"             yaml:"cluster_id"`
	Namespace  string           `bson:"namespace"              json:"namespace"              yaml:"namespace"`
	PatchItems []*PatchTaskItem `bson:"patch_items"            json:"patch_items"            yaml:"patch_items"`
}

type JobTask

type JobTask struct {
	ProjectKey  string `bson:"project_key"         json:"project_key"`
	WorkflowKey string `bson:"workflow_key"        json:"workflow_key"`
	Name        string `bson:"name"                json:"name"`
	// jobTask unique id, unique in the workflow
	Key        string `bson:"key"                 json:"key"`
	K8sJobName string `bson:"k8s_job_name"        json:"k8s_job_name"`
	// JobInfo contains the fields that make up the job task name, for frontend display
	JobInfo          interface{}              `bson:"job_info"            json:"job_info"`
	JobType          string                   `bson:"type"                json:"type"`
	Status           config.Status            `bson:"status"              json:"status"`
	StartTime        int64                    `bson:"start_time"          json:"start_time,omitempty"`
	EndTime          int64                    `bson:"end_time"            json:"end_time,omitempty"`
	Error            string                   `bson:"error"               json:"error"`
	Timeout          int64                    `bson:"timeout"             json:"timeout"`
	Retry            int64                    `bson:"retry"               json:"retry"`
	Spec             interface{}              `bson:"spec"                json:"spec"`
	Outputs          []*Output                `bson:"outputs"             json:"outputs"`
	BreakpointBefore bool                     `bson:"breakpoint_before"   json:"breakpoint_before"`
	BreakpointAfter  bool                     `bson:"breakpoint_after"    json:"breakpoint_after"`
	ServiceModules   []*WorkflowServiceModule `bson:"service_modules"     json:"service_modules"`
	Infrastructure   string                   `bson:"infrastructure"      json:"infrastructure"`
	VMLabels         []string                 `bson:"vm_labels"           json:"vm_labels"`
}

type JobTaskApolloNamespace

type JobTaskApolloNamespace struct {
	ApolloNamespace `bson:",inline" json:",inline" yaml:",inline"`
	Error           string `bson:"error" json:"error" yaml:"error"`
}

type JobTaskApolloSpec

type JobTaskApolloSpec struct {
	ApolloID      string                    `bson:"apolloID" json:"apolloID" yaml:"apolloID"`
	NamespaceList []*JobTaskApolloNamespace `bson:"namespaceList" json:"namespaceList" yaml:"namespaceList"`
}

type JobTaskBlueGreenDeploySpec

type JobTaskBlueGreenDeploySpec struct {
	ClusterID        string `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace        string `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	DockerRegistryID string `bson:"docker_registry_id"     json:"docker_registry_id"    yaml:"docker_registry_id"`
	// unit is minute.
	DeployTimeout      int64   `bson:"deploy_timeout"              json:"deploy_timeout"             yaml:"deploy_timeout"`
	K8sServiceName     string  `bson:"k8s_service_name"            json:"k8s_service_name"           yaml:"k8s_service_name"`
	BlueK8sServiceName string  `bson:"blue_k8s_service_name"       json:"blue_k8s_service_name"      yaml:"blue_k8s_service_name"`
	WorkloadType       string  `bson:"workload_type"               json:"workload_type"              yaml:"workload_type"`
	WorkloadName       string  `bson:"workload_name"               json:"workload_name"              yaml:"workload_name"`
	BlueWorkloadName   string  `bson:"blue_workload_name"          json:"blue_workload_name"         yaml:"blue_workload_name"`
	ContainerName      string  `bson:"container_name"              json:"container_name"             yaml:"container_name"`
	Version            string  `bson:"version"                     json:"version"                    yaml:"version"`
	Image              string  `bson:"image"                       json:"image"                      yaml:"image"`
	FirstDeploy        bool    `bson:"first_deploy"                json:"first_deploy"               yaml:"first_deploy"`
	Events             *Events `bson:"events"                      json:"events"                     yaml:"events"`
}

type JobTaskBlueGreenDeployV2Spec

type JobTaskBlueGreenDeployV2Spec struct {
	Production    bool                      `bson:"production"               json:"production"              yaml:"production"`
	Env           string                    `bson:"env"               json:"env"              yaml:"env"`
	Service       *BlueGreenDeployV2Service `bson:"service"                      json:"service"                     yaml:"service"`
	Events        *Events                   `bson:"events"                      json:"events"                     yaml:"events"`
	DeployTimeout int                       `bson:"deploy_timeout"              json:"deploy_timeout"             yaml:"deploy_timeout"`
}

type JobTaskBlueGreenReleaseSpec

type JobTaskBlueGreenReleaseSpec struct {
	ClusterID          string  `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace          string  `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	K8sServiceName     string  `bson:"k8s_service_name"       json:"k8s_service_name"      yaml:"k8s_service_name"`
	BlueK8sServiceName string  `bson:"blue_k8s_service_name"  json:"blue_k8s_service_name" yaml:"blue_k8s_service_name"`
	WorkloadType       string  `bson:"workload_type"          json:"workload_type"         yaml:"workload_type"`
	WorkloadName       string  `bson:"workload_name"          json:"workload_name"         yaml:"workload_name"`
	BlueWorkloadName   string  `bson:"blue_workload_name"     json:"blue_workload_name"    yaml:"blue_workload_name"`
	Version            string  `bson:"version"                json:"version"               yaml:"version"`
	Image              string  `bson:"image"                  json:"image"                 yaml:"image"`
	ContainerName      string  `bson:"container_name"         json:"container_name"        yaml:"container_name"`
	Events             *Events `bson:"events"                 json:"events"                yaml:"events"`
}

type JobTaskBlueGreenReleaseV2Spec

type JobTaskBlueGreenReleaseV2Spec struct {
	Production    bool                      `bson:"production"               json:"production"              yaml:"production"`
	Env           string                    `bson:"env"               json:"env"              yaml:"env"`
	Namespace     string                    `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	Service       *BlueGreenDeployV2Service `bson:"service"                      json:"service"                     yaml:"service"`
	Events        *Events                   `bson:"events"                 json:"events"                yaml:"events"`
	DeployTimeout int                       `bson:"deploy_timeout"              json:"deploy_timeout"             yaml:"deploy_timeout"`
}

type JobTaskCanaryDeploySpec

type JobTaskCanaryDeploySpec struct {
	ClusterID        string `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace        string `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	DockerRegistryID string `bson:"docker_registry_id"     json:"docker_registry_id"    yaml:"docker_registry_id"`
	// unit is minute.
	DeployTimeout      int64   `bson:"deploy_timeout"                 json:"deploy_timeout"                yaml:"deploy_timeout"`
	K8sServiceName     string  `bson:"k8s_service_name"               json:"k8s_service_name"              yaml:"k8s_service_name"`
	WorkloadType       string  `bson:"workload_type"                  json:"workload_type"                 yaml:"workload_type"`
	WorkloadName       string  `bson:"workload_name"                  json:"workload_name"                 yaml:"workload_name"`
	ContainerName      string  `bson:"container_name"                 json:"container_name"                yaml:"container_name"`
	CanaryPercentage   int     `bson:"canary_percentage"              json:"canary_percentage"             yaml:"canary_percentage"`
	CanaryReplica      int     `bson:"canary_replica"                 json:"canary_replica"                yaml:"canary_replica"`
	CanaryWorkloadName string  `bson:"canary_workload_name"           json:"canary_workload_name"          yaml:"canary_workload_name"`
	Version            string  `bson:"version"                        json:"version"                       yaml:"version"`
	Image              string  `bson:"image"                          json:"image"                         yaml:"image"`
	Events             *Events `bson:"events"                         json:"events"                        yaml:"events"`
}

type JobTaskCanaryReleaseSpec

type JobTaskCanaryReleaseSpec struct {
	ClusterID          string `bson:"cluster_id"             json:"cluster_id"             yaml:"cluster_id"`
	Namespace          string `bson:"namespace"              json:"namespace"              yaml:"namespace"`
	K8sServiceName     string `bson:"k8s_service_name"       json:"k8s_service_name"       yaml:"k8s_service_name"`
	WorkloadType       string `bson:"workload_type"          json:"workload_type"          yaml:"workload_type"`
	WorkloadName       string `bson:"workload_name"          json:"workload_name"          yaml:"workload_name"`
	ContainerName      string `bson:"container_name"         json:"container_name"         yaml:"container_name"`
	Version            string `bson:"version"                json:"version"                yaml:"version"`
	Image              string `bson:"image"                  json:"image"                  yaml:"image"`
	CanaryWorkloadName string `bson:"canary_workload_name"   json:"canary_workload_name"   yaml:"canary_workload_name"`
	// unit is minute.
	ReleaseTimeout int64   `bson:"release_timeout"        json:"release_timeout"       yaml:"release_timeout"`
	Events         *Events `bson:"events"                 json:"events"                yaml:"events"`
}

type JobTaskCustomDeploySpec

type JobTaskCustomDeploySpec struct {
	Namespace          string     `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	ClusterID          string     `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Timeout            int64      `bson:"timeout"                json:"timeout"               yaml:"timeout"`
	WorkloadType       string     `bson:"workload_type"          json:"workload_type"         yaml:"workload_type"`
	WorkloadName       string     `bson:"workload_name"          json:"workload_name"         yaml:"workload_name"`
	ContainerName      string     `bson:"container_name"         json:"container_name"        yaml:"container_name"`
	Image              string     `bson:"image"                  json:"image"                 yaml:"image"`
	SkipCheckRunStatus bool       `bson:"skip_check_run_status"  json:"skip_check_run_status" yaml:"skip_check_run_status"`
	ReplaceResources   []Resource `bson:"replace_resources"      json:"replace_resources"     yaml:"replace_resources"`
}

type JobTaskDeploySpec

type JobTaskDeploySpec struct {
	Env                string                          `bson:"env"                              json:"env"                                 yaml:"env"`
	ServiceName        string                          `bson:"service_name"                     json:"service_name"                        yaml:"service_name"`
	Production         bool                            `bson:"production"                       json:"production"                          yaml:"production"`
	DeployContents     []config.DeployContent          `bson:"deploy_contents"                  json:"deploy_contents"                     yaml:"deploy_contents"`
	KeyVals            []*ServiceKeyVal                `bson:"key_vals"                         json:"key_vals"                            yaml:"key_vals"`         // deprecated since 1.18.0
	VariableConfigs    []*DeployVariableConfig         `bson:"variable_configs"                 json:"variable_configs"                    yaml:"variable_configs"` // new since 1.18.0, only used for k8s
	VariableKVs        []*commontypes.RenderVariableKV `bson:"variable_kvs"                     json:"variable_kvs"                        yaml:"variable_kvs"`     // new since 1.18.0, only used for k8s
	UpdateConfig       bool                            `bson:"update_config"                    json:"update_config"                       yaml:"update_config"`
	YamlContent        string                          `bson:"yaml_content"                     json:"yaml_content"                        yaml:"yaml_content"`
	ServiceAndImages   []*DeployServiceModule          `bson:"service_and_images"               json:"service_and_images"                  yaml:"service_and_images"`
	ServiceType        string                          `bson:"service_type"                     json:"service_type"                        yaml:"service_type"`
	CreateEnvType      string                          `bson:"env_type"                         json:"env_type"                            yaml:"env_type"`
	SkipCheckRunStatus bool                            `bson:"skip_check_run_status"            json:"skip_check_run_status"               yaml:"skip_check_run_status"`
	ClusterID          string                          `bson:"cluster_id"                       json:"cluster_id"                          yaml:"cluster_id"`
	Timeout            int                             `bson:"timeout"                          json:"timeout"                             yaml:"timeout"`
	ReplaceResources   []Resource                      `bson:"replace_resources"                json:"replace_resources"                   yaml:"replace_resources"`
	RelatedPodLabels   []map[string]string             `bson:"-"                                json:"-"                                   yaml:"-"`
	// for compatibility
	ServiceModule string `bson:"service_module"                   json:"service_module"                      yaml:"-"`
	Image         string `bson:"image"                            json:"image"                               yaml:"-"`
}

type JobTaskFreestyleSpec

type JobTaskFreestyleSpec struct {
	Properties JobProperties `bson:"properties"          json:"properties"        yaml:"properties"`
	Steps      []*StepTask   `bson:"steps"               json:"steps"             yaml:"steps"`
}

type JobTaskGrafanaSpec

type JobTaskGrafanaSpec struct {
	ID   string `bson:"id" json:"id" yaml:"id"`
	Name string `bson:"name" json:"name" yaml:"name"`
	// CheckTime minute
	CheckTime int64           `bson:"check_time" json:"check_time" yaml:"check_time"`
	CheckMode string          `bson:"check_mode" json:"check_mode" yaml:"check_mode"`
	Alerts    []*GrafanaAlert `bson:"alerts" json:"alerts" yaml:"alerts"`
}

type JobTaskGrayReleaseSpec

type JobTaskGrayReleaseSpec struct {
	ClusterID        string `bson:"cluster_id"             json:"cluster_id"             yaml:"cluster_id"`
	ClusterName      string `bson:"cluster_name"           json:"cluster_name"           yaml:"cluster_name"`
	Namespace        string `bson:"namespace"              json:"namespace"              yaml:"namespace"`
	WorkloadType     string `bson:"workload_type"          json:"workload_type"          yaml:"workload_type"`
	WorkloadName     string `bson:"workload_name"          json:"workload_name"          yaml:"workload_name"`
	ContainerName    string `bson:"container_name"         json:"container_name"         yaml:"container_name"`
	FirstJob         bool   `bson:"first_job"              json:"first_job"              yaml:"first_job"`
	Image            string `bson:"image"                  json:"image"                  yaml:"image"`
	GrayWorkloadName string `bson:"gray_workload_name"     json:"gray_workload_name"     yaml:"gray_workload_name"`
	// unit is minute.
	DeployTimeout int64   `bson:"deploy_timeout"        json:"deploy_timeout"       yaml:"deploy_timeout"`
	GrayScale     int     `bson:"gray_scale"            json:"gray_scale"           yaml:"gray_scale"`
	TotalReplica  int     `bson:"total_replica"         json:"total_replica"        yaml:"total_replica"`
	GrayReplica   int     `bson:"gray_replica"          json:"gray_replica"         yaml:"gray_replica"`
	Events        *Events `bson:"events"                json:"events"               yaml:"events"`
}

type JobTaskGrayRollbackSpec

type JobTaskGrayRollbackSpec struct {
	ClusterID        string `bson:"cluster_id"             json:"cluster_id"             yaml:"cluster_id"`
	ClusterName      string `bson:"cluster_name"           json:"cluster_name"           yaml:"cluster_name"`
	Namespace        string `bson:"namespace"              json:"namespace"              yaml:"namespace"`
	WorkloadType     string `bson:"workload_type"          json:"workload_type"          yaml:"workload_type"`
	WorkloadName     string `bson:"workload_name"          json:"workload_name"          yaml:"workload_name"`
	ContainerName    string `bson:"container_name"         json:"container_name"         yaml:"container_name"`
	Image            string `bson:"image"                  json:"image"                  yaml:"image"`
	GrayWorkloadName string `bson:"gray_workload_name"     json:"gray_workload_name"     yaml:"gray_workload_name"`
	// unit is minute.
	RollbackTimeout int64   `bson:"rollback_timeout"      json:"rollback_timeout"     yaml:"rollback_timeout"`
	TotalReplica    int     `bson:"total_replica"         json:"total_replica"        yaml:"total_replica"`
	Events          *Events `bson:"events"                json:"events"               yaml:"events"`
}

type JobTaskGuanceyunCheckSpec

type JobTaskGuanceyunCheckSpec struct {
	ID   string `bson:"id" json:"id" yaml:"id"`
	Name string `bson:"name" json:"name" yaml:"name"`
	// CheckTime minute
	CheckTime int64               `bson:"check_time" json:"check_time" yaml:"check_time"`
	CheckMode string              `bson:"check_mode" json:"check_mode" yaml:"check_mode"`
	Monitors  []*GuanceyunMonitor `bson:"monitors" json:"monitors" yaml:"monitors"`
}

type JobTaskHelmChartDeploySpec

type JobTaskHelmChartDeploySpec struct {
	Env                string           `bson:"env"                              json:"env"                                 yaml:"env"`
	DeployHelmChart    *DeployHelmChart `bson:"deploy_helm_chart"       yaml:"deploy_helm_chart"          json:"deploy_helm_chart"`
	SkipCheckRunStatus bool             `bson:"skip_check_run_status"            json:"skip_check_run_status"               yaml:"skip_check_run_status"`
	ClusterID          string           `bson:"cluster_id"                       json:"cluster_id"                          yaml:"cluster_id"`
	Timeout            int              `bson:"timeout"                          json:"timeout"                             yaml:"timeout"`
}

type JobTaskHelmDeploySpec

type JobTaskHelmDeploySpec struct {
	Env            string                 `bson:"env"                              json:"env"                                 yaml:"env"`
	ServiceName    string                 `bson:"service_name"                     json:"service_name"                        yaml:"service_name"`
	ServiceType    string                 `bson:"service_type"                     json:"service_type"                        yaml:"service_type"`
	DeployContents []config.DeployContent `bson:"deploy_contents"                  json:"deploy_contents"                     yaml:"deploy_contents"`
	KeyVals        []*ServiceKeyVal       `bson:"key_vals"                         json:"key_vals"                            yaml:"key_vals"`
	// VariableYaml stores the variable YAML provided by user
	VariableYaml string `bson:"variable_yaml"                    json:"variable_yaml"                       yaml:"variable_yaml"`
	// IsProduction added since 1.18, indicator of production environment deployment job
	IsProduction bool   `bson:"is_production" yaml:"is_production" json:"is_production"`
	YamlContent  string `bson:"yaml_content"                     json:"yaml_content"                        yaml:"yaml_content"`
	// UserSuppliedValue added since 1.18, the values that users gives.
	UserSuppliedValue  string                   `bson:"user_supplied_value" json:"user_supplied_value" yaml:"user_supplied_value"`
	UpdateConfig       bool                     `bson:"update_config"                    json:"update_config"                       yaml:"update_config"`
	SkipCheckRunStatus bool                     `bson:"skip_check_run_status"            json:"skip_check_run_status"               yaml:"skip_check_run_status"`
	ImageAndModules    []*ImageAndServiceModule `bson:"image_and_service_modules"        json:"image_and_service_modules"           yaml:"image_and_service_modules"`
	ClusterID          string                   `bson:"cluster_id"                       json:"cluster_id"                          yaml:"cluster_id"`
	ReleaseName        string                   `bson:"release_name"                     json:"release_name"                        yaml:"release_name"`
	Timeout            int                      `bson:"timeout"                          json:"timeout"                             yaml:"timeout"`
	ReplaceResources   []Resource               `bson:"replace_resources"                json:"replace_resources"                   yaml:"replace_resources"`
}

type JobTaskJenkinsJobInfo

type JobTaskJenkinsJobInfo struct {
	JobName    string                 `bson:"job_name" json:"job_name" yaml:"job_name"`
	JobID      int                    `bson:"job_id" json:"job_id" yaml:"job_id"`
	JobOutput  string                 `bson:"job_output" json:"job_output" yaml:"job_output"`
	Parameters []*JenkinsJobParameter `bson:"parameters" json:"parameters" yaml:"parameters"`
}

type JobTaskJenkinsSpec

type JobTaskJenkinsSpec struct {
	ID   string                `bson:"id" json:"id" yaml:"id"`
	Host string                `bson:"host" json:"host" yaml:"host"`
	Job  JobTaskJenkinsJobInfo `bson:"job" json:"job" yaml:"job"`
}

type JobTaskJiraSpec

type JobTaskJiraSpec struct {
	ProjectID    string     `bson:"project_id"  json:"project_id"  yaml:"project_id"`
	JiraID       string     `bson:"jira_id"  json:"jira_id"  yaml:"jira_id"`
	IssueType    string     `bson:"issue_type"  json:"issue_type"  yaml:"issue_type"`
	Issues       []*IssueID `bson:"issues" json:"issues" yaml:"issues"`
	TargetStatus string     `bson:"target_status" json:"target_status" yaml:"target_status"`
}

type JobTaskMseGrayOfflineSpec

type JobTaskMseGrayOfflineSpec struct {
	Production      bool                     `bson:"production" json:"production" yaml:"production"`
	Env             string                   `bson:"env" json:"env" yaml:"env"`
	GrayTag         string                   `bson:"gray_tag" json:"gray_tag" yaml:"gray_tag"`
	Namespace       string                   `bson:"namespace" json:"namespace" yaml:"namespace"`
	OfflineServices []*MseGrayOfflineService `bson:"offline_services" json:"offline_services" yaml:"offline_services"`
	Events          []*Event                 `bson:"events" json:"events" yaml:"events"`
}

type JobTaskMseGrayReleaseSpec

type JobTaskMseGrayReleaseSpec struct {
	Production         bool                  `bson:"production" json:"production" yaml:"production"`
	GrayTag            string                `bson:"gray_tag" json:"gray_tag" yaml:"gray_tag"`
	BaseEnv            string                `bson:"base_env" json:"base_env" yaml:"base_env"`
	GrayEnv            string                `bson:"gray_env" json:"gray_env" yaml:"gray_env"`
	SkipCheckRunStatus bool                  `bson:"skip_check_run_status" json:"skip_check_run_status" yaml:"skip_check_run_status"`
	GrayService        MseGrayReleaseService `bson:"gray_service" json:"gray_service" yaml:"gray_service"`
	Events             []*Event              `bson:"events" json:"events" yaml:"events"`
	Timeout            int                   `bson:"timeout" json:"timeout" yaml:"timeout"`
}

type JobTaskNacosSpec

type JobTaskNacosSpec struct {
	NacosID       string       `bson:"nacos_id"         json:"nacos_id"         yaml:"nacos_id"`
	NamespaceID   string       `bson:"namespace_id"     json:"namespace_id"     yaml:"namespace_id"`
	NamespaceName string       `bson:"namespace_name"   json:"namespace_name"   yaml:"namespace_name"`
	NacosAddr     string       `bson:"nacos_addr"       json:"nacos_addr"       yaml:"nacos_addr"`
	UserName      string       `bson:"user_name"        json:"user_name"        yaml:"user_name"`
	Password      string       `bson:"password"         json:"password"         yaml:"password"`
	NacosDatas    []*NacosData `bson:"nacos_datas"      json:"nacos_datas"      yaml:"nacos_datas"`
}

type JobTaskOfflineServiceEvent

type JobTaskOfflineServiceEvent struct {
	ServiceName string        `bson:"service_name" json:"service_name" yaml:"service_name"`
	Status      config.Status `bson:"status" json:"status" yaml:"status"`
	Error       string        `bson:"error" json:"error" yaml:"error"`
}

type JobTaskOfflineServiceSpec

type JobTaskOfflineServiceSpec struct {
	EnvType       config.EnvType                `bson:"env_type" json:"env_type" yaml:"env_type"`
	EnvName       string                        `bson:"env_name" json:"env_name" yaml:"env_name"`
	Namespace     string                        `bson:"namespace" json:"namespace" yaml:"namespace"`
	ServiceEvents []*JobTaskOfflineServiceEvent `bson:"service_events" json:"service_events" yaml:"service_events"`
}

type JobTaskPluginSpec

type JobTaskPluginSpec struct {
	Properties JobProperties   `bson:"properties"          json:"properties"        yaml:"properties"`
	Plugin     *PluginTemplate `bson:"plugin"              json:"plugin"            yaml:"plugin"`
}

type JobTaskSQLSpec

type JobTaskSQLSpec struct {
	ID   string                `bson:"id" json:"id" yaml:"id"`
	Type config.DBInstanceType `bson:"type" json:"type" yaml:"type"`
	SQL  string                `bson:"sql" json:"sql" yaml:"sql"`
}

type JobTaskWorkflowTriggerSpec

type JobTaskWorkflowTriggerSpec struct {
	TriggerType           config.WorkflowTriggerType `bson:"trigger_type" json:"trigger_type" yaml:"trigger_type"`
	IsEnableCheck         bool                       `bson:"is_enable_check" json:"is_enable_check" yaml:"is_enable_check"`
	WorkflowTriggerEvents []*WorkflowTriggerEvent    `bson:"workflow_trigger_events" json:"workflow_trigger_events" yaml:"workflow_trigger_events"`
}

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"`
	Info                   *K8SClusterInfo          `json:"info,omitempty"            bson:"info,omitempty"`
	AdvancedConfig         *AdvancedConfig          `json:"advanced_config,omitempty" bson:"advanced_config,omitempty"`
	Status                 setting.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"`
	Local                  bool                     `json:"local"                     bson:"local"`
	Cache                  types.Cache              `json:"cache"                     bson:"cache"`
	ShareStorage           types.ShareStorage       `json:"share_storage"             bson:"share_storage"`
	LastConnectionTime     int64                    `json:"last_connection_time"      bson:"last_connection_time"`
	UpdateHubagentErrorMsg string                   `json:"update_hubagent_error_msg" bson:"update_hubagent_error_msg"`
	DindCfg                *DindCfg                 `json:"dind_cfg"                  bson:"dind_cfg"`

	// new field in 1.14, intended to enable kubeconfig for cluster management
	Type       string `json:"type"           bson:"type"` // either agent or kubeconfig supported
	KubeConfig string `json:"kube_config"    bson:"kube_config"`

	// Deprecated field, it should be deleted in version 1.15 since no more namespace settings is used
	Namespace string `json:"namespace"                 bson:"namespace"`
}

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 K8SClusterResp

type K8SClusterResp struct {
	ID             string          `json:"id"                          bson:"id,omitempty"`
	Name           string          `json:"name"                        bson:"name"`
	AdvancedConfig *AdvancedConfig `json:"advanced_config,omitempty"   bson:"advanced_config,omitempty"`
}

type K8sPatchJobSpec

type K8sPatchJobSpec struct {
	ClusterID        string       `bson:"cluster_id"             json:"cluster_id"            yaml:"cluster_id"`
	Namespace        string       `bson:"namespace"              json:"namespace"             yaml:"namespace"`
	PatchItems       []*PatchItem `bson:"patch_items"            json:"patch_items"           yaml:"patch_items"`
	PatchItemOptions []*PatchItem `bson:"-"                      json:"patch_item_options"    yaml:"patch_item_options"`
}

type KV

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

type KeyVal

type KeyVal struct {
	Key          string               `bson:"key"                       json:"key"                         yaml:"key"`
	Value        string               `bson:"value"                     json:"value"                       yaml:"value"`
	Type         ParameterSettingType `bson:"type,omitempty"            json:"type,omitempty"              yaml:"type"`
	ChoiceOption []string             `bson:"choice_option,omitempty"   json:"choice_option,omitempty"     yaml:"choice_option,omitempty"`
	IsCredential bool                 `bson:"is_credential"             json:"is_credential"               yaml:"is_credential"`
}

type LLMIntegration

type LLMIntegration struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"id"`
	Name        string             `bson:"name"           json:"name"`
	Token       string             `bson:"token"          json:"token"`
	BaseURL     string             `bson:"base_url"       json:"base_url"`
	EnableProxy bool               `bson:"enable_proxy"   json:"enable_proxy"`
	UpdatedBy   string             `bson:"updated_by"     json:"updated_by"`
	UpdateTime  int64              `bson:"update_time"    json:"update_time"`
}

func (LLMIntegration) TableName

func (llm LLMIntegration) TableName() string

type LarkApproval

type LarkApproval struct {
	Timeout int `bson:"timeout"                     yaml:"timeout"                    json:"timeout"`
	// ID: lark im app mongodb id
	ID string `bson:"approval_id"                 yaml:"approval_id"                json:"approval_id"`
	// DefaultApprovalInitiator if not set, use workflow task creator as approval initiator
	DefaultApprovalInitiator *LarkApprovalUser `bson:"default_approval_initiator" yaml:"default_approval_initiator" json:"default_approval_initiator"`
	// Deprecated: use ApprovalNodes instead
	ApproveUsers  []*LarkApprovalUser `bson:"approve_users"               yaml:"approve_users"              json:"approve_users"`
	ApprovalNodes []*LarkApprovalNode `bson:"approval_nodes"               yaml:"approval_nodes"              json:"approval_nodes"`
	// InstanceCode: lark approval instance code
	InstanceCode string `bson:"instance_code"               yaml:"instance_code"              json:"instance_code"`
}

func (LarkApproval) GetLarkApprovalNode

func (l LarkApproval) GetLarkApprovalNode() (resp []*lark.ApprovalNode)

GetLarkApprovalNode convert approval node to lark sdk approval node

func (LarkApproval) GetNodeTypeKey

func (l LarkApproval) GetNodeTypeKey() string

GetNodeTypeKey get node type key for deduplication

type LarkApprovalNode

type LarkApprovalNode struct {
	ApproveUsers    []*LarkApprovalUser    `bson:"approve_users"               yaml:"approve_users"              json:"approve_users"`
	Type            lark.ApproveType       `bson:"type"                        yaml:"type"                       json:"type"`
	RejectOrApprove config.ApproveOrReject `bson:"reject_or_approve"           yaml:"-"                          json:"reject_or_approve"`
}

type LarkApprovalUser

type LarkApprovalUser struct {
	lark.UserInfo   `bson:",inline"  yaml:",inline"  json:",inline"`
	RejectOrApprove config.ApproveOrReject `bson:"reject_or_approve,omitempty"           yaml:"-"                          json:"reject_or_approve,omitempty"`
	Comment         string                 `bson:"comment,omitempty"                     yaml:"-"                          json:"comment,omitempty"`
	OperationTime   int64                  `bson:"operation_time,omitempty"              yaml:"-"                          json:"operation_time,omitempty"`
}

type Limits

type Limits struct {
	CPU    int `json:"cpu"    bson:"cpu"`
	Memory int `json:"memory" bson:"memory"`
}

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"`
	RepoNamespace string                 `bson:"repo_namespace"            json:"repo_namespace"`
	RepoName      string                 `bson:"repo_name"                 json:"repo_name"`
	Branch        string                 `bson:"branch"                    json:"branch"`
	Tag           string                 `bson:"tag"                       json:"tag"`
	Committer     string                 `bson:"committer"                 json:"committer"`
	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

func (*MainHookRepo) GetRepoNamespace

func (m *MainHookRepo) GetRepoNamespace() string

type MeegoHook

type MeegoHook struct {
	Name                string      `bson:"name" json:"name"`
	MeegoID             string      `bson:"meego_id" json:"meego_id"`
	MeegoSystemIdentity string      `bson:"meego_system_identity" json:"meego_system_identity"`
	MeegoURL            string      `bson:"meego_url"             json:"meego_url"`
	Enabled             bool        `bson:"enabled" json:"enabled"`
	Description         string      `bson:"description" json:"description"`
	WorkflowArg         *WorkflowV4 `bson:"workflow_arg" json:"workflow_arg"`
}

type MeegoTransitionJobSpec

type MeegoTransitionJobSpec struct {
	Source              string                     `bson:"source"                json:"source"`
	ProjectKey          string                     `bson:"project_key"           json:"project_key"           yaml:"project_key"`
	ProjectName         string                     `bson:"project_name"          json:"project_name"          yaml:"project_name"`
	MeegoID             string                     `bson:"meego_id"              json:"meego_id"              yaml:"meego_id"`
	MeegoSystemIdentity string                     `bson:"meego_system_identity" json:"meego_system_identity" yaml:"meego_system_identity"`
	MeegoURL            string                     `bson:"meego_url"             json:"meego_url"             yaml:"meego_url"`
	WorkItemType        string                     `bson:"work_item_type"        json:"work_item_type"        yaml:"work_item_type"`
	WorkItemTypeKey     string                     `bson:"work_item_type_key"    json:"work_item_type_key"    yaml:"work_item_type_key"`
	Link                string                     `bson:"link"                  json:"link"                  yaml:"link"`
	WorkItems           []*MeegoWorkItemTransition `bson:"work_items"            json:"work_items"            yaml:"work_items"`
}

type MeegoTransitionSpec

type MeegoTransitionSpec struct {
	Link            string                     `bson:"link"               json:"link"               yaml:"link"`
	Source          string                     `bson:"source"             json:"source"             yaml:"source"`
	ProjectKey      string                     `bson:"project_key"        json:"project_key"        yaml:"project_key"`
	ProjectName     string                     `bson:"project_name"       json:"project_name"       yaml:"project_name"`
	MeegoID         string                     `bson:"meego_id"           json:"meego_id"           yaml:"meego_id"`
	WorkItemType    string                     `bson:"work_item_type"     json:"work_item_type"     yaml:"work_item_type"`
	WorkItemTypeKey string                     `bson:"work_item_type_key" json:"work_item_type_key" yaml:"work_item_type_key"`
	WorkItems       []*MeegoWorkItemTransition `bson:"work_items"         json:"work_items"         yaml:"work_items"`
}

type MeegoWorkItemTransition

type MeegoWorkItemTransition struct {
	ID              int    `bson:"id"                json:"id"                yaml:"id"`
	Name            string `bson:"name"              json:"name"              yaml:"name"`
	TransitionID    int64  `bson:"transition_id"     json:"transition_id"     yaml:"transition_id"`
	TargetStateKey  string `bson:"target_state_key"  json:"target_state_key"  yaml:"target_state_key"`
	TargetStateName string `bson:"target_state_name" json:"target_state_name" yaml:"target_state_name"`
	Status          string `bson:"status"            json:"status"            yaml:"status,omitempty"`
}

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 MseGrayOfflineJobSpec

type MseGrayOfflineJobSpec struct {
	Env        string `bson:"env" json:"env" yaml:"env"`
	Source     string `bson:"source" json:"source" yaml:"source"`
	GrayTag    string `bson:"gray_tag" json:"gray_tag" yaml:"gray_tag"`
	Production bool   `bson:"production" json:"production" yaml:"production"`
}

type MseGrayOfflineService

type MseGrayOfflineService struct {
	ServiceName string        `bson:"service_name" json:"service_name" yaml:"service_name"`
	Status      config.Status `bson:"status" json:"status" yaml:"status"`
	Error       string        `bson:"error" json:"error" yaml:"error"`
}

type MseGrayReleaseJobSpec

type MseGrayReleaseJobSpec struct {
	Production         bool                     `bson:"production" json:"production" yaml:"production"`
	GrayTag            string                   `bson:"gray_tag" json:"gray_tag" yaml:"gray_tag"`
	BaseEnv            string                   `bson:"base_env" json:"base_env" yaml:"base_env"`
	GrayEnv            string                   `bson:"gray_env" json:"gray_env" yaml:"gray_env"`
	GrayEnvSource      string                   `bson:"gray_env_source" json:"gray_env_source" yaml:"gray_env_source"`
	DockerRegistryID   string                   `bson:"docker_registry_id" json:"docker_registry_id" yaml:"docker_registry_id"`
	SkipCheckRunStatus bool                     `bson:"skip_check_run_status" json:"skip_check_run_status" yaml:"skip_check_run_status"`
	GrayServices       []*MseGrayReleaseService `bson:"gray_services" json:"gray_services" yaml:"gray_services"`
}

type MseGrayReleaseService

type MseGrayReleaseService struct {
	ServiceName     string                                 `bson:"service_name" json:"service_name" yaml:"service_name"`
	Replicas        int                                    `bson:"replicas"     json:"replicas"     yaml:"replicas"`
	YamlContent     string                                 `bson:"yaml" json:"yaml" yaml:"yaml"`
	ServiceAndImage []*MseGrayReleaseServiceModuleAndImage `bson:"service_and_image" json:"service_and_image" yaml:"service_and_image"`
}

type MseGrayReleaseServiceModuleAndImage

type MseGrayReleaseServiceModuleAndImage struct {
	ServiceModule string `bson:"service_module" json:"service_module" yaml:"service_module"`
	Image         string `bson:"image"          json:"image"          yaml:"image"`
	// Following fields only save for frontend
	ImageName   string `bson:"image_name"     json:"image_name"     yaml:"image_name"`
	Name        string `bson:"name"           json:"name"           yaml:"name"`
	ServiceName string `bson:"service_name"   json:"service_name"   yaml:"service_name"`
	Value       string `bson:"value"          json:"value"          yaml:"value"`
}

type NacosAuthConfig

type NacosAuthConfig struct {
	UserName string `json:"user_name" bson:"user_name"`
	Password string `json:"password" bson:"password"`
}

type NacosConfig

type NacosConfig struct {
	ServerAddress string `json:"server_address"`
	*NacosAuthConfig
}

type NacosData

type NacosData struct {
	types.NacosConfig `bson:",inline" json:",inline" yaml:",inline"`
	Error             string `bson:"error"      json:"error"      yaml:"error"`
}

type NacosJobSpec

type NacosJobSpec struct {
	NacosID           string               `bson:"nacos_id"            json:"nacos_id"            yaml:"nacos_id"`
	NamespaceID       string               `bson:"namespace_id"        json:"namespace_id"        yaml:"namespace_id"`
	NacosDatas        []*types.NacosConfig `bson:"nacos_datas"         json:"nacos_datas"         yaml:"nacos_datas"`
	NacosFilteredData []*types.NacosConfig `bson:"nacos_filtered_data" json:"nacos_filtered_data" yaml:"nacos_filtered_data"`
	NacosDataRange    []string             `bson:"nacos_data_range"    json:"nacos_data_range"    yaml:"nacos_data_range"`
	DataFixed         bool                 `bson:"data_fixed"          json:"data_fixed"          yaml:"data_fixed"`
}

type NativeApproval

type NativeApproval struct {
	Timeout           int                    `bson:"timeout"                     yaml:"timeout"                    json:"timeout"`
	ApproveUsers      []*User                `bson:"approve_users"               yaml:"approve_users"              json:"approve_users"`
	FloatApproveUsers []*User                `bson:"-"                           yaml:"flat_approve_users"          json:"flat_approve_users"`
	NeededApprovers   int                    `bson:"needed_approvers"            yaml:"needed_approvers"           json:"needed_approvers"`
	RejectOrApprove   config.ApproveOrReject `bson:"reject_or_approve"           yaml:"-"                          json:"reject_or_approve"`
	// InstanceCode: native approval instance code, save for working after restart aslan
	InstanceCode string `bson:"instance_code"               yaml:"instance_code"              json:"instance_code"`
}

type NodeSelectorRequirement

type NodeSelectorRequirement struct {
	Key      string                      `json:"key"      bson:"key"`
	Value    []string                    `json:"value"    bson:"value"`
	Operator corev1.NodeSelectorOperator `json:"operator" bson:"operator"`
}

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"`
	IsScanning   bool                `bson:"is_scanning"                  json:"is_scanning"`
	IsWorkflowV4 bool                `bson:"is_workflowv4"                json:"is_workflowv4"`
	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"`
	RepoOwner    string              `bson:"repo_owner"                   json:"repo_owner"`
	RepoName     string              `bson:"repo_name"                    json:"repo_name"`
}

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 NotificationConfig

type NotificationConfig struct {
	WebHookType WebHookType         `bson:"webhook_type" json:"webhook_type"`
	WebHookURL  string              `bson:"webhook_url"  json:"webhook_url"`
	Events      []NotificationEvent `bson:"events"       json:"events"`
}

type NotificationEvent

type NotificationEvent string
const (
	NotificationEventAnalyzerNoraml   NotificationEvent = "notification_event_analyzer_normal"
	NotificationEventAnalyzerAbnormal NotificationEvent = "notification_event_analyzer_abnormal"
)

type NotificationTask

type NotificationTask struct {
	ProductName         string            `bson:"product_name"            json:"product_name"`
	WorkflowName        string            `bson:"workflow_name"           json:"workflow_name"`
	WorkflowDisplayName string            `bson:"workflow_display_name"   json:"workflow_display_name"`
	EncodedDisplayName  string            `bson:"encoded_display_name"    json:"encoded_display_name"`
	PipelineName        string            `bson:"pipeline_name"           json:"pipeline_name"`
	ScanningName        string            `bson:"scanning_name"           json:"scanningName"`
	ScanningID          string            `bson:"scanning_id"             json:"scanning_id"`
	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"                       yaml:"enabled"                       json:"enabled"`
	WebHookType     string   `bson:"webhook_type"                  yaml:"webhook_type"                  json:"webhook_type"`
	WeChatWebHook   string   `bson:"weChat_webHook,omitempty"      yaml:"weChat_webHook,omitempty"      json:"weChat_webHook,omitempty"`
	DingDingWebHook string   `bson:"dingding_webhook,omitempty"    yaml:"dingding_webhook,omitempty"    json:"dingding_webhook,omitempty"`
	FeiShuWebHook   string   `bson:"feishu_webhook,omitempty"      yaml:"feishu_webhook,omitempty"      json:"feishu_webhook,omitempty"`
	AtMobiles       []string `bson:"at_mobiles,omitempty"          yaml:"at_mobiles,omitempty"          json:"at_mobiles,omitempty"`
	WechatUserIDs   []string `bson:"wechat_user_ids,omitempty"     yaml:"wechat_user_ids,omitempty"     json:"wechat_user_ids,omitempty"`
	LarkUserIDs     []string `bson:"lark_user_ids,omitempty"       yaml:"lark_user_ids,omitempty"       json:"lark_user_ids,omitempty"`
	IsAtAll         bool     `bson:"is_at_all,omitempty"           yaml:"is_at_all,omitempty"           json:"is_at_all,omitempty"`
	NotifyTypes     []string `bson:"notify_type"                   yaml:"notify_type"                   json:"notify_type"`
}

type ObjectStorageUpload

type ObjectStorageUpload struct {
	Enabled         bool                             `bson:"enabled"           json:"enabled"`
	ObjectStorageID string                           `bson:"object_storage_id" json:"object_storage_id"`
	UploadDetail    []*types.ObjectStoragePathDetail `bson:"upload_detail"     json:"upload_detail"`
}

type Observability

type Observability struct {
	ID   primitive.ObjectID       `json:"id" bson:"_id,omitempty" yaml:"id"`
	Type config.ObservabilityType `json:"type" bson:"type" yaml:"type"`
	Name string                   `json:"name" bson:"name" yaml:"name"`
	Host string                   `json:"host" bson:"host" yaml:"host"`
	// ConsoleHost is used for guanceyun console, Host is guanceyun OpenApi Addr
	ConsoleHost string `json:"console_host" bson:"console_host" yaml:"console_host"`
	// ApiKey is used for guanceyun
	ApiKey string `json:"api_key" bson:"api_key" yaml:"api_key"`

	GrafanaToken string `json:"grafana_token" bson:"grafana_token" yaml:"grafana_token"`
	UpdateTime   int64  `json:"update_time" bson:"update_time" yaml:"update_time"`
}

func (Observability) TableName

func (Observability) TableName() string

type OfflineServiceJobSpec

type OfflineServiceJobSpec struct {
	EnvType  config.EnvType `bson:"env_type" json:"env_type" yaml:"env_type"`
	EnvName  string         `bson:"env_name" json:"env_name" yaml:"env_name"`
	Source   string         `bson:"source" json:"source" yaml:"source"`
	Services []string       `bson:"services" json:"services" yaml:"services"`
}

type Output

type Output struct {
	Name        string `bson:"name"           json:"name"             yaml:"name"`
	Description string `bson:"description"    json:"description"      yaml:"description"`
}

type Param

type Param struct {
	Name        string `bson:"name"             json:"name"             yaml:"name"`
	Description string `bson:"description"      json:"description"      yaml:"description"`
	// support string/text/choice/repo type
	ParamsType   string                 `bson:"type"                      json:"type"                        yaml:"type"`
	Value        string                 `bson:"value"                     json:"value"                       yaml:"value,omitempty"`
	Repo         *types.Repository      `bson:"repo"                     json:"repo"                         yaml:"repo,omitempty"`
	ChoiceOption []string               `bson:"choice_option,omitempty"   json:"choice_option,omitempty"     yaml:"choice_option,omitempty"`
	Default      string                 `bson:"default"                   json:"default"                     yaml:"default"`
	IsCredential bool                   `bson:"is_credential"             json:"is_credential"               yaml:"is_credential"`
	Source       config.ParamSourceType `bson:"source,omitempty" json:"source,omitempty" yaml:"source,omitempty"`
}

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 ParameterSetting

type ParameterSetting struct {
	// External type parameter will NOT use this key.
	Key  string               `bson:"key" json:"key"`
	Type ParameterSettingType `bson:"type" json:"type"`
	//DefaultValue
	DefaultValue string `bson:"default_value" json:"default_value"`
	// choiceOption Are all options enumerated
	ChoiceOption []string `bson:"choice_option" json:"choice_option"`
	// ExternalSetting It is the configuration of the external system to obtain the variable
	ExternalSetting *ExternalSetting `bson:"external_setting" json:"external_setting"`
}

type ParameterSettingType

type ParameterSettingType string
const (
	StringType   ParameterSettingType = "string"
	ChoiceType   ParameterSettingType = "choice"
	ExternalType ParameterSettingType = "external"
)

type PatchItem

type PatchItem struct {
	ResourceName    string   `bson:"resource_name"                json:"resource_name"               yaml:"resource_name"`
	ResourceKind    string   `bson:"resource_kind"                json:"resource_kind"               yaml:"resource_kind"`
	ResourceGroup   string   `bson:"resource_group"               json:"resource_group"              yaml:"resource_group"`
	ResourceVersion string   `bson:"resource_version"             json:"resource_version"            yaml:"resource_version"`
	PatchContent    string   `bson:"patch_content"                json:"patch_content"               yaml:"patch_content"`
	Params          []*Param `bson:"params"                       json:"params"                      yaml:"params"`
	// support strategic-merge/merge/json
	PatchStrategy string `bson:"patch_strategy"          json:"patch_strategy"         yaml:"patch_strategy"`
}

type PatchTaskItem

type PatchTaskItem struct {
	ResourceName    string   `bson:"resource_name"                json:"resource_name"               yaml:"resource_name"`
	ResourceKind    string   `bson:"resource_kind"                json:"resource_kind"               yaml:"resource_kind"`
	ResourceGroup   string   `bson:"resource_group"               json:"resource_group"              yaml:"resource_group"`
	ResourceVersion string   `bson:"resource_version"             json:"resource_version"            yaml:"resource_version"`
	PatchContent    string   `bson:"patch_content"                json:"patch_content"               yaml:"patch_content"`
	Params          []*Param `bson:"params"                       json:"params"                      yaml:"params"`
	// support strategic-merge/merge/json
	PatchStrategy string `bson:"patch_strategy"          json:"patch_strategy"         yaml:"patch_strategy"`
	Error         string `bson:"error"                   json:"error"                  yaml:"error"`
}

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"`
	// TODO: Deprecated.
	NotifyCtl *NotifyCtl `bson:"notify_ctl"                   json:"notify_ctl"`
	// New since V1.12.0.
	NotifyCtls []*NotifyCtl `bson:"notify_ctls"                  json:"notify_ctls"`
	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"`
	Stages       []*Stage            `bson:"-"                         json:"stages"`
}

type PluginJobSpec

type PluginJobSpec struct {
	Properties *JobProperties  `bson:"properties"               yaml:"properties"              json:"properties"`
	Plugin     *PluginTemplate `bson:"plugin"                   yaml:"plugin"                  json:"plugin"`
}

type PluginRepo

type PluginRepo struct {
	ID              primitive.ObjectID `bson:"_id,omitempty"             json:"id,omitempty"             yaml:"source,omitempty"`
	IsOffical       bool               `bson:"is_offical"                json:"is_offical"               yaml:"is_offical"`
	RepoURL         string             `bson:"repo_url"                  json:"repo_url"                 yaml:"-"`
	RepoNamespace   string             `bson:"repo_namespace"            json:"repo_namespace"           yaml:"repo_namespace"`
	Source          string             `bson:"source,omitempty"          json:"source,omitempty"         yaml:"source,omitempty"`
	RepoOwner       string             `bson:"repo_owner"                json:"repo_owner"               yaml:"repo_owner"`
	RepoName        string             `bson:"repo_name"                 json:"repo_name"                yaml:"repo_name"`
	Branch          string             `bson:"branch"                    json:"branch"                   yaml:"branch"`
	CommitID        string             `bson:"commit_id,omitempty"       json:"commit_id,omitempty"      yaml:"commit_id,omitempty"`
	CodehostID      int                `bson:"codehost_id"               json:"codehost_id"              yaml:"codehost_id"`
	UpdateTime      int64              `bson:"update_time"               json:"update_time"              yaml:"update_time"`
	PluginTemplates []*PluginTemplate  `bson:"plugin_templates"          json:"plugin_templates"         yaml:"plugin_templates"`
	Status          string             `bson:"status"                    json:"status"                   yaml:"status"`
	Error           string             `bson:"error"                     json:"error"                    yaml:"error"`
}

func (PluginRepo) TableName

func (PluginRepo) TableName() string

type PluginTemplate

type PluginTemplate struct {
	Name        string    `bson:"name"             json:"name"             yaml:"name"`
	IsOffical   bool      `bson:"is_offical"       json:"is_offical"       yaml:"is_offical"`
	Category    string    `bson:"category"         json:"category"         yaml:"category"`
	Description string    `bson:"description"      json:"description"      yaml:"description"`
	RepoURL     string    `bson:"repo_url"         json:"repo_url"         yaml:"-"`
	Version     string    `bson:"version"          json:"version"          yaml:"version"`
	Image       string    `bson:"image"            json:"image"            yaml:"image"`
	Args        []string  `bson:"args"             json:"args"             yaml:"args"`
	Cmds        []string  `bson:"cmds"             json:"cmds"             yaml:"cmds"`
	Envs        []*Env    `bson:"envs"             json:"envs"             yaml:"envs"`
	Inputs      []*Param  `bson:"inputs"           json:"inputs"           yaml:"inputs"`
	Outputs     []*Output `bson:"outputs"          json:"outputs"          yaml:"outputs"`
}

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 PmInfo

type PmInfo struct {
	ID       primitive.ObjectID   `json:"id,omitempty"`
	Name     string               `json:"name"`
	IP       string               `json:"ip"`
	Port     int64                `json:"port"`
	Status   setting.PMHostStatus `json:"status"`
	Label    string               `json:"label"`
	IsProd   bool                 `json:"is_prod"`
	Provider int8                 `json:"provider"`
}

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"`
	ObjectStorageUpload *ObjectStorageUpload `bson:"object_storage_upload"  json:"object_storage_upload"`
	FileArchive         *FileArchive         `bson:"file_archive,omitempty" json:"file_archive,omitempty"`
	Scripts             string               `bson:"scripts"                json:"scripts"`
}

type PostTest

type PostTest struct {
	ObjectStorageUpload *ObjectStorageUpload `bson:"object_storage_upload,omitempty" json:"object_storage_upload,omitempty"`
}

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 {
	// TODO: Deprecated.
	CleanWorkspace bool `bson:"clean_workspace"            json:"clean_workspace"`
	// ResReq defines job requested resources
	ResReq     setting.Request     `bson:"res_req"                json:"res_req"`
	ResReqSpec setting.RequestSpec `bson:"res_req_spec"           json:"res_req_spec"`
	// BuildOS defines job image OS, it supports 18.04 and 20.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"`
	ClusterID  string `bson:"cluster_id"                      json:"cluster_id"`
	StrategyID string `bson:"strategy_id"                     json:"strategy_id"`
	// UseHostDockerDaemon determines is dockerDaemon on host node is used in pod
	UseHostDockerDaemon bool `bson:"use_host_docker_daemon" json:"use_host_docker_daemon"`

	// TODO: Deprecated.
	Namespace string `bson:"namespace"                       json:"namespace"`
}

PreBuild prepares an environment for a job

type PreDeploy

type PreDeploy struct {
	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  []*Item `bson:"installs,omitempty"    json:"installs"`
}

type PreTest

type PreTest struct {
	// TODO: Deprecated.
	CleanWorkspace bool `bson:"clean_workspace"            json:"clean_workspace"`

	// BuildOS defines job image OS, it supports 18.04 and 20.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     setting.Request     `bson:"res_req"                json:"res_req"`
	ResReqSpec setting.RequestSpec `bson:"res_req_spec"           json:"res_req_spec"`
	// 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"`
	ClusterID        string `bson:"cluster_id"             json:"cluster_id"`
	StrategyID       string `bson:"strategy_id"            json:"strategy_id"`
	ConcurrencyLimit int    `bson:"concurrency_limit"      json:"concurrency_limit"`
	// TODO: Deprecated.
	Namespace string `bson:"namespace"              json:"namespace"`
}

PreTest prepares an environment for a job

type Preview

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

type PrivacySettings

type PrivacySettings struct {
	ImprovementPlan bool `json:"improvement_plan" bson:"improvement_plan"`
}

type PrivateKey

type PrivateKey struct {
	ID           primitive.ObjectID   `bson:"_id,omitempty"          json:"id,omitempty"`
	Name         string               `bson:"name"                   json:"name"`
	Description  string               `bson:"description"            json:"description"`
	UserName     string               `bson:"user_name"              json:"user_name"`
	IP           string               `bson:"ip"                     json:"ip"`
	Port         int64                `bson:"port"                   json:"port"`
	Status       setting.PMHostStatus `bson:"status"                 json:"status"`
	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"`
	Probe        *types.Probe         `bson:"probe"                  json:"probe"`
	ProjectName  string               `bson:"project_name,omitempty" json:"project_name"`
	UpdateStatus bool                 `bson:"-"                      json:"update_status"`
	// ScheduleWorkflow equals to true means this vm is agent type, false means this vm is ssh type
	ScheduleWorkflow bool     `bson:"schedule_workflow"      json:"schedule_workflow"`
	Error            string   `bson:"error"                  json:"error"`
	Agent            *VMAgent `bson:"agent"                  json:"agent,omitempty"`
	VMInfo           *VMInfo  `bson:"vm_info"                json:"vm_info,omitempty"`
	Type             string   `bson:"type"                   json:"type"`
}

func (PrivateKey) TableName

func (PrivateKey) TableName() string

func (*PrivateKey) Validate

func (args *PrivateKey) Validate() error

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"`
	BaseEnvName    string                          `bson:"-"                         json:"base_env_name"`
	UpdateBy       string                          `bson:"update_by"                 json:"update_by"`
	Visibility     string                          `bson:"-"                         json:"visibility"`
	Services       [][]*ProductService             `bson:"services"                  json:"services"`
	Render         *RenderInfo                     `bson:"-"                         json:"render"` // Deprecated in 1.19.0, will be removed in 1.20.0
	Error          string                          `bson:"error"                     json:"error"`
	ServiceRenders []*templatemodels.ServiceRender `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"`
	RegistryID     string                          `bson:"registry_id"               json:"registry_id"`
	BaseName       string                          `bson:"base_name"                 json:"base_name"`
	// IsExisted is true if this environment is created from an existing one
	IsExisted bool `bson:"is_existed"                json:"is_existed"`
	// TODO: Deprecated: temp flag
	IsForkedProduct bool `bson:"-" json:"-"`

	// New Since v1.11.0.
	ShareEnv ProductShareEnv `bson:"share_env" json:"share_env"`

	// New Since v1.13.0.
	EnvConfigs []*CreateUpdateCommonEnvCfgArgs `bson:"-"   json:"env_configs,omitempty"`

	// New Since v1.16.0, used to determine whether to install resources
	ServiceDeployStrategy map[string]string `bson:"service_deploy_strategy" json:"service_deploy_strategy"`

	// New Since v.1.18.0, env configs
	AnalysisConfig      *AnalysisConfig       `bson:"analysis_config"      json:"analysis_config"`
	NotificationConfigs []*NotificationConfig `bson:"notification_configs" json:"notification_configs"`

	// New Since v1.19.0, env sleep configs
	PreSleepStatus map[string]int `bson:"pre_sleep_status" json:"pre_sleep_status"`

	// New Since v1.19.0, for env global variables
	// GlobalValues for helm projects
	DefaultValues string                     `bson:"default_values,omitempty"       json:"default_values,omitempty"`
	YamlData      *templatemodels.CustomYaml `bson:"yaml_data,omitempty"            json:"yaml_data,omitempty"`
	// GlobalValues for k8s projects
	GlobalVariables []*commontypes.GlobalVariableKV `bson:"global_variables,omitempty"     json:"global_variables,omitempty"`

	// New Since v2.1.0.
	IstioGrayscale IstioGrayscale `bson:"istio_grayscale" json:"istio_grayscale"`

	// For production environment
	Production bool   `json:"production" bson:"production"`
	Alias      string `json:"alias" bson:"alias"`
}

func (*Product) EnsureRenderInfo

func (p *Product) EnsureRenderInfo()

EnsureRenderInfo For some old data, the render data mayby nil

func (*Product) GetAllSvcRenders

func (p *Product) GetAllSvcRenders() []*templatemodels.ServiceRender

func (*Product) GetChartDeployRenderMap

func (p *Product) GetChartDeployRenderMap() map[string]*templatemodels.ServiceRender

func (*Product) GetChartRenderMap

func (p *Product) GetChartRenderMap() map[string]*templatemodels.ServiceRender

func (*Product) GetChartServiceMap

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

func (*Product) GetDefaultNamespace

func (p *Product) GetDefaultNamespace() string

GetNamespace returns the default name of namespace created by zadig

func (*Product) GetGroupServiceNames

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

func (*Product) GetProductSvcNames

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

func (*Product) GetServiceMap

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

func (*Product) GetSvcList

func (p *Product) GetSvcList() []*ProductService

func (*Product) GetSvcRender

func (p *Product) GetSvcRender(svcName string) *templatemodels.ServiceRender

func (*Product) IsSleeping

func (p *Product) IsSleeping() bool

func (*Product) String

func (p *Product) String() string

func (Product) TableName

func (Product) TableName() 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 ProductService

type ProductService struct {
	ServiceName string                        `bson:"service_name"               json:"service_name"`
	ReleaseName string                        `bson:"release_name"               json:"release_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"`
	Error       string                        `bson:"error,omitempty"            json:"error,omitempty"`
	Resources   []*ServiceResource            `bson:"resources,omitempty"             json:"resources,omitempty"`
	UpdateTime  int64                         `bson:"update_time"                json:"update_time"`
	Render      *templatemodels.ServiceRender `bson:"render"                     json:"render,omitempty"` // New since 1.9.0 used to replace service renders in render_set

	EnvConfigs     []*EnvConfig                    `bson:"-"                          json:"env_configs,omitempty"`
	VariableYaml   string                          `bson:"-"                          json:"variable_yaml,omitempty"`
	VariableKVs    []*commontypes.RenderVariableKV `bson:"-"                          json:"variable_kvs,omitempty"`
	Updatable      bool                            `bson:"-"                          json:"updatable"`
	DeployStrategy string                          `bson:"-"                          json:"deploy_strategy"`
}

func (*ProductService) FromZadig

func (svc *ProductService) FromZadig() bool

func (*ProductService) GetContainerImageMap added in v2.3.1

func (svc *ProductService) GetContainerImageMap() map[string]string

func (*ProductService) GetServiceRender

func (svc *ProductService) GetServiceRender() *templatemodels.ServiceRender

type ProductShareEnv

type ProductShareEnv struct {
	Enable  bool   `bson:"enable"   json:"enable"`
	IsBase  bool   `bson:"is_base"  json:"is_base"`
	BaseEnv string `bson:"base_env" json:"base_env"`
}

type ProjectClusterRelation

type ProjectClusterRelation struct {
	ID          primitive.ObjectID `json:"id,omitempty"              bson:"_id,omitempty"`
	ProjectName string             `json:"project_name"              bson:"project_name"`
	ClusterID   string             `json:"cluster_id"                bson:"cluster_id"`
	CreatedAt   int64              `json:"createdAt"                 bson:"createdAt"`
	CreatedBy   string             `json:"createdBy"                 bson:"createdBy"`
}

func (ProjectClusterRelation) TableName

func (ProjectClusterRelation) TableName() string

type ProjectDetail

type ProjectDetail struct {
	ProjectKey        string `bson:"project_key"                     json:"project_key"`
	ProjectName       string `bson:"project_name"                    json:"project_name"`
	ProjectDeployType string `bson:"project_deploy_type"             json:"project_deploy_type"`
}

type ProjectGroup

type ProjectGroup struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"          json:"id,omitempty"`
	Name        string             `bson:"name"                   json:"name"`
	Projects    []*ProjectDetail   `bson:"projects"               json:"projects"`
	CreatedBy   string             `bson:"created_by"             json:"created_by"`
	CreatedTime int64              `bson:"created_time"           json:"created_time"`
	UpdateTime  int64              `bson:"update_time"            json:"update_time"`
	UpdateBy    string             `bson:"update_by"              json:"update_by,omitempty"`
}

func (ProjectGroup) TableName

func (ProjectGroup) TableName() string

type ProjectManagement

type ProjectManagement struct {
	ID             primitive.ObjectID  `bson:"_id,omitempty"       json:"id" `
	SystemIdentity string              `bson:"system_identity"     json:"system_identity"`
	Type           string              `bson:"type"                json:"type"`
	JiraAuthType   config.JiraAuthType `bson:"jira_auth_type" json:"jira_auth_type"`
	JiraHost       string              `bson:"jira_host"           json:"jira_host"`
	JiraUser       string              `bson:"jira_user"           json:"jira_user"`
	// JiraToken is used in place of password for basic auth with username
	JiraToken string `bson:"jira_token"          json:"jira_token"`
	// JiraPersonalAccessToken is used for bearer token
	JiraPersonalAccessToken string `bson:"jira_personal_access_token" json:"jira_personal_access_token"`
	MeegoHost               string `bson:"meego_host"          json:"meego_host"`
	MeegoPluginID           string `bson:"meego_plugin_id"     json:"meego_plugin_id"`
	MeegoPluginSecret       string `bson:"meego_plugin_secret" json:"meego_plugin_secret"`
	MeegoUserKey            string `bson:"meego_user_key"      json:"meego_user_key"`
	UpdatedAt               int64  `bson:"updated_at"          json:"updated_at"`
}

func (ProjectManagement) TableName

func (ProjectManagement) TableName() string

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"`
	PipelineDisplayName     string                       `bson:"pipeline_display_name"                      json:"pipeline_display_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                  string                       `bson:"target,omitempty"                           json:"target"` // target service name, for k8s: containerName, for pm: serviceName
	BuildModuleVer          string                       `bson:"build_module_ver,omitempty"                 json:"build_module_ver"`
	ServiceName             string                       `bson:"service_name,omitempty"                     json:"service_name,omitempty"`
	TaskArgs                *TaskArgs                    `bson:"task_args,omitempty"                        json:"task_args,omitempty"`     // TaskArgs job parameters for single-service workflow
	WorkflowArgs            *WorkflowTaskArgs            `bson:"workflow_args"                              json:"workflow_args,omitempty"` // WorkflowArgs job parameters for multi-service workflow
	ScanningArgs            *ScanningArgs                `bson:"scanning_args,omitempty"                    json:"scanning_args,omitempty"` // ScanningArgs argument for scanning tasks
	TestArgs                *TestTaskArgs                `bson:"test_args,omitempty"                        json:"test_args,omitempty"`     // TestArgs parameters for testing
	ServiceTaskArgs         *ServiceTaskArgs             `bson:"service_args,omitempty"                     json:"service_args,omitempty"`  // ServiceTaskArgs parameters for script-deployed workflows
	ArtifactPackageTaskArgs *ArtifactPackageTaskArgs     `bson:"artifact_package_args,omitempty"            json:"artifact_package_args,omitempty"`
	ConfigPayload           *ConfigPayload               `bson:"configpayload,omitempty"                    json:"config_payload"`
	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"`
	TestReports             map[string]interface{}       `bson:"test_reports,omitempty"                     json:"test_reports,omitempty"`
	ResetImage              bool                         `bson:"resetImage"                                 json:"resetImage"`
	ResetImagePolicy        setting.ResetImagePolicyType `bson:"reset_image_policy"                         json:"reset_image_policy"`
	TriggerBy               *TriggerBy                   `bson:"trigger_by,omitempty"                       json:"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 RegistryAdvancedSetting

type RegistryAdvancedSetting struct {
	// indicator to make sure if the advanced has been modified
	// This is solely a field for frontend display and not used anywhere else in the backend system
	// TODO: whether this field should exist needs a discussion
	Modified bool `bson:"modified" json:"modified"`
	// New field since v1.11 to support self-signed TLS certificate
	TLSEnabled bool   `bson:"enable_tls" json:"enable_tls"`
	TLSCert    string `bson:"tls_cert" json:"tls_cert"`
}

type RegistryBrief added in v2.3.0

type RegistryBrief struct {
	RegistryID   string `json:"registry_id"   yaml:"registry_id"`
	RegistryName string `json:"registry_name" yaml:"registry_name"`
}

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"`
	Projects    []string           `bson:"projects"                    json:"projects"`
	// Namespace is NOT a required field, this could be empty when the registry is AWS ECR or so.
	// use with CAUTION !!!!
	Namespace  string `bson:"namespace,omitempty"         json:"namespace,omitempty"`
	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"`

	AdvancedSetting *RegistryAdvancedSetting `bson:"advanced_setting" json:"advanced_setting"`
}

func (*RegistryNamespace) GetRegistryAddress

func (ns *RegistryNamespace) GetRegistryAddress() (string, error)

func (*RegistryNamespace) LicenseValidate

func (args *RegistryNamespace) LicenseValidate() error

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
	// PackagerImage sets docker build image
	// e.g. xxx.com/resources/predator-plugin:v0.1.0
	PackagerImage string
}

type ReleaseImage

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

type ReleaseJob

type ReleaseJob struct {
	ID   string                    `bson:"id"       yaml:"id"                   json:"id"`
	Name string                    `bson:"name"       yaml:"name"                   json:"name"`
	Type config.ReleasePlanJobType `bson:"type"       yaml:"type"                   json:"type"`
	Spec interface{}               `bson:"spec"       yaml:"spec"                   json:"spec"`

	ReleaseJobRuntime `bson:",inline" yaml:",inline" json:",inline"`
}

type ReleaseJobRuntime

type ReleaseJobRuntime struct {
	Status config.ReleasePlanJobStatus `bson:"status"     yaml:"status"                 json:"status"`
	// ReleasePlan can return to PlanningStatus when some release jobs have been executed
	// So we need to record the last status of the release job
	LastStatus config.ReleasePlanJobStatus `bson:"last_status"       yaml:"last_status"                   json:"last_status"`
	// Updated is used to indicate whether the release job has been updated
	Updated      bool   `bson:"updated"       yaml:"updated"                   json:"updated"`
	ExecutedBy   string `bson:"executed_by"       yaml:"executed_by"                   json:"executed_by"`
	ExecutedTime int64  `bson:"executed_time"       yaml:"executed_time"                   json:"executed_time"`
}

type ReleasePlan

type ReleasePlan struct {
	ID      primitive.ObjectID `bson:"_id,omitempty"       yaml:"-"                   json:"id"`
	Index   int64              `bson:"index"       yaml:"index"                   json:"index"`
	Name    string             `bson:"name"       yaml:"name"                   json:"name"`
	Manager string             `bson:"manager"       yaml:"manager"                   json:"manager"`
	// ManagerID is the user id of the manager
	ManagerID   string `bson:"manager_id"       yaml:"manager_id"                   json:"manager_id"`
	StartTime   int64  `bson:"start_time"       yaml:"start_time"                   json:"start_time"`
	EndTime     int64  `bson:"end_time"       yaml:"end_time"                   json:"end_time"`
	Description string `bson:"description"       yaml:"description"                   json:"description"`
	CreatedBy   string `bson:"created_by"       yaml:"created_by"                   json:"created_by"`
	CreateTime  int64  `bson:"create_time"       yaml:"create_time"                   json:"create_time"`
	UpdatedBy   string `bson:"updated_by"       yaml:"updated_by"                   json:"updated_by"`
	UpdateTime  int64  `bson:"update_time"       yaml:"update_time"                   json:"update_time"`

	Approval *Approval `bson:"approval"       yaml:"approval"                   json:"approval,omitempty"`

	Jobs []*ReleaseJob `bson:"jobs"       yaml:"jobs"                   json:"jobs"`

	Status config.ReleasePlanStatus `bson:"status"       yaml:"status"                   json:"status"`

	PlanningTime  int64 `bson:"planning_time"       yaml:"planning_time"                   json:"planning_time"`
	ApprovalTime  int64 `bson:"approval_time"       yaml:"approval_time"                   json:"approval_time"`
	ExecutingTime int64 `bson:"executing_time"       yaml:"executing_time"                   json:"executing_time"`
	SuccessTime   int64 `bson:"success_time"       yaml:"success_time"                   json:"success_time"`
}

func (ReleasePlan) TableName

func (ReleasePlan) TableName() string

type ReleasePlanLog

type ReleasePlanLog struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"                  json:"id"`
	PlanID     string             `bson:"plan_id"                    json:"plan_id"`
	Username   string             `bson:"username"                    json:"username"`
	Account    string             `bson:"account"                     json:"account"`
	Verb       string             `bson:"verb"                        json:"verb"`
	TargetName string             `bson:"target_name"                 json:"target_name"`
	TargetType string             `bson:"target_type"                 json:"target_type"`
	Before     interface{}        `bson:"before"                      json:"before"`
	After      interface{}        `bson:"after"                       json:"after"`
	Detail     string             `bson:"detail"                      json:"detail"`
	CreatedAt  int64              `bson:"created_at"                  json:"created_at"`
}

func (ReleasePlanLog) TableName

func (ReleasePlanLog) TableName() 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"`
	// yaml content, used as 'global variables' for helm projects, DEPRECATED for k8s since 1.18.0
	DefaultValues string `bson:"default_values,omitempty"       json:"default_values,omitempty"`
	// current only used for k8s
	GlobalVariables  []*commontypes.GlobalVariableKV `bson:"global_variables,omitempty"     json:"global_variables,omitempty"` // new since 1.18.0 replace DefaultValues
	YamlData         *templatemodels.CustomYaml      `bson:"yaml_data,omitempty"            json:"yaml_data,omitempty"`
	ServiceVariables []*templatemodels.ServiceRender `bson:"service_variables,omitempty"    json:"service_variables,omitempty"` // new since 1.16.0 replace kvs
	ChartInfos       []*templatemodels.ServiceRender `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) GetChartDeployRenderMap

func (m *RenderSet) GetChartDeployRenderMap() map[string]*templatemodels.ServiceRender

func (*RenderSet) GetChartRenderMap

func (m *RenderSet) GetChartRenderMap() map[string]*templatemodels.ServiceRender

func (*RenderSet) GetServiceRenderMap

func (m *RenderSet) GetServiceRenderMap() map[string]*templatemodels.ServiceRender

func (*RenderSet) HelmRenderDiff

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

func (*RenderSet) K8sServiceRenderDiff

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

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"`
	DeployEnabled bool   `json:"deploy_enabled" yaml:"deploy_enabled"`
	DeployEnv     string `json:"deploy_env"   yaml:"deploy_env"`
}

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 Resource

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

type ResourceType

type ResourceType string
const (
	ResourceTypePod           ResourceType = "Pod"
	ResourceTypeDeployment    ResourceType = "Deployment"
	ResourceTypeReplicaSet    ResourceType = "ReplicaSet"
	ResourceTypePVC           ResourceType = "PersistentVolumeClaim"
	ResourceTypeService       ResourceType = "Service"
	ResourceTypeIngress       ResourceType = "Ingress"
	ResourceTypeStatefulSet   ResourceType = "StatefulSet"
	ResourceTypeCronJob       ResourceType = "CronJob"
	ResourceTypeHPA           ResourceType = "HorizontalPodAutoScaler"
	ResourceTypePDB           ResourceType = "PodDisruptionBudget"
	ResourceTypeNetworkPolicy ResourceType = "NetworkPolicy"
)

type Resources

type Resources struct {
	Limits *Limits `json:"limits" bson:"limits"`
}

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"`
	Projects    []string           `bson:"projects"       json:"projects"`
	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"`
	Region      string             `bson:"region"         json:"region"`
}

func (S3Storage) TableName

func (s S3Storage) TableName() string

type SQLJobSpec

type SQLJobSpec struct {
	// ID db instance id
	ID     string                `bson:"id" json:"id" yaml:"id"`
	Type   config.DBInstanceType `bson:"type" json:"type" yaml:"type"`
	SQL    string                `bson:"sql" json:"sql" yaml:"sql"`
	Source string                `bson:"source" json:"source" yaml:"source"`
}

type Scanning

type Scanning struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Name        string             `bson:"name"          json:"name"`
	TemplateID  string             `bson:"template_id"   json:"template_id"`
	ProjectName string             `bson:"project_name"  json:"project_name"`
	Description string             `bson:"description"   json:"description"`
	ScannerType string             `bson:"scanner_type"  json:"scanner_type"`
	// EnableScanner indicates whether user uses sonar scanner instead of the script
	EnableScanner bool                `bson:"enable_scanner" json:"enable_scanner"`
	ImageID       string              `bson:"image_id"      json:"image_id"`
	SonarID       string              `bson:"sonar_id"      json:"sonar_id"`
	Repos         []*types.Repository `bson:"repos"         json:"repos"`
	Installs      []*Item             `bson:"installs"      json:"installs"`
	// Parameter is for sonarQube type only
	Parameter string `bson:"parameter" json:"parameter"`
	// Envs is the user defined key/values
	Envs []*KeyVal `bson:"envs" json:"envs"`
	// Script is for other type only
	Script           string                   `bson:"script"                json:"script"`
	AdvancedSetting  *ScanningAdvancedSetting `bson:"advanced_setting"      json:"advanced_setting"`
	CheckQualityGate bool                     `bson:"check_quality_gate"    json:"check_quality_gate"`
	Outputs          []*Output                `bson:"outputs"               json:"outputs"`

	CreatedAt int64  `bson:"created_at" json:"created_at"`
	UpdatedAt int64  `bson:"updated_at" json:"updated_at"`
	UpdatedBy string `bson:"updated_by" json:"updated_by"`
}

func (Scanning) TableName

func (Scanning) TableName() string

type ScanningAdvancedSetting

type ScanningAdvancedSetting struct {
	ClusterID        string                `bson:"cluster_id"        json:"cluster_id"`
	StrategyID       string                `bson:"strategy_id"       json:"strategy_id"`
	Timeout          int64                 `bson:"timeout"           json:"timeout"`
	ResReq           setting.Request       `bson:"res_req"           json:"res_req"`
	ResReqSpec       setting.RequestSpec   `bson:"res_req_spec"      json:"res_req_spec"`
	HookCtl          *ScanningHookCtl      `bson:"hook_ctl"          json:"hook_ctl"`
	NotifyCtls       []*NotifyCtl          `bson:"notify_ctls"       json:"notify_ctls"`
	Cache            *ScanningCacheSetting `bson:"cache"             json:"cache"`
	ConcurrencyLimit int                   `bson:"concurrency_limit" json:"concurrency_limit"`
}

type ScanningArgs

type ScanningArgs struct {
	ScanningName string `json:"scanning_name" bson:"scanning_name"`
	ScanningID   string `json:"scanning_id"   bson:"scanning_id"`

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

type ScanningCacheSetting

type ScanningCacheSetting struct {
	CacheEnable  bool               `bson:"cache_enable"        json:"cache_enable"`
	CacheDirType types.CacheDirType `bson:"cache_dir_type"      json:"cache_dir_type"`
	CacheUserDir string             `bson:"cache_user_dir"      json:"cache_user_dir"`
}

type ScanningHook

type ScanningHook struct {
	CodehostID   int                    `bson:"codehost_id"   json:"codehost_id"`
	Source       string                 `bson:"source"        json:"source"`
	RepoOwner    string                 `bson:"repo_owner"    json:"repo_owner"`
	RepoName     string                 `bson:"repo_name"     json:"repo_name"`
	Branch       string                 `bson:"branch"        json:"branch"`
	Events       []config.HookEventType `bson:"events"        json:"events"`
	MatchFolders []string               `bson:"match_folders" json:"match_folders"`
	IsRegular    bool                   `bson:"is_regular"    json:"is_regular"`
	IsManual     bool                   `bson:"is_manual"     json:"is_manual"`
}

type ScanningHookCtl

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

type ScanningModule

type ScanningModule struct {
	Name             string              `bson:"name"                yaml:"name"             json:"name"`
	ProjectName      string              `bson:"project_name"        yaml:"project_name"     json:"project_name"`
	Repos            []*types.Repository `bson:"repos"               yaml:"repos"            json:"repos"`
	KeyVals          []*KeyVal           `bson:"key_vals"            yaml:"key_vals"         json:"key_vals"`
	ShareStorageInfo *ShareStorageInfo   `bson:"share_storage_info"   yaml:"share_storage_info"   json:"share_storage_info"`
}

type ScanningTemplate

type ScanningTemplate struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Name        string             `bson:"name"          json:"name"`
	ScannerType string             `bson:"scanner_type"  json:"scanner_type"`
	// EnableScanner indicates whether user uses sonar scanner instead of the script
	EnableScanner bool    `bson:"enable_scanner" json:"enable_scanner"`
	ImageID       string  `bson:"image_id"      json:"image_id"`
	SonarID       string  `bson:"sonar_id"      json:"sonar_id"`
	Installs      []*Item `bson:"installs"      json:"installs"`
	// Parameter is for sonarQube type only
	Parameter string `bson:"parameter" json:"parameter"`
	// Envs is the user defined key/values
	Envs []*KeyVal `bson:"envs" json:"envs"`
	// Script is for other type only
	Script           string                   `bson:"script"                json:"script"`
	AdvancedSetting  *ScanningAdvancedSetting `bson:"advanced_settings"      json:"advanced_settings"`
	CheckQualityGate bool                     `bson:"check_quality_gate"    json:"check_quality_gate"`

	CreatedAt int64  `bson:"created_at" json:"created_at"`
	UpdatedAt int64  `bson:"updated_at" json:"updated_at"`
	UpdatedBy string `bson:"updated_by" json:"updated_by"`
}

func (ScanningTemplate) TableName

func (ScanningTemplate) 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"`
	WorkflowV4Args  *WorkflowV4         `bson:"workflow_v4_args"              json:"workflow_v4_args"`
	EnvAnalysisArgs *EnvArgs            `bson:"env_analysis_args,omitempty"   json:"env_analysis_args,omitempty"`
	EnvArgs         *EnvArgs            `bson:"env_args,omitempty"            json:"env_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 ScheduleStrategy

type ScheduleStrategy struct {
	StrategyID   string                     `json:"strategy_id"   bson:"strategy_id"`
	StrategyName string                     `json:"strategy_name" bson:"strategy_name"`
	Strategy     string                     `json:"strategy"      bson:"strategy"`
	NodeLabels   []*NodeSelectorRequirement `json:"node_labels"   bson:"node_labels"`
	Tolerations  string                     `json:"tolerations"   bson:"tolerations"`
	Default      bool                       `json:"default"       bson:"default"`
}

type SecuritySettings

type SecuritySettings struct {
	TokenExpirationTime int64 `json:"token_expiration_time" bson:"token_expiration_time"`
}

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"`
	RenderedYaml       string                           `bson:"-"                              json:"-"`
	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"` // DEPRECATED since 1.17.0
	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"`
	GiteePath          string                           `bson:"gitee_path,omitempty"           json:"gitee_path,omitempty"`
	BuildName          string                           `bson:"build_name"                     json:"build_name"`
	VariableYaml       string                           `bson:"variable_yaml"                  json:"variable_yaml"`        // New since 1.16.0, stores the variable yaml of k8s services
	ServiceVariableKVs []*commontypes.ServiceVariableKV `bson:"service_variable_kvs"           json:"service_variable_kvs"` // New since 1.18.0, stores the variable kvs of k8s services
	ServiceVars        []string                         `bson:"service_vars"                   json:"service_vars"`         // DEPRECATED, New since 1.16.0, stores keys in variables which can be set in env
	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"`
	ReleaseNaming      string                           `bson:"release_naming"                 json:"release_naming"`
	CodehostID         int                              `bson:"codehost_id,omitempty"          json:"codehost_id,omitempty"`
	RepoOwner          string                           `bson:"repo_owner,omitempty"           json:"repo_owner,omitempty"`
	RepoNamespace      string                           `bson:"repo_namespace,omitempty"       json:"repo_namespace,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"` // WorkloadType is set in host projects
	EnvName            string                           `bson:"env_name,omitempty"             json:"env_name,omitempty"`
	DeployTime         int64                            `bson:"deploy_time,omitempty"          json:"deploy_time,omitempty"`
	TemplateID         string                           `bson:"template_id,omitempty"          json:"template_id,omitempty"`
	AutoSync           bool                             `bson:"auto_sync"                      json:"auto_sync"`
	Production         bool                             `bson:"-"                              json:"-"` // check current service data is production service
}

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) GetReleaseNaming

func (svc *Service) GetReleaseNaming() string

func (*Service) GetRepoNamespace

func (svc *Service) GetRepoNamespace() string

func (Service) TableName

func (Service) TableName() string

type ServiceAndBuild

type ServiceAndBuild struct {
	ServiceName      string              `bson:"service_name"        yaml:"service_name"         json:"service_name"`
	ServiceModule    string              `bson:"service_module"      yaml:"service_module"       json:"service_module"`
	BuildName        string              `bson:"build_name"          yaml:"build_name"           json:"build_name"`
	Image            string              `bson:"image"               yaml:"-"                    json:"image"`
	Package          string              `bson:"package"             yaml:"-"                    json:"package"`
	ImageName        string              `bson:"image_name"          yaml:"image_name"           json:"image_name"`
	KeyVals          []*KeyVal           `bson:"key_vals"            yaml:"key_vals"             json:"key_vals"`
	Repos            []*types.Repository `bson:"repos"               yaml:"repos"                json:"repos"`
	ShareStorageInfo *ShareStorageInfo   `bson:"share_storage_info"  yaml:"share_storage_info"   json:"share_storage_info"`
}

type ServiceAndImage

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

type ServiceAndTest

type ServiceAndTest struct {
	ServiceName   string `bson:"service_name"        yaml:"service_name"     json:"service_name"`
	ServiceModule string `bson:"service_module"      yaml:"service_module"   json:"service_module"`
	TestModule    `bson:",inline"  yaml:",inline"  json:",inline"`
}

type ServiceAndVMDeploy

type ServiceAndVMDeploy struct {
	Repos         []*types.Repository `bson:"repos"               yaml:"repos"            json:"repos"`
	ServiceName   string              `bson:"service_name"        yaml:"service_name"     json:"service_name"`
	ServiceModule string              `bson:"service_module"      yaml:"service_module"   json:"service_module"`
	ArtifactURL   string              `bson:"artifact_url"        yaml:"artifact_url"     json:"artifact_url"`
	FileName      string              `bson:"file_name"           yaml:"file_name"        json:"file_name"`
	Image         string              `bson:"image"               yaml:"image"            json:"image"`
	TaskID        int                 `bson:"task_id"             yaml:"task_id"          json:"task_id"`
	WorkflowType  config.PipelineType `bson:"workflow_type"       yaml:"workflow_type"    json:"workflow_type"`
	WorkflowName  string              `bson:"workflow_name"       yaml:"workflow_name"    json:"workflow_name"`
	JobTaskName   string              `bson:"job_task_name"       yaml:"job_task_name"    json:"job_task_name"`
}

type ServiceConfig

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

type ServiceKeyVal

type ServiceKeyVal struct {
	Key          string               `bson:"key"                       json:"key"                         yaml:"key"`
	Value        interface{}          `bson:"value"                     json:"value"                       yaml:"value"`
	Type         ParameterSettingType `bson:"type,omitempty"            json:"type,omitempty"              yaml:"type"`
	ChoiceOption []string             `bson:"choice_option,omitempty"   json:"choice_option,omitempty"     yaml:"choice_option,omitempty"`
	IsCredential bool                 `bson:"is_credential"             json:"is_credential"               yaml:"is_credential"`
}

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"`
	BuildName     string              `bson:"build_name"                    json:"build_name"`
	Repos         []*types.Repository `bson:"repos,omitempty"               json:"repos,omitempty"`
	Envs          []*KeyVal           `bson:"envs,omitempty"                json:"envs"`
}

type ServiceModuleTargetBase

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

type ServiceNameAndModule

type ServiceNameAndModule struct {
	ServiceName   string `bson:"service_name" json:"service_name" yaml:"service_name"`
	ServiceModule string `bson:"service_module" json:"service_module" yaml:"service_module"`
}

type ServiceResource

type ServiceResource struct {
	schema.GroupVersionKind
	Name string
}

func (*ServiceResource) String

func (r *ServiceResource) String() string

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 ServiceTestTarget

type ServiceTestTarget struct {
	ServiceName   string `bson:"service_name"        yaml:"service_name"     json:"service_name"`
	ServiceModule string `bson:"service_module"      yaml:"service_module"   json:"service_module"`
}

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 ServiceTriggerWorkflowInfo

type ServiceTriggerWorkflowInfo struct {
	ServiceName   string   `bson:"service_name" json:"service_name" yaml:"service_name"`
	ServiceModule string   `bson:"service_module" json:"service_module" yaml:"service_module"`
	WorkflowName  string   `bson:"workflow_name" json:"workflow_name" yaml:"workflow_name"`
	ProjectName   string   `bson:"project_name" json:"project_name" yaml:"project_name"`
	Params        []*Param `bson:"params" json:"params" yaml:"params"`
}

type ServiceWithModuleAndImage added in v2.3.0

type ServiceWithModuleAndImage struct {
	ServiceName    string              `bson:"service_name"        yaml:"service_name"     json:"service_name"`
	ServiceModules []*DeployModuleInfo `bson:"service_modules"     yaml:"service_modules"  json:"service_modules"`
}

type ServicesInExternalEnv

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

func (ServicesInExternalEnv) TableName() string

type ShareStorage

type ShareStorage struct {
	Name string `bson:"name"             json:"name"             yaml:"name"`
	Path string `bson:"path"             json:"path"             yaml:"path"`
}

type ShareStorageInfo

type ShareStorageInfo struct {
	Enabled       bool            `bson:"enabled"             json:"enabled"             yaml:"enabled"`
	ShareStorages []*ShareStorage `bson:"share_storages"      json:"share_storages"      yaml:"share_storages"`
}

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 SonarInfo

type SonarInfo struct {
	ServerAddress string `bson:"server_address" json:"server_address"`
	Token         string `bson:"token"          json:"token"`
}

type SonarIntegration

type SonarIntegration struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"`
	SystemIdentity string             `bson:"system_identity"`
	ServerAddress  string             `bson:"server_address"`
	Token          string             `bson:"token"`
}

func (SonarIntegration) TableName

func (SonarIntegration) TableName() string

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                              `bson:"after_all"          json:"after_all"`
	StartTime   int64                             `bson:"start_time" json:"start_time"`
	EndTime     int64                             `bson:"end_time" json:"end_time"`
	Error       string                            `bson:"error" json:"error"`
	TypeName    string                            `bson:"-" json:"name,omitempty"`
}

Stage ...

type StagePreview

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

type StageTask

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

type StatDashboardConfig

type StatDashboardConfig struct {
	ID        string     `bson:"_id,omitempty"`
	Type      string     `bson:"type"`
	ItemKey   string     `bson:"item_key"`
	Name      string     `bson:"name"`
	Source    string     `bson:"source"`
	APIConfig *APIConfig `bson:"api_config,omitempty"`
	Function  string     `bson:"function"`
	Weight    int64      `bson:"weight"`
}

func (StatDashboardConfig) TableName

func (StatDashboardConfig) TableName() string

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 Step

type Step struct {
	Name     string          `bson:"name"           json:"name"             yaml:"name"`
	Timeout  int64           `bson:"timeout"        json:"timeout"          yaml:"timeout"`
	StepType config.StepType `bson:"type"           json:"type"             yaml:"type"`
	Spec     interface{}     `bson:"spec"           json:"spec"             yaml:"spec"`
}

type StepTask

type StepTask struct {
	Name      string          `bson:"name"           json:"name"         yaml:"name"`
	JobName   string          `bson:"job_name"       json:"job_name"     yaml:"job_name"`
	Error     string          `bson:"error"          json:"error"        yaml:"error"`
	StepType  config.StepType `bson:"type"           json:"type"         yaml:"type"`
	Onfailure bool            `bson:"on_failure"     json:"on_failure"   yaml:"on_failure"`
	// step input params,differ form steps
	Spec interface{} `bson:"spec"           json:"spec"   yaml:"spec"`
	// step output results,like testing results,differ form steps
	Result interface{} `bson:"result"         json:"result"  yaml:"result"`
}

type StorageDetail

type StorageDetail struct {
	Type      types.MediumType `bson:"type"             json:"type"             yaml:"type"`
	Name      string           `bson:"name"             json:"name"             yaml:"name"`
	SubPath   string           `bson:"sub_path"         json:"sub_path"         yaml:"sub_path"`
	MountPath string           `bson:"mount_path"       json:"mount_path"       yaml:"mount_path"`
}

type StringMatchType

type StringMatchType string
var (
	StringMatchPrefix StringMatchType = "prefix"
	StringMatchExact  StringMatchType = "exact"
	StringMatchRegex  StringMatchType = "regex"
)

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 SystemSetting

type SystemSetting struct {
	ID                  primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	WorkflowConcurrency int64              `bson:"workflow_concurrency" json:"workflow_concurrency"`
	BuildConcurrency    int64              `bson:"build_concurrency" json:"build_concurrency"`
	DefaultLogin        string             `bson:"default_login" json:"default_login"`
	Theme               *Theme             `bson:"theme" json:"theme"`
	Security            *SecuritySettings  `bson:"security" json:"security"`
	Privacy             *PrivacySettings   `bson:"privacy"  json:"privacy"`
	UpdateTime          int64              `bson:"update_time" json:"update_time"`
}

func (SystemSetting) TableName

func (SystemSetting) TableName() string

type TarInfo

type TarInfo struct {
	URL          string `bson:"url"                 json:"url"`
	Name         string `bson:"name"                json:"name"`
	WorkflowName string `bson:"workflow_name"       json:"workflow_name"`
	WorkflowType string `bson:"workflow_type"       json:"workflow_type"`
	JobTaskName  string `bson:"job_task_name"       json:"job_task_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"`
	ImageName        string            `bson:"image_name"                    json:"image_name"`
	ServiceName      string            `bson:"service_name"                  json:"service_name"`
	ServiceType      string            `bson:"service_type,omitempty"        json:"service_type,omitempty"`
	ProductName      string            `bson:"product_name"                  json:"product_name"`
	Build            *BuildArgs        `bson:"build"                         json:"build"`
	Deploy           []DeployEnv       `bson:"deploy"                        json:"deploy"`
	Image            string            `bson:"image,omitempty"               json:"image,omitempty"`
	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,omitempty"  json:"jenkins_build_args,omitempty"`
	BuildName        string            `bson:"build_name,omitempty"          json:"build_name"`
}

type TargetRepo

type TargetRepo struct {
	Service *ServiceModuleTargetBase `json:"service"`
	Repos   []*types.Repository      `json:"repos"`
	Envs    []*KeyVal                `json:"envs"`
}

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 TaskJobInfo

type TaskJobInfo struct {
	RandStr       string `bson:"rand_str"        json:"rand_str"`
	TestType      string `bson:"test_type"       json:"test_type"`
	TestingName   string `bson:"testing_name"    json:"testing_name"`
	JobName       string `bson:"job_name"        json:"job_name"`
	ServiceName   string `bson:"service_name"    json:"service_name"`
	ServiceModule string `bson:"service_module"  json:"service_module"`
}

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"`
	Project string    `bson:"project"               json:"project"`
}

TestExecArgs ...

type TestModule

type TestModule struct {
	Name             string              `bson:"name"                yaml:"name"             json:"name"`
	ProjectName      string              `bson:"project_name"        yaml:"project_name"     json:"project_name"`
	KeyVals          []*KeyVal           `bson:"key_vals"            yaml:"key_vals"         json:"key_vals"`
	Repos            []*types.Repository `bson:"repos"               yaml:"repos"            json:"repos"`
	ShareStorageInfo *ShareStorageInfo   `bson:"share_storage_info"   yaml:"share_storage_info"   json:"share_storage_info"`
}

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 TestStatsInProperties

type TestStatsInProperties struct {
	RunningJobName string  `bson:"running_job_name" json:"running_job_name"`
	Type           string  `bson:"type" json:"type"`
	TestName       string  `bson:"name" json:"name"`
	TestCaseNum    int     `bson:"total_case_num" json:"total_case_num"`
	SuccessCaseNum int     `bson:"success_case_num" json:"success_case_num"`
	TestTime       float64 `bson:"time" json:"time"`
}

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:"suite_type"              json:"suite_type"               xml:"suite_type"`
	Name      string     `bson:"name"                    json:"name"                     xml:"name"`
}

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"`
	RepoNamespace  string `bson:"repo_namespace"   json:"repo_namespace"`
	RepoName       string `bson:"repo_name"        json:"repo_name"`
	Ref            string `bson:"ref" json:"ref"`
	Branch         string `bson:"branch" json:"branch"`
	EventType      string `bson:"event_type" json:"event_type"`
}

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"                    json:"repos"`
	PreTest     *PreTest            `bson:"pre_test"                 json:"pre_test"`
	PostTest    *PostTest           `bson:"post_test"                json:"post_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"`

	// TODO: Deprecated.
	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"`
	// TODO: Deprecated.
	NotifyCtl *NotifyCtl `bson:"notify_ctl,omitempty"     json:"notify_ctl,omitempty"`
	// New since V1.12.0.
	NotifyCtls      []*NotifyCtl `bson:"notify_ctls"     json:"notify_ctls"`
	ScheduleEnabled bool         `bson:"schedule_enabled"         json:"-"`

	// New since V1.10.0.
	CacheEnable  bool               `bson:"cache_enable"              json:"cache_enable"`
	CacheDirType types.CacheDirType `bson:"cache_dir_type"            json:"cache_dir_type"`
	CacheUserDir string             `bson:"cache_user_dir"            json:"cache_user_dir"`
	// New since V1.10.0. Only to tell the webpage should the advanced settings be displayed
	AdvancedSettingsModified bool      `bson:"advanced_setting_modified" json:"advanced_setting_modified"`
	Outputs                  []*Output `bson:"outputs"                   json:"outputs"`
}

func (Testing) TableName

func (Testing) TableName() string

type TestingHook

type TestingHook struct {
	AutoCancel bool          `bson:"auto_cancel" json:"auto_cancel"`
	IsManual   bool          `bson:"is_manual"   json:"is_manual"`
	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 TextReleaseJobSpec

type TextReleaseJobSpec struct {
	Content string `bson:"content"       yaml:"content"                   json:"content"`
	Remark  string `bson:"remark"       yaml:"remark"                   json:"remark"`
}

type Theme

type Theme struct {
	ThemeType   string       `bson:"theme_type" json:"theme_type"`
	CustomTheme *CustomTheme `bson:"custom_theme" json:"custom_theme"`
}

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"`
	RepoNamespace string `bson:"repo_namespace" json:"repo_namespace"`
	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 `bson:"commit_id,omitempty" json:"commit_id,omitempty"`
	// the git branch which triggered this task
	Ref       string `bson:"ref" json:"ref"`
	EventType string `bson:"event_type" json:"event_type"`
}

type UpdateEnvIstioConfigJobSpec added in v2.3.0

type UpdateEnvIstioConfigJobSpec struct {
	Production         bool                     `bson:"production"            json:"production"             yaml:"production"`
	BaseEnv            string                   `bson:"base_env"              json:"base_env"               yaml:"base_env"`
	Source             string                   `bson:"source"                json:"source"                 yaml:"source"`
	GrayscaleStrategy  GrayscaleStrategyType    `bson:"grayscale_strategy"    json:"grayscale_strategy"     yaml:"grayscale_strategy"`
	WeightConfigs      []IstioWeightConfig      `bson:"weight_configs"        json:"weight_configs"         yaml:"weight_configs"`
	HeaderMatchConfigs []IstioHeaderMatchConfig `bson:"header_match_configs"  json:"header_match_configs"   yaml:"header_match_configs"`
}

type User

type User struct {
	Type            string                 `bson:"type"                        yaml:"type"                       json:"type"`
	UserID          string                 `bson:"user_id,omitempty"           yaml:"user_id,omitempty"          json:"user_id,omitempty"`
	UserName        string                 `bson:"user_name,omitempty"         yaml:"user_name,omitempty"        json:"user_name,omitempty"`
	GroupID         string                 `bson:"group_id,omitempty"          yaml:"group_id,omitempty"         json:"group_id,omitempty"`
	GroupName       string                 `bson:"group_name,omitempty"        yaml:"group_name,omitempty"       json:"group_name,omitempty"`
	RejectOrApprove config.ApproveOrReject `bson:"reject_or_approve"           yaml:"-"                          json:"reject_or_approve"`
	Comment         string                 `bson:"comment"                     yaml:"-"                          json:"comment"`
	OperationTime   int64                  `bson:"operation_time"              yaml:"-"                          json:"operation_time"`
}

type VMAgent

type VMAgent struct {
	Token             string `bson:"token"                json:"-"`
	Workspace         string `bson:"workspace"            json:"workspace"`
	TaskConcurrency   int    `bson:"task_concurrency"     json:"task_concurrency"`
	CacheType         string `bson:"cache_type"           json:"cache_type"`
	CachePath         string `bson:"cache_path"           json:"cache_path"`
	ObjectID          string `bson:"object_id"            json:"object_id"`
	NeedUpdate        bool   `bson:"need_update"          json:"need_update"`
	AgentVersion      string `bson:"agent_version"        json:"agent_version"`
	ZadigVersion      string `bson:"zadig_version"        json:"zadig_version"`
	LastHeartbeatTime int64  `bson:"last_heartbeat_time"  json:"last_heartbeat_time"`
}

type VMInfo

type VMInfo struct {
	IP            string `bson:"ip"                   json:"ip"`
	Platform      string `bson:"platform"             json:"platform"`
	Architecture  string `bson:"architecture"         json:"architecture"`
	MemeryTotal   uint64 `bson:"memery_total"         json:"memery_total"`
	UsedMemery    uint64 `bson:"used_memery"          json:"used_memery"`
	CpuNum        int    `bson:"cpu_num"              json:"cpu_num"`
	DiskSpace     uint64 `bson:"disk_space"           json:"disk_space"`
	FreeDiskSpace uint64 `bson:"free_disk_space"      json:"free_disk_space"`
	HostName      string `bson:"host_name"            json:"host_name"`
}

type Variable

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

type VariableKV

type VariableKV struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

type VariableSet

type VariableSet struct {
	ID           primitive.ObjectID `bson:"_id,omitempty"          json:"id,omitempty"`
	Name         string             `bson:"name"                   json:"name"`
	Description  string             `bson:"description"            json:"description"`
	ProjectName  string             `bson:"project_name"           json:"project_name"`
	VariableYaml string             `bson:"variable_yaml"          json:"variable_yaml"`
	CreatedAt    int64              `bson:"created_at"             json:"created_at"`
	CreatedBy    string             `bson:"created_by"             json:"created_by"`
	UpdatedAt    int64              `bson:"updated_at"             json:"updated_at"`
	UpdatedBy    string             `bson:"updated_by"              json:"updated_by"`
}

func (VariableSet) TableName

func (VariableSet) TableName() string

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 WebHookType

type WebHookType string
const (
	WebHookTypeFeishu   WebHookType = "feishu"
	WebHookTypeDingding WebHookType = "dingding"
	WebHookTypeWeChat   WebHookType = "wechat"
)

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"`
	DisplayName     string             `bson:"display_name"                 json:"display_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"`
	ExtensionStage  *ExtensionStage    `bson:"extension_stage"              json:"extension_stage"`
	// TODO: Deprecated.
	NotifyCtl *NotifyCtl `bson:"notify_ctl,omitempty"         json:"notify_ctl,omitempty"`
	// New since V1.12.0.
	NotifyCtls []*NotifyCtl      `bson:"notify_ctls"        json:"notify_ctls"`
	HookCtl    *WorkflowHookCtrl `bson:"hook_ctl"                     json:"hook_ctl"`
	BaseName   string            `bson:"base_name" json:"base_name"`

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

func (Workflow) TableName

func (Workflow) TableName() string

type WorkflowEnv

type WorkflowEnv struct {
	EnvName    string `json:"env_name"`
	Production bool   `json:"production"`
}

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"`
	IsYaml              bool              `bson:"is_yaml,omitempty"         json:"is_yaml,omitempty"`
	IsManual            bool              `bson:"is_manual,omitempty"       json:"is_manual,omitempty"`
	YamlPath            string            `bson:"yaml_path,omitempty"       json:"yaml_path,omitempty"`
}

type WorkflowHookCtrl

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

type WorkflowQueue

type WorkflowQueue struct {
	ID                  primitive.ObjectID            `bson:"_id,omitempty"                              json:"id,omitempty"`
	TaskID              int64                         `bson:"task_id"                                    json:"task_id"`
	ProjectName         string                        `bson:"project_name"                               json:"project_name"`
	WorkflowName        string                        `bson:"workflow_name"                              json:"workflow_name"`
	WorkflowDisplayName string                        `bson:"workflow_display_name"                      json:"workflow_display_name"`
	Status              config.Status                 `bson:"status"                                     json:"status,omitempty"`
	Stages              []*StageTask                  `bson:"stages"                                     json:"stages"`
	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"`
	Type                config.CustomWorkflowTaskType `bson:"type"                                       json:"type,omitempty"`
}

func (WorkflowQueue) TableName

func (WorkflowQueue) TableName() string

type WorkflowReleaseJobSpec

type WorkflowReleaseJobSpec struct {
	Workflow *WorkflowV4   `bson:"workflow"       yaml:"workflow"                   json:"workflow"`
	Status   config.Status `bson:"status"       yaml:"status"                   json:"status"`
	TaskID   int64         `bson:"task_id"       yaml:"task_id"                   json:"task_id"`
}

type WorkflowServiceModule

type WorkflowServiceModule struct {
	ServiceModule string              `bson:"service_module" json:"service_module"`
	ServiceName   string              `bson:"service_name"   json:"service_name"`
	CodeInfo      []*types.Repository `bson:"code_info"      json:"code_info"`
}

type WorkflowStage

type WorkflowStage struct {
	Name     string    `bson:"name"          yaml:"name"         json:"name"`
	Parallel bool      `bson:"parallel"      yaml:"parallel"     json:"parallel"`
	Approval *Approval `bson:"approval"      yaml:"approval"     json:"approval"`
	Jobs     []*Job    `bson:"jobs"          yaml:"jobs"         json:"jobs"`
}

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 WorkflowTask

type WorkflowTask struct {
	ID                  primitive.ObjectID            `bson:"_id,omitempty"             json:"id,omitempty"`
	TaskID              int64                         `bson:"task_id"                   json:"task_id"`
	WorkflowName        string                        `bson:"workflow_name"             json:"workflow_name"`
	WorkflowDisplayName string                        `bson:"workflow_display_name"     json:"workflow_display_name"`
	Params              []*Param                      `bson:"params"                    json:"params"`
	WorkflowArgs        *WorkflowV4                   `bson:"workflow_args"             json:"workflow_args"`
	OriginWorkflowArgs  *WorkflowV4                   `bson:"origin_workflow_args"      json:"origin_workflow_args"`
	KeyVals             []*KeyVal                     `bson:"key_vals"                  json:"key_vals"`
	GlobalContext       map[string]string             `bson:"global_context"            json:"global_context"`
	ClusterIDMap        map[string]bool               `bson:"cluster_id_map"            json:"cluster_id_map"`
	Status              config.Status                 `bson:"status"                    json:"status,omitempty"`
	TaskCreator         string                        `bson:"task_creator"              json:"task_creator,omitempty"`
	TaskCreatorPhone    string                        `bson:"task_creator_phone"        json:"task_creator_phone"`
	TaskCreatorEmail    string                        `bson:"task_creator_email"        json:"task_creator_email"`
	TaskRevoker         string                        `bson:"task_revoker,omitempty"    json:"task_revoker,omitempty"`
	CreateTime          int64                         `bson:"create_time"               json:"create_time,omitempty"`
	StartTime           int64                         `bson:"start_time"                json:"start_time,omitempty"`
	EndTime             int64                         `bson:"end_time"                  json:"end_time,omitempty"`
	Stages              []*StageTask                  `bson:"stages"                    json:"stages"`
	ProjectName         string                        `bson:"project_name,omitempty"    json:"project_name,omitempty"`
	IsDeleted           bool                          `bson:"is_deleted"                json:"is_deleted"`
	IsArchived          bool                          `bson:"is_archived"               json:"is_archived"`
	Error               string                        `bson:"error,omitempty"           json:"error,omitempty"`
	IsRestart           bool                          `bson:"is_restart"                json:"is_restart"`
	IsDebug             bool                          `bson:"is_debug"                  json:"is_debug"`
	ShareStorages       []*ShareStorage               `bson:"share_storages"            json:"share_storages"`
	Type                config.CustomWorkflowTaskType `bson:"type"                      json:"type"`
}

func (*WorkflowTask) Finished

func (task *WorkflowTask) Finished() bool

func (WorkflowTask) TableName

func (WorkflowTask) 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"`
	Ref            string `bson:"ref" json:"ref"`
	EventType      string `bson:"event_type" json:"event_type"`
	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"`
	RepoNamespace  string `bson:"repo_namespace"   json:"repo_namespace"`
	RepoName       string `bson:"repo_name"        json:"repo_name"`
	Committer      string `bson:"committer,omitempty"        json:"committer,omitempty"`
	//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"`
	EnvName     string `json:"env_name" bson:"-"`

	Callback      *CallbackArgs   `bson:"callback"                    json:"callback"`
	ReleaseImages []*ReleaseImage `bson:"release_images,omitempty"    json:"release_images,omitempty"`
}

WorkflowTaskArgs 多服务工作流任务参数

type WorkflowTaskCtx

type WorkflowTaskCtx struct {
	WorkflowName                string
	WorkflowDisplayName         string
	ProjectName                 string
	TaskID                      int64
	DockerHost                  string
	Workspace                   string
	DistDir                     string
	DockerMountDir              string
	ConfigMapMountDir           string
	WorkflowTaskCreatorUsername string
	WorkflowTaskCreatorEmail    string
	WorkflowTaskCreatorMobile   string
	WorkflowKeyVals             []*KeyVal
	GlobalContextGetAll         func() map[string]string
	GlobalContextGet            func(key string) (string, bool)
	GlobalContextSet            func(key, value string)
	GlobalContextEach           func(f func(k, v string) bool)
	ClusterIDAdd                func(clusterID string)
	SetStatus                   func(status config.Status)
	StartTime                   time.Time
}

type WorkflowTaskPreview

type WorkflowTaskPreview struct {
	TaskID              int64           `bson:"task_id"               json:"task_id"`
	TaskCreator         string          `bson:"task_creator"          json:"task_creator"`
	ProjectName         string          `bson:"project_name"          json:"project_name"`
	WorkflowName        string          `bson:"workflow_name"         json:"workflow_name"`
	WorkflowDisplayName string          `bson:"workflow_display_name" json:"workflow_display_name"`
	Status              config.Status   `bson:"status"                json:"status"`
	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"`
	WorkflowArgs        *WorkflowV4     `bson:"workflow_args"         json:"-"`
	Stages              []*StagePreview `bson:"stages"                json:"stages,omitempty"`
}

type WorkflowTaskStatusCtx added in v2.3.0

type WorkflowTaskStatusCtx struct {
	TaskID              int64         `bson:"task_id"                   json:"task_id"`
	Executor            string        `bson:"executor"                  json:"executor"`
	ProductName         string        `bson:"product_name"              json:"product_name"`
	WorkflowName        string        `bson:"workflow_name"             json:"workflow_name"`
	WorkflowDisplayName string        `bson:"workflow_display_name"     json:"workflow_display_name"`
	Status              config.Status `bson:"status"                    json:"status,omitempty"`
}

type WorkflowTestModule

type WorkflowTestModule struct {
	RunningJobName string  `json:"running_job_name"`
	Type           string  `json:"type"`
	TestName       string  `json:"name"`
	TestCaseNum    int     `json:"total_case_num"`
	SuccessCaseNum int     `json:"success_case_num"`
	TestTime       float64 `json:"time"`
	Error          string  `json:"error"`
}

type WorkflowTriggerEvent

type WorkflowTriggerEvent struct {
	ServiceName         string        `bson:"service_name" json:"service_name" yaml:"service_name"`
	ServiceModule       string        `bson:"service_module" json:"service_module" yaml:"service_module"`
	WorkflowName        string        `bson:"workflow_name" json:"workflow_name" yaml:"workflow_name"`
	WorkflowDisplayName string        `bson:"workflow_display_name" json:"workflow_display_name" yaml:"workflow_display_name"`
	TaskID              int64         `bson:"task_id" json:"task_id" yaml:"task_id"`
	Status              config.Status `bson:"status" json:"status" yaml:"status"`
	Params              []*Param      `bson:"params" json:"params" yaml:"params"`
	ProjectName         string        `bson:"project_name" json:"project_name" yaml:"project_name"`
}

type WorkflowTriggerJobSpec

type WorkflowTriggerJobSpec struct {
	IsEnableCheck bool                       `bson:"is_enable_check" json:"is_enable_check" yaml:"is_enable_check"`
	TriggerType   config.WorkflowTriggerType `bson:"trigger_type" json:"trigger_type" yaml:"trigger_type"`
	// FixedWorkflowList is the only field used for trigger_type = fixed
	FixedWorkflowList []*ServiceTriggerWorkflowInfo `bson:"fixed_workflow_list" json:"fixed_workflow_list" yaml:"fixed_workflow_list"`

	// ServiceTriggerWorkflow and other fields are used for trigger_type = common
	ServiceTriggerWorkflow []*ServiceTriggerWorkflowInfo    `bson:"service_trigger_workflow" json:"service_trigger_workflow" yaml:"service_trigger_workflow"`
	Source                 config.TriggerWorkflowSourceType `bson:"source" json:"source" yaml:"source"`
	SourceJobName          string                           `bson:"source_job_name" json:"source_job_name" yaml:"source_job_name"`
	SourceService          []*ServiceNameAndModule          `bson:"source_service" json:"source_service" yaml:"source_service"`
}

type WorkflowV3

type WorkflowV3 struct {
	ID          primitive.ObjectID       `bson:"_id,omitempty"  json:"id,omitempty"`
	Name        string                   `bson:"name"           json:"name"`
	ProjectName string                   `bson:"project_name"   json:"project_name"`
	Description string                   `bson:"description"    json:"description"`
	Parameters  []*ParameterSetting      `bson:"parameters"     json:"parameters"`
	SubTasks    []map[string]interface{} `bson:"sub_tasks"      json:"sub_tasks"`
	CreatedBy   string                   `bson:"created_by"     json:"created_by"`
	CreateTime  int64                    `bson:"create_time"    json:"create_time"`
	UpdatedBy   string                   `bson:"updated_by"     json:"updated_by"`
	UpdateTime  int64                    `bson:"update_time"    json:"update_time"`
}

func (WorkflowV3) TableName

func (WorkflowV3) TableName() string

type WorkflowV3Args

type WorkflowV3Args struct {
	ID          string              `bson:"id"                      json:"id"`
	ProjectName string              `bson:"project_name"            json:"project_name"`
	Name        string              `bson:"name"                    json:"name"`
	Builds      []*types.Repository `bson:"builds"                  json:"builds"`
	BuildArgs   []*KeyVal           `bson:"build_args"              json:"build_args"`
}

WorkflowV3Args 工作流v3任务参数

type WorkflowV4

type WorkflowV4 struct {
	ID              primitive.ObjectID       `bson:"_id,omitempty"       yaml:"-"                   json:"id"`
	Name            string                   `bson:"name"                yaml:"name"                json:"name"`
	DisplayName     string                   `bson:"display_name"        yaml:"display_name"        json:"display_name"`
	Category        setting.WorkflowCategory `bson:"category"            yaml:"category"            json:"category"`
	KeyVals         []*KeyVal                `bson:"key_vals"            yaml:"key_vals"            json:"key_vals"`
	Params          []*Param                 `bson:"params"              yaml:"params"              json:"params"`
	Stages          []*WorkflowStage         `bson:"stages"              yaml:"stages"              json:"stages"`
	Project         string                   `bson:"project"             yaml:"project"             json:"project"`
	Description     string                   `bson:"description"         yaml:"description"         json:"description"`
	CreatedBy       string                   `bson:"created_by"          yaml:"created_by"          json:"created_by"`
	CreateTime      int64                    `bson:"create_time"         yaml:"create_time"         json:"create_time"`
	UpdatedBy       string                   `bson:"updated_by"          yaml:"updated_by"          json:"updated_by"`
	UpdateTime      int64                    `bson:"update_time"         yaml:"update_time"         json:"update_time"`
	NotifyCtls      []*NotifyCtl             `bson:"notify_ctls"         yaml:"notify_ctls"         json:"notify_ctls"`
	Debug           bool                     `bson:"debug"               yaml:"-"                   json:"debug"`
	HookCtls        []*WorkflowV4Hook        `bson:"hook_ctl"            yaml:"-"                   json:"hook_ctl"`
	JiraHookCtls    []*JiraHook              `bson:"jira_hook_ctls"      yaml:"-"                   json:"jira_hook_ctls"`
	MeegoHookCtls   []*MeegoHook             `bson:"meego_hook_ctls"     yaml:"-"                   json:"meego_hook_ctls"`
	GeneralHookCtls []*GeneralHook           `bson:"general_hook_ctls"   yaml:"-"                   json:"general_hook_ctls"`
	NotificationID  string                   `bson:"notification_id"     yaml:"-"                   json:"notification_id"`
	HookPayload     *HookPayload             `bson:"hook_payload"        yaml:"-"                   json:"hook_payload,omitempty"`
	BaseName        string                   `bson:"base_name"           yaml:"-"                   json:"base_name"`
	ShareStorages   []*ShareStorage          `bson:"share_storages"      yaml:"share_storages"      json:"share_storages"`
	Hash            string                   `bson:"hash"                yaml:"hash"                json:"hash"`
	// ConcurrencyLimit is the max number of concurrent runs of this workflow
	// -1 means no limit
	ConcurrencyLimit int          `bson:"concurrency_limit"   yaml:"concurrency_limit"   json:"concurrency_limit"`
	CustomField      *CustomField `bson:"custom_field"        yaml:"-"                   json:"custom_field"`
}

func (*WorkflowV4) CalculateHash

func (w *WorkflowV4) CalculateHash() [md5.Size]byte

func (WorkflowV4) TableName

func (WorkflowV4) TableName() string

func (*WorkflowV4) UpdateHash

func (w *WorkflowV4) UpdateHash()

type WorkflowV4Hook

type WorkflowV4Hook struct {
	Name                string              `bson:"name"                      json:"name"`
	AutoCancel          bool                `bson:"auto_cancel"               json:"auto_cancel"`
	CheckPatchSetChange bool                `bson:"check_patch_set_change"    json:"check_patch_set_change"`
	Enabled             bool                `bson:"enabled"                   json:"enabled"`
	MainRepo            *MainHookRepo       `bson:"main_repo"                 json:"main_repo"`
	Description         string              `bson:"description,omitempty"     json:"description,omitempty"`
	Repos               []*types.Repository `bson:"-"                         json:"repos,omitempty"`
	IsManual            bool                `bson:"is_manual"                 json:"is_manual"`
	WorkflowArg         *WorkflowV4         `bson:"workflow_arg"              json:"workflow_arg"`
}

type WorkflowV4Template

type WorkflowV4Template struct {
	ID               primitive.ObjectID       `bson:"_id,omitempty"       yaml:"id"                  json:"id"`
	TemplateName     string                   `bson:"template_name"       yaml:"template_name"      json:"template_name"`
	Category         setting.WorkflowCategory `bson:"category"            yaml:"category"           json:"category"`
	KeyVals          []*KeyVal                `bson:"key_vals"            yaml:"key_vals"           json:"key_vals"`
	Params           []*Param                 `bson:"params"              yaml:"params"             json:"params"`
	Stages           []*WorkflowStage         `bson:"stages"              yaml:"stages"             json:"stages"`
	Description      string                   `bson:"description"         yaml:"description"        json:"description"`
	CreatedBy        string                   `bson:"created_by"          yaml:"created_by"         json:"created_by"`
	CreateTime       int64                    `bson:"create_time"         yaml:"create_time"        json:"create_time"`
	UpdatedBy        string                   `bson:"updated_by"          yaml:"updated_by"         json:"updated_by"`
	UpdateTime       int64                    `bson:"update_time"         yaml:"update_time"        json:"update_time"`
	BuildIn          bool                     `bson:"build_in"            yaml:"build_in"           json:"build_in"`
	ShareStorages    []*ShareStorage          `bson:"share_storages"      yaml:"share_storages"     json:"share_storages"`
	ConcurrencyLimit int                      `bson:"concurrency_limit"   yaml:"concurrency_limit"  json:"concurrency_limit"`
}

func (WorkflowV4Template) TableName

func (WorkflowV4Template) TableName() string

type WorkflowView

type WorkflowView struct {
	ID          primitive.ObjectID    `bson:"_id,omitempty"          json:"id,omitempty"`
	Name        string                `bson:"name"                   json:"name"`
	ProjectName string                `bson:"project_name"           json:"project_name"`
	Workflows   []*WorkflowViewDetail `bson:"workflows"              json:"workflows"`
	UpdateTime  int64                 `bson:"update_time"            json:"update_time"`
	UpdateBy    string                `bson:"update_by"              json:"update_by,omitempty"`
}

func (WorkflowView) TableName

func (WorkflowView) TableName() string

type WorkflowViewDetail

type WorkflowViewDetail struct {
	WorkflowName        string `bson:"workflow_name"                   json:"workflow_name"`
	WorkflowDisplayName string `bson:"-"                               json:"workflow_display_name"`
	WorkflowType        string `bson:"workflow_type"                   json:"workflow_type"`
	Enabled             bool   `bson:"enabled"                         json:"enabled"`
}

type Workload

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"`
}

func (*Workload) String

func (wl *Workload) String() string

type WorkloadStat

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

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

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"` // Deprecated since 1.16.0
	VariableYaml       string                           `bson:"variable_yaml"        json:"variable_yaml"`
	ServiceVariableKVs []*commontypes.ServiceVariableKV `bson:"service_variable_kvs" json:"service_variable_kvs"`
	ServiceVars        []string                         `bson:"service_vars"         json:"service_vars"` // Deprecated since 1.18.0
}

func (YamlTemplate) TableName

func (YamlTemplate) TableName() string

type ZadigBlueGreenDeployEnvInformation added in v2.3.0

type ZadigBlueGreenDeployEnvInformation struct {
	Env        string                      `json:"env"         yaml:"env"`
	RegistryID string                      `json:"registry_id" yaml:"registry_id"`
	Services   []*BlueGreenDeployV2Service `json:"services"    yaml:"services"`
}

type ZadigBuildJobSpec

type ZadigBuildJobSpec struct {
	DockerRegistryID        string             `bson:"docker_registry_id"     yaml:"docker_registry_id"         json:"docker_registry_id"`
	ServiceAndBuilds        []*ServiceAndBuild `bson:"service_and_builds"     yaml:"service_and_builds"         json:"service_and_builds"`
	ServiceAndBuildsOptions []*ServiceAndBuild `bson:"-"                      yaml:"service_and_builds_options" json:"service_and_builds_options"`
}

type ZadigDeployEnvInformation added in v2.3.0

type ZadigDeployEnvInformation struct {
	Env        string               `json:"env"         yaml:"env"`
	RegistryID string               `json:"registry_id" yaml:"registry_id"`
	Services   []*DeployServiceInfo `json:"services"    yaml:"services"`
}

type ZadigDeployJobSpec

type ZadigDeployJobSpec struct {
	Env                string                       `bson:"env"                      yaml:"env"                         json:"env"`
	EnvOptions         []*ZadigDeployEnvInformation `bson:"-"                        yaml:"env_options"                 json:"env_options"`
	Production         bool                         `bson:"production"               yaml:"production"                  json:"production"`
	DeployType         string                       `bson:"deploy_type"              yaml:"deploy_type,omitempty"       json:"deploy_type"`
	SkipCheckRunStatus bool                         `bson:"skip_check_run_status"    yaml:"skip_check_run_status"       json:"skip_check_run_status"`
	// fromjob/runtime, runtime 表示运行时输入,fromjob 表示从上游构建任务中获取
	Source         config.DeploySourceType `bson:"source"     yaml:"source"     json:"source"`
	DeployContents []config.DeployContent  `bson:"deploy_contents"     yaml:"deploy_contents"     json:"deploy_contents"`
	// 当 source 为 fromjob 时需要,指定部署镜像来源是上游哪一个构建任务
	JobName string `bson:"job_name"             yaml:"job_name"             json:"job_name"`
	// save the origin quoted job name
	OriginJobName string               `bson:"origin_job_name"      yaml:"origin_job_name"      json:"origin_job_name"`
	Services      []*DeployServiceInfo `bson:"services"             yaml:"services"             json:"services"`
	// TODO: Deprecated in 2.3.0, this field is now used for saving the default service module info for deployment.
	ServiceAndImages []*ServiceAndImage `bson:"service_and_images" yaml:"service_and_images" json:"service_and_images"`
}

type ZadigDistributeImageJobSpec

type ZadigDistributeImageJobSpec struct {
	// fromjob/runtime, `runtime` means runtime input, `fromjob` means that it is obtained from the upstream build job
	Source config.DeploySourceType `bson:"source"     yaml:"source"     json:"source"`
	// required when source is `fromjob`, specify which upstream build job the distribution image source is
	JobName string `bson:"job_name"                       json:"job_name"                      yaml:"job_name"`
	// not required when source is fromjob, directly obtained from upstream build job information
	SourceRegistryID string              `bson:"source_registry_id"             json:"source_registry_id"            yaml:"source_registry_id"`
	TargetRegistryID string              `bson:"target_registry_id"             json:"target_registry_id"            yaml:"target_registry_id"`
	Targets          []*DistributeTarget `bson:"targets"                        json:"targets"                       yaml:"targets"`
	TargetOptions    []*DistributeTarget `bson:"target_options"                 json:"target_options"                yaml:"target_options"`
	// unit is minute.
	Timeout                  int64  `bson:"timeout"                        json:"timeout"                       yaml:"timeout"`
	ClusterID                string `bson:"cluster_id"                     json:"cluster_id"                    yaml:"cluster_id"`
	StrategyID               string `bson:"strategy_id"                    json:"strategy_id"                   yaml:"strategy_id"`
	EnableTargetImageTagRule bool   `bson:"enable_target_image_tag_rule" json:"enable_target_image_tag_rule" yaml:"enable_target_image_tag_rule"`
	TargetImageTagRule       string `bson:"target_image_tag_rule"        json:"target_image_tag_rule"        yaml:"target_image_tag_rule"`
}

type ZadigHelmChartDeployJobSpec

type ZadigHelmChartDeployJobSpec struct {
	Env                string                           `bson:"env"                      yaml:"env"                         json:"env"`
	EnvOptions         []*ZadigHelmDeployEnvInformation `bson:"-"                        yaml:"env_options"                 json:"env_options"`
	EnvSource          string                           `bson:"env_source"               yaml:"env_source"                  json:"env_source"`
	SkipCheckRunStatus bool                             `bson:"skip_check_run_status"    yaml:"skip_check_run_status"       json:"skip_check_run_status"`
	DeployHelmCharts   []*DeployHelmChart               `bson:"deploy_helm_charts"       yaml:"deploy_helm_charts"          json:"deploy_helm_charts"`
}

type ZadigHelmDeployEnvInformation added in v2.3.0

type ZadigHelmDeployEnvInformation struct {
	Env      string             `json:"env"      yaml:"env"`
	Services []*DeployHelmChart `json:"services" yaml:"services"`
}

type ZadigScanningJobSpec

type ZadigScanningJobSpec struct {
	Scannings []*ScanningModule `bson:"scannings"     yaml:"scannings"        json:"scannings"`
}

type ZadigTestingJobSpec

type ZadigTestingJobSpec struct {
	TestType      config.TestModuleType   `bson:"test_type"         yaml:"test_type"         json:"test_type"`
	Source        config.DeploySourceType `bson:"source"            yaml:"source"            json:"source"`
	JobName       string                  `bson:"job_name"          yaml:"job_name"          json:"job_name"`
	OriginJobName string                  `bson:"origin_job_name"   yaml:"origin_job_name"   json:"origin_job_name"`
	// selected service in service testing
	TargetServices []*ServiceTestTarget `bson:"target_services"   yaml:"target_services"   json:"target_services"`
	// field for non-service tests.
	TestModules []*TestModule `bson:"test_modules"      yaml:"test_modules"      json:"test_modules"`
	// in config: this is the test infos for all the services
	ServiceAndTests []*ServiceAndTest `bson:"service_and_tests" yaml:"service_and_tests" json:"service_and_tests"`
}

type ZadigVMDeployEnvInformation added in v2.3.0

type ZadigVMDeployEnvInformation struct {
	Env      string                `json:"env"      yaml:"env"`
	Services []*ServiceAndVMDeploy `json:"services" yaml:"services"`
}

type ZadigVMDeployJobSpec

type ZadigVMDeployJobSpec struct {
	Env                 string                         `bson:"env"                    yaml:"env"                    json:"env"`
	EnvOptions          []*ZadigVMDeployEnvInformation `bson:"-"                      yaml:"env_options"            json:"env_options"`
	S3StorageID         string                         `bson:"s3_storage_id"          yaml:"s3_storage_id"          json:"s3_storage_id"`
	ServiceAndVMDeploys []*ServiceAndVMDeploy          `bson:"service_and_vm_deploys" yaml:"service_and_vm_deploys" json:"service_and_vm_deploys"`
	// fromjob/runtime, runtime 表示运行时输入,fromjob 表示从上游构建任务中获取
	Source config.DeploySourceType `bson:"source"     yaml:"source"     json:"source"`
	// 当 source 为 fromjob 时需要,指定部署镜像来源是上游哪一个构建任务
	JobName string `bson:"job_name"             yaml:"job_name"             json:"job_name"`
	// save the origin quoted job name
	OriginJobName string `bson:"origin_job_name"      yaml:"origin_job_name"      json:"origin_job_name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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