Documentation
¶
Index ¶
- Constants
- type ActionRule
- type Attribute
- type BasicImage
- type Build
- type CodeHost
- type Container
- type EmailHost
- type Env
- type EnvConfig
- type EnvConfigMap
- type EnvIngress
- type EnvPvc
- type EnvResource
- type EnvSecret
- type ImagePathSpec
- type JenkinsBuild
- type JenkinsIntegration
- type JobProperties
- type JobTask
- type JobTaskDeploySpec
- type K8SCluster
- type KeyVal
- type MainHookRepo
- type MatchAttribute
- type NotifyCtl
- type Organization
- type Output
- type Param
- type PluginTemplate
- type PolicyMeta
- type PolicyMetaRule
- type PreBuild
- type PreTest
- type Product
- type ProductAuth
- type ProductAuthType
- type ProductPermission
- type ProductService
- type Project
- type ProjectClusterRelation
- type RegistryNamespace
- type RenderInfo
- type RenderSet
- type Resource
- type Role
- type RoleBinding
- type RoleRef
- type Rule
- type Scanning
- type ScheduleCtrl
- type ServiceConfig
- type StageTask
- type StepCustomDeploySpec
- type StepDeploySpec
- type StepHelmDeploySpec
- type StepTask
- type TestTaskArgs
- type Testing
- type TestingHook
- type TestingHookCtrl
- type Workflow
- type WorkflowTask
Constants ¶
View Source
const ( ImageFromKoderover = "koderover" ImageFromCustom = "custom" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionRule ¶ added in v1.9.9
type ActionRule struct {
Method string `bson:"method" json:"method"`
Endpoint string `bson:"endpoint" json:"endpoint"`
ResourceType string `bson:"resource_type,omitempty" json:"resourceType,omitempty"`
IDRegex string `bson:"id_regex,omitempty" json:"idRegex,omitempty"`
MatchAttributes []Attribute `bson:"match_attributes,omitempty" json:"matchAttributes,omitempty"`
}
type BasicImage ¶ added in v1.9.9
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 ¶ added in v1.9.9
func (BasicImage) TableName() string
type Build ¶ added in v1.9.9
type Build struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
ProductName string `bson:"product_name" json:"product_name"`
PreBuild *PreBuild `bson:"pre_build" json:"pre_build"`
Timeout int `bson:"timeout" json:"timeout"`
// TODO: Deprecated.
Caches []string `bson:"caches" json:"caches"`
// 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"`
JenkinsBuild *JenkinsBuild `bson:"jenkins_build,omitempty" json:"jenkins_build,omitempty"`
}
type CodeHost ¶
type CodeHost struct {
ID int `bson:"id" json:"id"`
Type string `bson:"type" json:"type"`
Address string `bson:"address" json:"address"`
Namespace string `bson:"namespace" json:"namespace"`
AccessToken string `bson:"access_token" json:"accessToken"`
EnableProxy bool `bson:"enable_proxy" json:"enable_proxy"`
Alias string `bson:"alias" json:"alias"`
Username string `bson:"username" json:"username"`
AccessKey string `bson:"application_id" json:"application_id"`
}
type Container ¶ added in v1.8.0
type Container struct {
Name string `bson:"name" json:"name"`
Image string `bson:"image" json:"image"`
ImagePath *ImagePathSpec `bson:"image_path,omitempty" json:"imagePath,omitempty"`
}
type EmailHost ¶ added in v1.8.0
type EmailHost struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
Port int `bson:"port" json:"port"`
Username string `bson:"username" json:"username"`
Password string `bson:"password" json:"password"`
IsTLS interface{} `bson:"is_tls" json:"isTLS"`
CreatedAt int64 `bson:"created_at" json:"created_at"`
DeletedAt int64 `bson:"deleted_at" json:"deleted_at"`
UpdatedAt int64 `bson:"updated_at" json:"updated_at"`
}
type EnvConfigMap ¶ added in v1.9.9
type EnvConfigMap 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"`
UpdateUserName string `bson:"update_user_name" json:"update_user_name"`
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"`
}
func (EnvConfigMap) TableName ¶ added in v1.9.9
func (EnvConfigMap) TableName() string
type EnvIngress ¶ added in v1.9.9
type EnvIngress 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"`
UpdateUserName string `bson:"update_user_name" json:"update_user_name"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
Status string `bson:"status" json:"status"`
EnvName string `bson:"env_name" json:"env_name"`
Name string `bson:"name" json:"name"`
YamlData string `bson:"yaml_data" json:"yaml_data"`
}
func (EnvIngress) TableName ¶ added in v1.9.9
func (EnvIngress) TableName() string
type EnvPvc ¶ added in v1.9.9
type EnvPvc 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"`
UpdateUserName string `bson:"update_user_name" json:"update_user_name"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
Status string `bson:"status" json:"status"`
EnvName string `bson:"env_name" json:"env_name"`
Name string `bson:"name" json:"name"`
YamlData string `bson:"yaml_data" json:"yaml_data"`
}
type EnvResource ¶ added in v1.9.9
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"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
Status string `bson:"status" json:"status"`
DeletedAt int64 `bson:"deleted_at" json:"deleted_at" `
EnvName string `bson:"env_name" json:"env_name"`
Name string `bson:"name" json:"name"`
YamlData string `bson:"yaml_data" json:"yaml_data"`
}
func (EnvResource) TableName ¶ added in v1.9.9
func (EnvResource) TableName() string
type EnvSecret ¶ added in v1.9.9
type EnvSecret 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"`
UpdateUserName string `bson:"update_user_name" json:"update_user_name"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
Status string `bson:"status" json:"status"`
EnvName string `bson:"env_name" json:"env_name"`
Name string `bson:"name" json:"name"`
YamlData string `bson:"yaml_data" json:"yaml_data"`
}
type ImagePathSpec ¶ added in v1.8.0
type ImagePathSpec struct {
Repo string `bson:"repo,omitempty" json:"repo,omitempty"`
Image string `bson:"image,omitempty" json:"image,omitempty"`
Tag string `bson:"tag,omitempty" json:"tag,omitempty"`
}
ImagePathSpec paths in yaml used to parse image
type JenkinsBuild ¶ added in v1.9.9
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 JenkinsIntegration ¶ added in v1.9.9
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 ¶ added in v1.9.9
func (j JenkinsIntegration) TableName() string
type JobProperties ¶ added in v1.9.9
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"`
ClusterID string `bson:"cluster_id" json:"cluster_id" yaml:"cluster_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"`
}
type JobTask ¶ added in v1.9.9
type JobTask 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"`
Properties commonmodels.JobProperties `bson:"properties" json:"properties"`
Plugin *commonmodels.PluginTemplate `bson:"plugin" json:"plugin"`
Steps []*commonmodels.StepTask `bson:"steps" json:"steps"`
Spec interface{} `bson:"spec" json:"spec"`
Outputs []*commonmodels.Output `bson:"outputs" json:"outputs"`
}
type JobTaskDeploySpec ¶ added in v1.9.9
type JobTaskDeploySpec 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"`
ServiceModule string `bson:"service_module" json:"service_module" yaml:"service_module"`
SkipCheckRunStatus bool `bson:"skip_check_run_status" json:"skip_check_run_status" yaml:"skip_check_run_status"`
Image string `bson:"image" json:"image" yaml:"image"`
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:"-"`
}
type K8SCluster ¶ added in v1.8.0
type K8SCluster struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Name string `json:"name" bson:"name"`
Status setting.K8SClusterStatus `json:"status" bson:"status"`
Local bool `json:"local" bson:"local"`
}
func (K8SCluster) TableName ¶ added in v1.8.0
func (K8SCluster) TableName() string
type KeyVal ¶ added in v1.9.9
type KeyVal struct {
Key string `bson:"key" json:"key" yaml:"key"`
Value string `bson:"value" json:"value" yaml:"value"`
Type commonmodels.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 MainHookRepo ¶ added in v1.9.9
type MainHookRepo struct {
Name string `bson:"name,omitempty" json:"name,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
Source string `bson:"source,omitempty" json:"source,omitempty"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoName string `bson:"repo_name" json:"repo_name"`
Branch string `bson:"branch" json:"branch"`
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"`
}
type MatchAttribute ¶ added in v1.9.9
type NotifyCtl ¶ added in v1.9.9
type NotifyCtl struct {
Enabled bool `bson:"enabled" json:"enabled"`
WebHookType string `bson:"webhook_type" json:"webhook_type"`
WeChatWebHook string `bson:"weChat_webHook,omitempty" json:"weChat_webHook,omitempty"`
DingDingWebHook string `bson:"dingding_webhook,omitempty" json:"dingding_webhook,omitempty"`
FeiShuWebHook string `bson:"feishu_webhook,omitempty" json:"feishu_webhook,omitempty"`
AtMobiles []string `bson:"at_mobiles,omitempty" json:"at_mobiles,omitempty"`
IsAtAll bool `bson:"is_at_all,omitempty" json:"is_at_all,omitempty"`
NotifyTypes []string `bson:"notify_type" json:"notify_type"`
}
type Organization ¶
type Organization struct {
ID int `bson:"id" json:"id"`
Token string `bson:"token,omitempty" json:"token,omitempty"`
}
func (Organization) TableName ¶
func (Organization) TableName() string
type Param ¶ added in v1.9.9
type Param struct {
Name string `bson:"name" json:"name" yaml:"name"`
Description string `bson:"description" json:"description" yaml:"description"`
// support string/text type
ParamsType string `bson:"type" json:"type" yaml:"type"`
Value string `bson:"value" json:"value" yaml:"value,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"`
}
type PluginTemplate ¶ added in v1.9.9
type PluginTemplate struct {
Name string `bson:"name" json:"name" yaml:"name"`
IsOffical bool `bson:"is_offical" json:"is_offical" yaml:"is_offical"`
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 PolicyMeta ¶ added in v1.9.9
type PolicyMeta struct {
Resource string `bson:"resource" json:"resource"`
Alias string `bson:"alias" json:"alias"`
Description string `bson:"description" json:"description"`
Rules []*PolicyMetaRule `bson:"rules" json:"rules"`
}
type PolicyMetaRule ¶ added in v1.9.9
type PolicyMetaRule struct {
Action string `bson:"action" json:"action"`
Alias string `bson:"alias" json:"alias"`
Description string `bson:"description" json:"description"`
Rules []*ActionRule `bson:"rules" json:"rules"`
}
type PreBuild ¶ added in v1.9.9
type PreBuild struct {
ClusterID string `bson:"cluster_id" json:"cluster_id"`
ResReq setting.Request `bson:"res_req" json:"res_req"`
BuildOS string `bson:"build_os" json:"build_os"`
ImageID string `bson:"image_id" json:"image_id"`
// TODO: Deprecated.
CleanWorkspace bool `bson:"clean_workspace" json:"clean_workspace"`
}
PreBuild prepares an environment for a job
type PreTest ¶ added in v1.9.9
type PreTest struct {
ClusterID string `bson:"cluster_id" json:"cluster_id"`
ResReq setting.Request `bson:"res_req" json:"res_req"`
BuildOS string `bson:"build_os" json:"build_os"`
ImageID string `bson:"image_id" json:"image_id"`
// TODO: Deprecated.
CleanWorkspace bool `bson:"clean_workspace" json:"clean_workspace"`
}
PreTest prepares an environment for a job
type Product ¶ added in v1.8.0
type Product struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
ProductName string `bson:"product_name" json:"product_name"`
CreateTime int64 `bson:"create_time" json:"create_time"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
Status string `bson:"status" json:"status"`
Revision int64 `bson:"revision" json:"revision"`
Enabled bool `bson:"enabled" json:"enabled"`
EnvName string `bson:"env_name" json:"env_name"`
UpdateBy string `bson:"update_by" json:"update_by"`
Auth []*ProductAuth `bson:"auth" json:"auth"`
Visibility string `bson:"-" json:"visibility"`
Services [][]*ProductService `bson:"services" json:"services"`
Render *RenderInfo `bson:"render" json:"render"`
Error string `bson:"error" json:"error"`
Vars []*templatemodels.RenderKV `bson:"vars,omitempty" json:"vars,omitempty"`
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"`
IsForkedProduct bool `bson:"-" json:"-"`
}
Vars do not save, only input parameters
func (*Product) GetServiceMap ¶ added in v1.8.0
func (p *Product) GetServiceMap() map[string]*ProductService
type ProductAuth ¶ added in v1.8.0
type ProductAuth struct {
Type ProductAuthType `bson:"type" json:"type"`
Name string `bson:"name" json:"name"`
Permissions []ProductPermission `bson:"permissions" json:"permissions"`
}
type ProductAuthType ¶ added in v1.8.0
type ProductAuthType string
type ProductPermission ¶ added in v1.8.0
type ProductPermission string
type ProductService ¶ added in v1.8.0
type ProductService struct {
ServiceName string `bson:"service_name" json:"service_name"`
ProductName string `bson:"product_name" json:"product_name"`
Type string `bson:"type" json:"type"`
Revision int64 `bson:"revision" json:"revision"`
Containers []*Container `bson:"containers" json:"containers,omitempty"`
Render *RenderInfo `bson:"render,omitempty" json:"render,omitempty"` // Record the render information of each service to facilitate the update of a single service
EnvConfigs []*EnvConfig `bson:"-" json:"env_configs,omitempty"`
}
type Project ¶ added in v1.8.0
type Project struct {
ProductName string `bson:"product_name" json:"product_name"`
}
type ProjectClusterRelation ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (ProjectClusterRelation) TableName() string
type RegistryNamespace ¶ added in v1.8.0
type RegistryNamespace struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
RegAddr string `bson:"reg_addr" json:"reg_addr"`
RegType string `bson:"reg_type" json:"reg_type"`
RegProvider string `bson:"reg_provider" json:"reg_provider"`
IsDefault bool `bson:"is_default" json:"is_default"`
Namespace string `bson:"namespace" json:"namespace"`
AccessKey string `bson:"access_key" json:"access_key"`
SecretKey string `bson:"secret_key" json:"secret_key"`
Region string `bson:"region,omitempty" json:"region,omitempty"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
UpdateBy string `bson:"update_by" json:"update_by"`
}
func (RegistryNamespace) TableName ¶ added in v1.8.0
func (RegistryNamespace) TableName() string
func (*RegistryNamespace) Validate ¶ added in v1.8.0
func (ns *RegistryNamespace) Validate() error
type RenderInfo ¶ added in v1.8.0
type RenderSet ¶ added in v1.9.9
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 both k8s/helm projects
DefaultValues string `bson:"default_values,omitempty" json:"default_values,omitempty"`
YamlData *templatemodels.CustomYaml `bson:"yaml_data,omitempty" json:"yaml_data,omitempty"`
KVs []*templatemodels.RenderKV `bson:"kvs,omitempty" json:"kvs,omitempty"` // deprecated since 1.16.0
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 ...
type RoleBinding ¶ added in v1.9.9
type RoleBinding struct {
Name string `bson:"name" json:"name"`
Namespace string `bson:"namespace" json:"namespace"`
// RoleRef can reference a namespaced or cluster scoped Role.
RoleRef *RoleRef `bson:"role_ref" json:"roleRef"`
Type setting.ResourceType `bson:"type" json:"type"`
}
type RoleRef ¶ added in v1.9.9
type RoleRef struct {
Name string `bson:"name" json:"name"`
// Namespace of the referenced object. if the object is cluster scoped, namespace is empty.
Namespace string `bson:"namespace" json:"namespace"`
}
RoleRef contains information that points to the role being used
type Rule ¶ added in v1.9.9
type Rule struct {
// Verbs is a list of http methods or resource actions that apply to ALL the Resources contained in this rule. '*' represents all methods.
Verbs []string `bson:"verbs" json:"verbs"`
Resources []string `bson:"resources" json:"resources"`
Kind string `bson:"kind" json:"kind"`
MatchAttributes []MatchAttribute `bson:"match_attributes" json:"match_attributes"`
}
type Scanning ¶ added in v1.9.9
type ScheduleCtrl ¶ added in v1.9.9
type ScheduleCtrl struct {
Enabled bool `bson:"enabled" json:"enabled"`
}
type ServiceConfig ¶ added in v1.8.0
type StageTask ¶ added in v1.9.9
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"`
Approval *commonmodels.Approval `bson:"approval" json:"approval"`
Jobs []*JobTask `bson:"jobs" json:"jobs"`
Error string `bson:"error" json:"error"`
}
type StepCustomDeploySpec ¶ added in v1.9.9
type StepCustomDeploySpec 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 []commonmodels.Resource `bson:"replace_resources" json:"replace_resources" yaml:"replace_resources"`
}
type StepDeploySpec ¶ added in v1.9.9
type StepDeploySpec 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"`
ServiceModule string `bson:"service_module" json:"service_module" yaml:"service_module"`
SkipCheckRunStatus bool `bson:"skip_check_run_status" json:"skip_check_run_status" yaml:"skip_check_run_status"`
Image string `bson:"image" json:"image" yaml:"image"`
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"`
}
type StepHelmDeploySpec ¶ added in v1.9.9
type StepHelmDeploySpec 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"`
SkipCheckRunStatus bool `bson:"skip_check_run_status" json:"skip_check_run_status" yaml:"skip_check_run_status"`
ImageAndModules []*commonmodels.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 []commonmodels.Resource `bson:"replace_resources" json:"replace_resources" yaml:"replace_resources"`
}
type StepTask ¶ added in v1.9.9
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"`
// 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 TestTaskArgs ¶ added in v1.9.9
type TestTaskArgs struct {
ProductName string `bson:"product_name" json:"product_name"`
TestName string `bson:"test_name" json:"test_name"`
TestTaskCreator string `bson:"test_task_creator" json:"test_task_creator"`
NotificationID string `bson:"notification_id" json:"notification_id"`
ReqID string `bson:"req_id" json:"req_id"`
// webhook触发测试任务时,触发任务的repo、prID和commitID
MergeRequestID string `bson:"merge_request_id" json:"merge_request_id"`
CommitID string `bson:"commit_id" json:"commit_id"`
Source string `bson:"source" json:"source"`
CodehostID int `bson:"codehost_id" json:"codehost_id"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoName string `bson:"repo_name" json:"repo_name"`
}
type Testing ¶ added in v1.9.9
type Testing struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
PreTest *PreTest `bson:"pre_test" json:"pre_test"`
Timeout int `bson:"timeout" json:"timeout"`
HookCtl *TestingHookCtrl `bson:"hook_ctl" json:"hook_ctl"`
NotifyCtl *NotifyCtl `bson:"notify_ctl,omitempty" json:"notify_ctl,omitempty"`
NotifyCtls []*NotifyCtl `bson:"notify_ctls" json:"notify_ctls"`
Schedules *ScheduleCtrl `bson:"schedules,omitempty" json:"schedules,omitempty"`
ArtifactPaths []string `bson:"artifact_paths,omitempty" json:"artifact_paths,omitempty"`
// TODO: Deprecated.
Caches []string `bson:"caches" json:"caches"`
// 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"`
}
type TestingHook ¶ added in v1.9.9
type TestingHook struct {
AutoCancel bool `bson:"auto_cancel" json:"auto_cancel"`
MainRepo *MainHookRepo `bson:"main_repo" json:"main_repo"`
TestArgs *TestTaskArgs `bson:"test_args" json:"test_args"`
}
type TestingHookCtrl ¶ added in v1.9.9
type TestingHookCtrl struct {
Enabled bool `bson:"enabled" json:"enabled"`
Items []*TestingHook `bson:"items" json:"items"`
}
type Workflow ¶ added in v1.9.9
type Workflow struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
Enabled bool `bson:"enabled" json:"enabled"`
ProductTmplName string `bson:"product_tmpl_name" json:"product_tmpl_name"`
Team string `bson:"team,omitempty" json:"team,omitempty"`
EnvName string `bson:"env_name" json:"env_name,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
UpdateBy string `bson:"update_by" json:"update_by,omitempty"`
CreateBy string `bson:"create_by" json:"create_by,omitempty"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
CreateTime int64 `bson:"create_time" json:"create_time"`
Schedules *ScheduleCtrl `bson:"schedules,omitempty" json:"schedules,omitempty"`
ScheduleEnabled bool `bson:"schedule_enabled" json:"schedule_enabled"`
// 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"`
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"`
// IsParallel 控制单一工作流的任务是否支持并行处理
IsParallel bool `json:"is_parallel" bson:"is_parallel"`
}
type WorkflowTask ¶ added in v1.9.9
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"`
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"`
}
func (WorkflowTask) TableName ¶ added in v1.9.9
func (WorkflowTask) TableName() string
Click to show internal directories.
Click to hide internal directories.