Documentation
¶
Index ¶
- Constants
- Variables
- func IToi(before interface{}, after interface{}) error
- func IToiYaml(before interface{}, after interface{}) error
- type ActivityCommit
- type AdvancedConfig
- type AnnouncementCtx
- type Approval
- type ArtifactArgs
- type ArtifactModule
- type ArtifactPackageTaskArgs
- type ArtifactStage
- type AslanConfig
- type BasicImage
- type Build
- type BuildArgs
- type BuildConfig
- type BuildModule
- type BuildModuleArgs
- type BuildObj
- type BuildStage
- type BuildTemplate
- type CallbackArgs
- type CallbackRequest
- type CapacityStrategy
- type CapacityTarget
- type Chart
- type ChartVariable
- type Commit
- type ConfigPayload
- type Container
- type Counter
- type CreateFromChartRepo
- type CreateFromChartTemplate
- type CreateFromPublicRepo
- type CreateFromRepo
- type CreateFromYamlTemplate
- type CreateUpdateCommonEnvCfgArgs
- type Cronjob
- type DeliveryActivity
- type DeliveryArtifact
- type DeliveryBuild
- type DeliveryDeploy
- type DeliveryDistribute
- type DeliveryImage
- type DeliveryPackage
- type DeliverySecurity
- type DeliveryTest
- type DeliveryVersion
- type DeliveryVersionProgress
- type DeployArgs
- type DeployEnv
- type Descriptor
- type DiffNote
- type DindCfg
- type DindClean
- type DindCleanInfo
- type DindStorage
- type DindStorageType
- type DistributeStage
- type DockerBuild
- type DockerConfig
- type DockerfileTemplate
- type EnvConfig
- type EnvObjects
- type EnvResource
- type EnvStatus
- type EnvSvcDepend
- type Error
- type ExtensionStage
- type ExternalLink
- type ExternalParamMapping
- type ExternalSetting
- type ExternalSystem
- type Failure
- type Favorite
- type Feature
- type FileArchive
- type FreestyleJobSpec
- type GUIConfig
- type GitHook
- type GithubApp
- type GithubConfig
- type GitlabConfig
- type HelmChart
- type HelmRepo
- type HelmService
- type HelmServiceArgs
- type HelmServiceInfo
- type HelmServiceResp
- type HelmServiceRespArgs
- type HelmVersions
- type Hook
- type HookPayload
- type ImageData
- type ImagePathSpec
- type ImageReleaseConfig
- type ImagesByService
- type Install
- type ItReport
- type Item
- type JenkinsBuild
- type JenkinsBuildArgs
- type JenkinsBuildConfig
- type JenkinsIntegration
- type JiraIssue
- type Job
- type JobProperties
- type JobTask
- type K8SCluster
- type K8SClusterInfo
- type K8SClusterResp
- type KV
- type KeyVal
- type Limits
- type MainHookRepo
- type MessageCtx
- type NodeSelectorRequirement
- type Notification
- type NotificationTask
- type Notify
- type NotifyCtl
- type ObjectStorageUpload
- type Output
- type ParamVal
- type Parameter
- type ParameterSetting
- type ParameterSettingType
- type PerformanceTestSuite
- type Pipeline
- type PipelineStatusCtx
- type PmHealthCheck
- type PmInfo
- type Port
- type PostBuild
- type PrTaskInfo
- type PreBuild
- type PreTest
- type Preview
- type PrivateKey
- type Product
- type ProductAuth
- type ProductAuthType
- type ProductDistribute
- type ProductPermission
- type ProductService
- type ProductShareEnv
- type ProjectClusterRelation
- type Proxy
- type ProxyConfig
- type Queue
- type RegistryAdvancedSetting
- type RegistryConfig
- type RegistryNamespace
- type ReleaseConfig
- type ReleaseImage
- type RenderInfo
- type RenderSet
- type RepoImage
- type RepoInfo
- type Resources
- type RetentionConfig
- type S3Config
- type S3Storage
- type Scanning
- type ScanningArgs
- type Schedule
- type ScheduleCtrl
- type SecurityStage
- type Service
- type ServiceAndBuild
- type ServiceAndImage
- type ServiceConfig
- type ServiceModuleTarget
- type ServiceModuleTargetBase
- type ServiceTaskArgs
- type ServiceTmplPipeResp
- type ServiceTmplRevision
- type ServicesInExternalEnv
- type Skipped
- type Slack
- type SonarIntegration
- type Spec
- type Stage
- type StageTask
- type Stats
- type Step
- type StepTask
- type SubTask
- type Subscription
- type SystemSetting
- type TarInfo
- type TargetArgs
- type TargetRepo
- type TaskArgs
- type TaskInfo
- type TestArgs
- type TestCase
- type TestConfig
- type TestExecArgs
- type TestReport
- type TestReportObject
- type TestStage
- type TestSuite
- type TestSuiteSummary
- type TestTaskArgs
- type TestTaskStat
- type Testing
- type TestingHook
- type TestingHookCtrl
- type TriggerBy
- type User
- type Variable
- type VersionArgs
- type Vulnerability
- type WebHook
- type WebHookUser
- type Workflow
- type WorkflowHook
- type WorkflowHookCtrl
- type WorkflowQueue
- type WorkflowStage
- type WorkflowStat
- type WorkflowTask
- type WorkflowTaskArgs
- type WorkflowTaskCtx
- type WorkflowV3
- type WorkflowV3Args
- type WorkflowV4
- type Workload
- type WorkloadStat
- type YamlPreview
- type YamlPreviewForPorts
- type YamlTemplate
- type ZadigBuildJobSpec
- type ZadigDeployJobSpec
Constants ¶
const ( ImageFromKoderover = "koderover" ImageFromCustom = "custom" )
const ( // 工作流任务的留存 WorkflowTaskRetention CapacityTarget = "WorkflowTaskRetention" DefaultWorkflowRemainDays int = 365 )
Variables ¶
var DefaultWorkflowTaskRetention = &CapacityStrategy{ Target: WorkflowTaskRetention, Retention: &RetentionConfig{ MaxDays: DefaultWorkflowRemainDays, }, }
Functions ¶
Types ¶
type ActivityCommit ¶
type ActivityCommit struct {
Address string `bson:"address" json:"address"`
Source string `bson:"source,omitempty" json:"source,omitempty"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoName string `bson:"repo_name" json:"repo_name"`
Branch string `bson:"branch" json:"branch"`
PR int `bson:"pr,omitempty" json:"pr,omitempty"`
Tag string `bson:"tag,omitempty" json:"tag,omitempty"`
CommitID string `bson:"commit_id,omitempty" json:"commit_id,omitempty"`
CommitMessage string `bson:"commit_message,omitempty" json:"commit_message,omitempty"`
AuthorName string `bson:"author_name,omitempty" json:"author_name,omitempty"`
}
type AdvancedConfig ¶ added in v1.8.0
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:"-"`
}
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 Approval ¶ added in v1.9.9
type Approval struct {
Enabled bool `bson:"enabled" yaml:"enabled" json:"enabled"`
ApproveUsers []*User `bson:"approve_users" yaml:"approve_users" json:"approve_users"`
Timeout int `bson:"timeout" yaml:"timeout" json:"timeout"`
NeededApprovers int `bson:"needed_approvers" yaml:"needed_approvers" json:"needed_approvers"`
Description string `bson:"description" yaml:"description" json:"description"`
RejectOrApprove config.ApproveOrReject `bson:"reject_or_approve" yaml:"-" json:"reject_or_approve"`
}
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 ¶ added in v1.8.0
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 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 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"`
JenkinsBuild *JenkinsBuild `bson:"jenkins_build,omitempty" json:"jenkins_build,omitempty"`
Scripts string `bson:"scripts" json:"scripts"`
PostBuild *PostBuild `bson:"post_build,omitempty" json:"post_build"`
// TODO: Deprecated.
Caches []string `bson:"caches" json:"caches"`
ProductName string `bson:"product_name" json:"product_name"`
SSHs []string `bson:"sshs" json:"sshs"`
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"`
}
func (*Build) SafeRepos ¶ added in v1.9.9
func (build *Build) SafeRepos() []*types.Repository
func (*Build) SafeReposDeepCopy ¶ added in v1.9.9
func (build *Build) SafeReposDeepCopy() []*types.Repository
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 ¶ added in v1.6.0
type BuildStage ¶
type BuildStage struct {
Enabled bool `bson:"enabled" json:"enabled"`
Modules []*BuildModule `bson:"modules" json:"modules"`
}
type BuildTemplate ¶ added in v1.9.9
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"`
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"`
}
func (BuildTemplate) TableName ¶ added in v1.9.9
func (BuildTemplate) TableName() string
type CallbackArgs ¶ added in v1.8.0
type CallbackRequest ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (CallbackRequest) TableName() string
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 Chart ¶ added in v1.8.0
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 ¶ added in v1.9.9
func (*Chart) GetVariableMap ¶ added in v1.8.0
func (chart *Chart) GetVariableMap() map[string]*ChartVariable
type ChartVariable ¶ added in v1.8.0
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 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 CreateFromChartRepo ¶ added in v1.9.9
type CreateFromChartTemplate ¶ added in v1.6.0
type CreateFromChartTemplate struct {
YamlData *templatemodels.CustomYaml `bson:"yaml_data,omitempty" json:"yaml_data,omitempty"`
TemplateName string `bson:"template_name" json:"template_name"`
ServiceName string `bson:"service_name" json:"service_name"`
Variables []*Variable `bson:"variables" json:"variables"`
}
type CreateFromPublicRepo ¶ added in v1.6.0
type CreateFromRepo ¶ added in v1.6.0
type CreateFromRepo struct {
GitRepoConfig *templatemodels.GitRepoConfig `bson:"git_repo_config,omitempty" json:"git_repo_config,omitempty"`
LoadPath string `bson:"load_path,omitempty" json:"load_path,omitempty"`
}
type CreateFromYamlTemplate ¶ added in v1.9.9
type CreateUpdateCommonEnvCfgArgs ¶ added in v1.9.9
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:"-"`
}
type Cronjob ¶
type Cronjob struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
Name string `bson:"name"`
Type string `bson:"type"`
Number uint64 `bson:"number"`
Frequency string `bson:"frequency"`
Time string `bson:"time"`
Cron string `bson:"cron"`
ProductName string `bson:"product_name,omitempty"`
MaxFailure int `bson:"max_failures,omitempty"`
TaskArgs *TaskArgs `bson:"task_args,omitempty"`
WorkflowArgs *WorkflowTaskArgs `bson:"workflow_args,omitempty"`
TestArgs *TestTaskArgs `bson:"test_args,omitempty"`
JobType string `bson:"job_type"`
Enabled bool `bson:"enabled"`
}
type DeliveryActivity ¶
type DeliveryActivity struct {
ArtifactID primitive.ObjectID `bson:"artifact_id" json:"artifact_id"`
Type string `bson:"type" json:"type"`
Content string `bson:"content,omitempty" json:"content,omitempty"`
URL string `bson:"url,omitempty" json:"url,omitempty"`
Commits []*ActivityCommit `bson:"commits,omitempty" json:"commits,omitempty"`
Issues []string `bson:"issues,omitempty" json:"issues,omitempty"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
EnvName string `bson:"env_name,omitempty" json:"env_name,omitempty"`
PublishHosts []string `bson:"publish_hosts,omitempty" json:"publish_hosts,omitempty"`
PublishNamespaces []string `bson:"publish_namespaces,omitempty" json:"publish_namespaces,omitempty"`
RemoteFileKey string `bson:"remote_file_key,omitempty" json:"remote_file_key,omitempty"`
DistStorageURL string `bson:"dist_storage_url,omitempty" json:"dist_storage_url,omitempty"`
SrcStorageURL string `bson:"src_storage_url,omitempty" json:"src_storage_url,omitempty"`
StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"`
EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"`
CreatedBy string `bson:"created_by" json:"created_by"`
CreatedTime int64 `bson:"created_time" json:"created_time"`
}
func (DeliveryActivity) TableName ¶
func (DeliveryActivity) TableName() string
type DeliveryArtifact ¶
type DeliveryArtifact struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
Name string `bson:"name" json:"name"`
Type string `bson:"type" json:"type"`
Source string `bson:"source" json:"source"`
Image string `bson:"image,omitempty" json:"image,omitempty"`
ImageHash string `bson:"image_hash,omitempty" json:"image_hash,omitempty"`
ImageTag string `bson:"image_tag" json:"image_tag"`
ImageDigest string `bson:"image_digest,omitempty" json:"image_digest,omitempty"`
ImageSize int64 `bson:"image_size,omitempty" json:"image_size,omitempty"`
Architecture string `bson:"architecture,omitempty" json:"architecture,omitempty"`
Os string `bson:"os,omitempty" json:"os,omitempty"`
DockerFile string `bson:"docker_file,omitempty" json:"docker_file,omitempty"`
Layers []Descriptor `bson:"layers,omitempty" json:"layers,omitempty"`
PackageFileLocation string `bson:"package_file_location,omitempty" json:"package_file_location,omitempty"`
PackageStorageURI string `bson:"package_storage_uri,omitempty" json:"package_storage_uri,omitempty"`
CreatedBy string `bson:"created_by" json:"created_by"`
CreatedTime int64 `bson:"created_time" json:"created_time"`
}
func (DeliveryArtifact) TableName ¶
func (DeliveryArtifact) TableName() string
type DeliveryBuild ¶
type DeliveryBuild struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
ReleaseID primitive.ObjectID `bson:"release_id" json:"releaseId"`
ServiceName string `bson:"service_name" json:"serviceName"`
ImageInfo *DeliveryImage `bson:"image_info" json:"imageInfo"`
ImageName string `bson:"image_name" json:"imageName"`
PackageInfo *DeliveryPackage `bson:"package_info" json:"packageInfo"`
Issues []*JiraIssue `bson:"issues" json:"issues"`
Commits []*types.Repository `bson:"commits" json:"commits"`
StartTime int64 `bson:"start_time" json:"start_time,omitempty"`
EndTime int64 `bson:"end_time" json:"end_time,omitempty"`
CreatedAt int64 `bson:"created_at" json:"created_at"`
DeletedAt int64 `bson:"deleted_at" json:"deleted_at"`
}
func (DeliveryBuild) TableName ¶
func (DeliveryBuild) TableName() string
type DeliveryDeploy ¶
type DeliveryDeploy struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
ReleaseID primitive.ObjectID `bson:"release_id" json:"releaseId"`
ServiceName string `bson:"service_name" json:"serviceName"`
ContainerName string `bson:"container_name" json:"containerName"`
Image string `bson:"image,omitempty" json:"image,omitempty"`
RegistryID string `bson:"registry_id,omitempty" json:"registry_id,omitempty"`
YamlContents []string `bson:"yaml_contents" json:"yamlContents"`
Envs []EnvObjects `bson:"envs" json:"envs"`
OrderedServices [][]string `bson:"ordered_services" json:"orderedServices"`
StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"`
EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"`
CreatedAt int64 `bson:"created_at" json:"created_at"`
DeletedAt int64 `bson:"deleted_at" json:"deleted_at"`
}
func (DeliveryDeploy) TableName ¶
func (DeliveryDeploy) TableName() string
type DeliveryDistribute ¶
type DeliveryDistribute struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
ReleaseID primitive.ObjectID `bson:"release_id" json:"releaseId"`
ServiceName string `bson:"service_name" json:"serviceName,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"`
}
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 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"`
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 ¶ added in v1.8.0
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 Descriptor ¶
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"`
}
type DindCfg ¶ added in v1.9.9
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"`
}
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 ¶ added in v1.9.9
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 ¶ added in v1.9.9
type DindStorageType string
const ( DindStorageRootfs DindStorageType = "rootfs" DindStorageDynamic DindStorageType = "dynamic" )
type DistributeStage ¶
type DistributeStage struct {
Enabled bool `bson:"enabled" json:"enabled"`
S3StorageID string `bson:"s3_storage_id" json:"s3_storage_id"`
ImageRepo string `bson:"image_repo" json:"image_repo"`
JumpBoxHost string `bson:"jump_box_host" json:"jump_box_host"`
Distributes []*ProductDistribute `bson:"distributes" json:"distributes"`
// repos to release images
Releases []RepoImage `bson:"releases" json:"releases"`
}
func (*DistributeStage) IsDistributeS3Enabled ¶
func (d *DistributeStage) IsDistributeS3Enabled() bool
type DockerBuild ¶
type DockerBuild struct {
// WorkDir docker run path
WorkDir string `bson:"work_dir" json:"work_dir"`
// DockerFile name, default is Dockerfile
DockerFile string `bson:"docker_file" json:"docker_file"`
// BuildArgs docker build args
BuildArgs string `bson:"build_args,omitempty" json:"build_args"`
// Source whether dockerfile comes from template or existing file
Source string `bson:"source" json:"source"`
// TemplateId is the id of the template dockerfile
TemplateID string `bson:"template_id" json:"template_id"`
// TemplateName is the name of the template dockerfile
TemplateName string `bson:"template_name" json:"template_name"`
}
type DockerConfig ¶
type DockerConfig struct {
HostList []string
}
type DockerfileTemplate ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (DockerfileTemplate) TableName() string
type EnvObjects ¶
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"`
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 ¶ added in v1.9.9
func (EnvResource) TableName() string
type EnvSvcDepend ¶ added in v1.9.9
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 ¶ added in v1.9.9
func (EnvSvcDepend) TableName() string
type ExtensionStage ¶ added in v1.9.9
type ExternalLink ¶ added in v1.7.0
type ExternalLink struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
URL string `bson:"url" json:"url"`
CreateTime int64 `bson:"create_time" json:"create_time"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
UpdateBy string `bson:"update_by" json:"update_by"`
}
func (ExternalLink) TableName ¶ added in v1.7.0
func (ExternalLink) TableName() string
type ExternalParamMapping ¶ added in v1.8.0
type ExternalSetting ¶ added in v1.8.0
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 ¶ added in v1.8.0
type ExternalSystem struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
Name string `bson:"name"`
Server string `bson:"server"`
APIToken string `bson:"api_token"`
}
func (ExternalSystem) TableName ¶ added in v1.8.0
func (ExternalSystem) TableName() string
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"`
}
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 ¶ added in v1.9.9
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 GitHook ¶
type GitHook struct {
Name string `bson:"name,omitempty" json:"name,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
Owner string `bson:"repo_owner" json:"repo_owner"`
Repo string `bson:"repo" json:"repo"`
Branch string `bson:"branch" json:"branch"`
Events []string `bson:"events" json:"events"`
MatchFolders []string `bson:"match_folders" json:"match_folders,omitempty"`
CodehostID int `bson:"codehost_id" json:"codehost_id"`
AutoCancel bool `bson:"auto_cancel" json:"auto_cancel"`
}
GitHook Events: push, pull_request MatchFolders: 包含目录或者文件后缀 以!开头的目录或者后缀名为不运行pipeline的过滤条件
type GithubApp ¶
type 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 HelmRepo ¶
type HelmRepo struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
RepoName string `bson:"repo_name,omitempty" json:"repo_name,omitempty"`
URL string `bson:"url" json:"url"`
Username string `bson:"username" json:"username"`
Password string `bson:"password" json:"password"`
UpdateBy string `bson:"update_by" json:"update_by"`
CreatedAt int64 `bson:"created_at" json:"created_at"`
UpdatedAt int64 `bson:"updated_at" json:"updated_at"`
}
type HelmService ¶
type HelmServiceArgs ¶
type HelmServiceArgs struct {
ProductName string `json:"product_name"`
CreateBy string `json:"create_by"`
HelmServiceInfos []*HelmServiceInfo `json:"helm_service_infos"`
}
type HelmServiceInfo ¶
type HelmServiceResp ¶
type HelmServiceRespArgs ¶
type HelmServiceRespArgs struct {
HelmServices []*HelmServiceResp `json:"helm_services"`
}
type HelmVersions ¶
type HookPayload ¶
type HookPayload struct {
Owner string `bson:"owner" json:"owner,omitempty"`
Repo string `bson:"repo" json:"repo,omitempty"`
Branch string `bson:"branch" json:"branch,omitempty"`
Ref string `bson:"ref" json:"ref,omitempty"`
IsPr bool `bson:"is_pr" json:"is_pr,omitempty"`
CheckRunID int64 `bson:"check_run_id" json:"check_run_id,omitempty"`
DeliveryID string `bson:"delivery_id" json:"delivery_id,omitempty"`
}
type ImagePathSpec ¶ added in v1.5.0
type ImagePathSpec struct {
Repo string `bson:"repo,omitempty" json:"repo,omitempty"`
Image string `bson:"image,omitempty" json:"image,omitempty"`
Tag string `bson:"tag,omitempty" json:"tag,omitempty"`
}
ImagePathSpec paths in yaml used to parse image
type ImageReleaseConfig ¶
type ImagesByService ¶ added in v1.8.0
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"`
}
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"`
}
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 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 JobProperties ¶ added in v1.9.9
type JobProperties struct {
Timeout int64 `bson:"timeout" json:"timeout"`
Retry int64 `bson:"retry" json:"retry"`
ResourceRequest setting.Request `bson:"resource_request" json:"resource_request"`
ClusterID string `bson:"cluster_id" json:"cluster_id"`
BuildOS string `bson:"build_os" json:"build_os"`
ImageFrom string `bson:"image_from" json:"image_from"`
Namespace string `bson:"namespace" json:"namespace"`
Args []*KeyVal `bson:"args" json:"args"`
Paths string `bson:"-" json:"-"`
LogFileName string `bson:"log_file_name" json:"log_file_name"`
DockerHost string `bson:"-" json:"docker_host,omitempty"`
}
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 JobProperties `bson:"properties" json:"properties"`
Steps []*StepTask `bson:"steps" json:"steps"`
Outputs []*Output `bson:"outputs" json:"outputs"`
}
type K8SCluster ¶
type K8SCluster struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Name string `json:"name" bson:"name"`
Tags []string `json:"tags" bson:"tags"`
Description string `json:"description" bson:"description"`
Namespace string `json:"namespace" bson:"namespace"`
Info *K8SClusterInfo `json:"info,omitempty" bson:"info,omitempty"`
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"`
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"`
}
func (K8SCluster) TableName ¶
func (K8SCluster) TableName() string
type K8SClusterInfo ¶
type K8SClusterResp ¶ added in v1.8.0
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 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 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 ¶ added in v1.9.9
func (m *MainHookRepo) GetRepoNamespace() string
type MessageCtx ¶
type NodeSelectorRequirement ¶ added in v1.8.0
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"`
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 NotificationTask ¶
type NotificationTask struct {
ProductName string `bson:"product_name" json:"product_name"`
WorkflowName string `bson:"workflow_name" json:"workflow_name"`
PipelineName string `bson:"pipeline_name" json:"pipeline_name"`
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"` // 是否已读
}
type NotifyCtl ¶
type NotifyCtl struct {
Enabled bool `bson:"enabled" json:"enabled"`
WebHookType string `bson:"webhook_type" json:"webhook_type"`
WeChatWebHook string `bson:"weChat_webHook,omitempty" json:"weChat_webHook,omitempty"`
DingDingWebHook string `bson:"dingding_webhook,omitempty" json:"dingding_webhook,omitempty"`
FeiShuWebHook string `bson:"feishu_webhook,omitempty" json:"feishu_webhook,omitempty"`
AtMobiles []string `bson:"at_mobiles,omitempty" json:"at_mobiles,omitempty"`
IsAtAll bool `bson:"is_at_all,omitempty" json:"is_at_all,omitempty"`
NotifyTypes []string `bson:"notify_type" json:"notify_type"`
}
type ObjectStorageUpload ¶ added in v1.9.9
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 ParamVal ¶
type ParamVal struct {
Target string `bson:"target" json:"target"`
Value string `bson:"value" json:"value"`
}
ParamVal 参数化过程服务配置值
type ParameterSetting ¶ added in v1.8.0
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 ¶ added in v1.8.0
type ParameterSettingType string
const ( StringType ParameterSettingType = "string" ChoiceType ParameterSettingType = "choice" ExternalType ParameterSettingType = "external" )
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"`
}
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 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 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 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 12.04, 14.04, 16.04
BuildOS string `bson:"build_os" json:"build_os"`
ImageFrom string `bson:"image_from" json:"image_from"`
ImageID string `bson:"image_id" json:"image_id"`
// Installs defines apps to be installed for build
Installs []*Item `bson:"installs,omitempty" json:"installs"`
// Envs stores user defined env key val for build
Envs []*KeyVal `bson:"envs,omitempty" json:"envs"`
// EnableProxy
EnableProxy bool `bson:"enable_proxy,omitempty" json:"enable_proxy"`
// Parameters
Parameters []*Parameter `bson:"parameters,omitempty" json:"parameters"`
// UploadPkg uploads package to s3
UploadPkg bool `bson:"upload_pkg" json:"upload_pkg"`
ClusterID string `bson:"cluster_id" json:"cluster_id"`
// TODO: Deprecated.
Namespace string `bson:"namespace" json:"namespace"`
}
PreBuild prepares an environment for a job
type PreTest ¶
type PreTest struct {
// TODO: Deprecated.
CleanWorkspace bool `bson:"clean_workspace" json:"clean_workspace"`
// BuildOS defines job image OS, it supports 12.04, 14.04, 16.04
BuildOS string `bson:"build_os" json:"build_os"`
ImageFrom string `bson:"image_from" json:"image_from"`
ImageID string `bson:"image_id" json:"image_id"`
// ResReq defines job requested resources
ResReq 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"`
// TODO: Deprecated.
Namespace string `bson:"namespace" json:"namespace"`
}
PreTest prepares an environment for a job
type PrivateKey ¶
type PrivateKey struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
UserName string `bson:"user_name" json:"user_name"`
IP string `bson:"ip" json:"ip"`
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"`
}
func (PrivateKey) TableName ¶
func (PrivateKey) TableName() string
type Product ¶
type Product struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
ProductName string `bson:"product_name" json:"product_name"`
CreateTime int64 `bson:"create_time" json:"create_time"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
Status string `bson:"status" json:"status"`
Revision int64 `bson:"revision" json:"revision"`
Enabled bool `bson:"enabled" json:"enabled"`
EnvName string `bson:"env_name" json:"env_name"`
UpdateBy string `bson:"update_by" json:"update_by"`
Auth []*ProductAuth `bson:"auth" json:"auth"`
Visibility string `bson:"-" json:"visibility"`
Services [][]*ProductService `bson:"services" json:"services"`
Render *RenderInfo `bson:"render" json:"render"`
Error string `bson:"error" json:"error"`
Vars []*templatemodels.RenderKV `bson:"vars,omitempty" json:"vars,omitempty"`
ChartInfos []*templatemodels.RenderChart `bson:"-" json:"chart_infos,omitempty"`
IsPublic bool `bson:"is_public" json:"isPublic"`
RoleIDs []int64 `bson:"role_ids" json:"roleIds"`
ClusterID string `bson:"cluster_id,omitempty" json:"cluster_id,omitempty"`
RecycleDay int `bson:"recycle_day" json:"recycle_day"`
Source string `bson:"source" json:"source"`
IsOpenSource bool `bson:"is_opensource" json:"is_opensource"`
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: temp flag
IsForkedProduct bool `bson:"-" json:"-"`
ShareEnv ProductShareEnv `bson:"share_env" json:"share_env"`
// New Since v1.13.0.
EnvConfigs []*CreateUpdateCommonEnvCfgArgs `bson:"-" json:"env_configs,omitempty"`
}
Vars不做保存,只做input参数
func (*Product) GetGroupServiceNames ¶
func (*Product) GetNamespace ¶
TODO: LOU: what namespace is it??
func (*Product) GetServiceMap ¶
func (p *Product) GetServiceMap() map[string]*ProductService
type ProductAuth ¶
type ProductAuth struct {
Type ProductAuthType `bson:"type" json:"type"`
Name string `bson:"name" json:"name"`
Permissions []ProductPermission `bson:"permissions" json:"permissions"`
}
type ProductAuthType ¶
type ProductAuthType string
type ProductDistribute ¶
type ProductDistribute struct {
Target *ServiceModuleTarget `bson:"target" json:"target"`
ImageDistribute bool `bson:"image_distribute" json:"image_distribute"`
JumpBoxDistribute bool `bson:"jump_box_distribute" json:"jump_box_distribute"`
QstackDistribute bool `bson:"qstack_distribute" json:"qstack_distribute"`
}
type ProductPermission ¶
type ProductPermission string
type ProductService ¶
type ProductService struct {
ServiceName string `bson:"service_name" json:"service_name"`
ProductName string `bson:"product_name" json:"product_name"`
Type string `bson:"type" json:"type"`
Revision int64 `bson:"revision" json:"revision"`
Containers []*Container `bson:"containers" json:"containers,omitempty"`
Render *RenderInfo `bson:"render,omitempty" json:"render,omitempty"` // 记录每个服务render信息 便于更新单个服务
Error string `bson:"error,omitempty" json:"error,omitempty"`
EnvConfigs []*EnvConfig `bson:"-" json:"env_configs,omitempty"`
}
type ProductShareEnv ¶ added in v1.9.9
type ProductShareEnv struct {
}
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 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 ¶
type ProxyConfig ¶
type Queue ¶
type Queue struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
TaskID int64 `bson:"task_id" json:"task_id"`
ProductName string `bson:"product_name" json:"product_name"`
PipelineName string `bson:"pipeline_name" json:"pipeline_name"`
Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"`
Type config.PipelineType `bson:"type" json:"type"`
Status config.Status `bson:"status" json:"status,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
TaskCreator string `bson:"task_creator" json:"task_creator,omitempty"`
TaskRevoker string `bson:"task_revoker,omitempty" json:"task_revoker,omitempty"`
CreateTime int64 `bson:"create_time" json:"create_time,omitempty"`
StartTime int64 `bson:"start_time" json:"start_time,omitempty"`
EndTime int64 `bson:"end_time" json:"end_time,omitempty"`
SubTasks []map[string]interface{} `bson:"sub_tasks" json:"sub_tasks"`
Stages []*Stage `bson:"stages" json:"stages"`
ReqID string `bson:"req_id,omitempty" json:"req_id,omitempty"`
AgentHost string `bson:"agent_host,omitempty" json:"agent_host,omitempty"`
DockerHost string `bson:"-" json:"docker_host,omitempty"`
TeamID int `bson:"team_id,omitempty" json:"team_id,omitempty"`
TeamName string `bson:"team,omitempty" json:"team,omitempty"`
IsDeleted bool `bson:"is_deleted" json:"is_deleted"`
IsArchived bool `bson:"is_archived" json:"is_archived"`
AgentID string `bson:"agent_id" json:"agent_id"`
MultiRun bool `bson:"multi_run" json:"multi_run"`
Target 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
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"`
RwLock sync.Mutex `bson:"-" json:"-"`
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"`
}
type RegistryAdvancedSetting ¶ added in v1.9.9
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 RegistryConfig ¶
type RegistryNamespace ¶
type RegistryNamespace struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
RegAddr string `bson:"reg_addr" json:"reg_addr"`
RegType string `bson:"reg_type" json:"reg_type"`
RegProvider string `bson:"reg_provider" json:"reg_provider"`
IsDefault bool `bson:"is_default" json:"is_default"`
// Namespace 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) 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 ¶ added in v1.8.0
type RenderInfo ¶
type RenderSet ¶
type RenderSet struct {
// Name = EnvName == "" ? ProductTmpl : (EnvName + "-" + ProductTempl)
Name string `bson:"name" json:"name"`
Revision int64 `bson:"revision" json:"revision"`
// 可以为空,空时为产品模板默认的渲染集,非空时为环境的渲染集
EnvName string `bson:"env_name,omitempty" json:"env_name,omitempty"`
ProductTmpl string `bson:"product_tmpl" json:"product_tmpl"`
Team string `bson:"team,omitempty" json:"team,omitempty"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
UpdateBy string `bson:"update_by" json:"update_by"`
IsDefault bool `bson:"is_default" json:"is_default"`
DefaultValues string `bson:"default_values,omitempty" json:"default_values,omitempty"`
YamlData *templatemodels.CustomYaml `bson:"yaml_data,omitempty" json:"yaml_data,omitempty"`
KVs []*templatemodels.RenderKV `bson:"kvs,omitempty" json:"kvs,omitempty"`
ChartInfos []*templatemodels.RenderChart `bson:"chart_infos,omitempty" json:"chart_infos,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
}
RenderSet ...
func (*RenderSet) GetKeyValueMap ¶
func (*RenderSet) HelmRenderDiff ¶
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 Resources ¶ added in v1.9.9
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 S3Storage ¶
type S3Storage struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
Ak string `bson:"ak" json:"ak"`
Sk string `bson:"-" json:"sk"`
Endpoint string `bson:"endpoint" json:"endpoint"`
Bucket string `bson:"bucket" json:"bucket"`
Subfolder string `bson:"subfolder" json:"subfolder"`
Insecure bool `bson:"insecure" json:"insecure"`
IsDefault bool `bson:"is_default" json:"is_default"`
EncryptedSk string `bson:"encryptedSk" json:"-"`
UpdatedBy string `bson:"updated_by" json:"updated_by"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
Provider int8 `bson:"provider" json:"provider"`
}
type Scanning ¶ added in v1.9.9
type Scanning 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"`
ScannerType string `bson:"scanner_type" json:"scanner_type"`
ImageID string `bson:"image_id" json:"image_id"`
SonarID string `bson:"sonar_id" json:"sonar_id"`
Repos []*types.Repository `bson:"repos" json:"repos"`
// Parameter is for sonarQube type only
Parameter string `bson:"parameter" json:"parameter"`
// Script is for other type only
Script string `bson:"script" json:"script"`
AdvancedSetting *types.ScanningAdvancedSetting `bson:"advanced_setting" json:"advanced_setting"`
CreatedAt int64 `bson:"created_at" json:"created_at"`
UpdatedAt int64 `bson:"updated_at" json:"updated_at"`
UpdatedBy string `bson:"updated_by" json:"updated_by"`
}
type ScanningArgs ¶ added in v1.9.9
type Schedule ¶
type Schedule struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Number uint64 `bson:"number" json:"number"`
Frequency string `bson:"frequency" json:"frequency"`
Time string `bson:"time" json:"time"`
MaxFailures int `bson:"max_failures,omitempty" json:"max_failures,omitempty"`
TaskArgs *TaskArgs `bson:"task_args,omitempty" json:"task_args,omitempty"`
WorkflowArgs *WorkflowTaskArgs `bson:"workflow_args,omitempty" json:"workflow_args,omitempty"`
TestArgs *TestTaskArgs `bson:"test_args,omitempty" json:"test_args,omitempty"`
Type config.ScheduleType `bson:"type" json:"type"`
Cron string `bson:"cron" json:"cron"`
IsModified bool `bson:"-" json:"-"`
// 自由编排工作流的开关是放在schedule里面的
Enabled bool `bson:"enabled" json:"enabled"`
}
type ScheduleCtrl ¶
type SecurityStage ¶
type SecurityStage struct {
Enabled bool `bson:"enabled" json:"enabled"`
}
type Service ¶
type Service struct {
ServiceName string `bson:"service_name" json:"service_name"`
Type string `bson:"type" json:"type"`
Team string `bson:"team,omitempty" json:"team,omitempty"`
ProductName string `bson:"product_name" json:"product_name"`
Revision int64 `bson:"revision" json:"revision"`
Source string `bson:"source,omitempty" json:"source,omitempty"`
GUIConfig *GUIConfig `bson:"gui_config,omitempty" json:"gui_config,omitempty"`
Yaml string `bson:"yaml,omitempty" json:"yaml"`
SrcPath string `bson:"src_path,omitempty" json:"src_path,omitempty"`
Commit *Commit `bson:"commit,omitempty" json:"commit,omitempty"`
KubeYamls []string `bson:"-" json:"-"`
Hash string `bson:"hash256,omitempty" json:"hash256,omitempty"`
CreateTime int64 `bson:"create_time" json:"create_time"`
CreateBy string `bson:"create_by" json:"create_by"`
Containers []*Container `bson:"containers,omitempty" json:"containers,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
Visibility string `bson:"visibility,omitempty" json:"visibility,omitempty"`
Status string `bson:"status,omitempty" json:"status,omitempty"`
GerritRepoName string `bson:"gerrit_repo_name,omitempty" json:"gerrit_repo_name,omitempty"`
GerritBranchName string `bson:"gerrit_branch_name,omitempty" json:"gerrit_branch_name,omitempty"`
GerritRemoteName string `bson:"gerrit_remote_name,omitempty" json:"gerrit_remote_name,omitempty"`
GerritPath string `bson:"gerrit_path,omitempty" json:"gerrit_path,omitempty"`
GerritCodeHostID int `bson:"gerrit_codeHost_id,omitempty" json:"gerrit_codeHost_id,omitempty"`
GiteePath string `bson:"gitee_path,omitempty" json:"gitee_path,omitempty"`
BuildName string `bson:"build_name" json:"build_name"`
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"`
EnvName string `bson:"env_name,omitempty" json:"env_name,omitempty"`
TemplateID string `bson:"template_id,omitempty" json:"template_id,omitempty"`
AutoSync bool `bson:"auto_sync" json:"auto_sync"`
}
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 ¶ added in v1.9.9
func (*Service) GetRepoNamespace ¶ added in v1.9.9
type ServiceAndBuild ¶ added in v1.9.9
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:"-" yaml:"-" json:"image"`
Package string `bson:"-" yaml:"-" json:"package"`
KeyVals []*KeyVal `bson:"key_vals" yaml:"key_vals" json:"key_vals"`
Repos []*types.Repository `bson:"-" yaml:"-" json:"repos"`
}
type ServiceAndImage ¶ added in v1.9.9
type ServiceConfig ¶
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 ¶ added in v1.9.9
type ServiceTaskArgs ¶
type ServiceTaskArgs struct {
ProductName string `bson:"product_name" json:"product_name"`
ServiceName string `bson:"service_name" json:"service_name"`
Revision int64 `bson:"revision" json:"revision"`
BuildName string `bson:"build_name" json:"build_name"`
EnvNames []string `bson:"env_names" json:"env_names"`
ServiceTaskCreator string `bson:"service_task_creator" json:"service_task_creator"`
Namespace string `bson:"namespace" json:"namespace"`
K8sNamespace string `bson:"k8s_namespace" json:"k8s_namespace"`
Updatable bool `bson:"updatable" json:"updatable"`
}
type ServiceTmplPipeResp ¶
type ServiceTmplPipeResp struct {
ID ServiceTmplRevision `bson:"_id" json:"_id"`
Revision int64 `bson:"revision" json:"revision"`
SrcPath string `bson:"src_path" json:"src_path"`
Visibility string `bson:"visibility,omitempty" json:"visibility,omitempty"`
Containers []*Container `bson:"containers,omitempty" json:"containers,omitempty"`
Source string `bson:"source" json:"source"`
CodehostID int `bson:"codehost_id" json:"codehost_id"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoName string `bson:"repo_name" json:"repo_name"`
RepoUUID string `bson:"repo_uuid" json:"repo_uuid"`
BranchName string `bson:"branch_name" json:"branch_name"`
LoadPath string `bson:"load_path" json:"load_path"`
LoadFromDir bool `bson:"is_dir" json:"is_dir"`
GerritRemoteName string `bson:"gerrit_remote_name,omitempty" json:"gerrit_remote_name,omitempty"`
}
ServiceTmplPipeResp ...router
type ServiceTmplRevision ¶
type ServiceTmplRevision struct {
ProductName string `bson:"product_name" json:"product_name"`
ServiceName string `bson:"service_name" json:"service_name"`
Type string `bson:"type" json:"type"`
Revision int64 `bson:"revision,omitempty" json:"revision,omitempty"`
Source string `bson:"source" json:"source"`
CodehostID int `bson:"codehost_id" json:"codehost_id"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoName string `bson:"repo_name" json:"repo_name"`
BranchName string `bson:"branch_name" json:"branch_name"`
LoadPath string `bson:"load_path" json:"load_path"`
LoadFromDir bool `bson:"is_dir" json:"is_dir"`
GerritRemoteName string `bson:"gerrit_remote_name,omitempty" json:"gerrit_remote_name,omitempty"`
}
ServiceTmplRevision ...
type ServicesInExternalEnv ¶ added in v1.6.0
type ServicesInExternalEnv struct {
ProductName string `bson:"product_name" json:"product_name"`
ServiceName string `bson:"service_name" json:"service_name"`
EnvName string `bson:"env_name" json:"env_name"`
Namespace string `bson:"namespace" json:"namespace"`
ClusterID string `bson:"cluster_id" json:"cluster_id"`
}
func (ServicesInExternalEnv) TableName ¶ added in v1.6.0
func (ServicesInExternalEnv) TableName() string
type 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 SonarIntegration ¶ added in v1.9.9
type SonarIntegration struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
ServerAddress string `bson:"server_address"`
Token string `bson:"token"`
}
func (SonarIntegration) TableName ¶ added in v1.9.9
func (SonarIntegration) TableName() string
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"`
}
Stage ...
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 *Approval `bson:"approval" json:"approval"`
Jobs []*JobTask `bson:"jobs" json:"jobs"`
Error string `bson:"error" json:"error"`
}
type Stats ¶
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 SubTask ¶
type SubTask map[string]interface{}
func (*SubTask) ToTestingTask ¶
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 ¶ added in v1.9.9
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"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
}
func (SystemSetting) TableName ¶ added in v1.9.9
func (SystemSetting) TableName() string
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 ¶ added in v1.9.9
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 TestArgs ¶
type TestArgs struct {
Namespace string `bson:"namespace" json:"namespace"`
TestModuleName string `bson:"test_module_name" json:"test_module_name"`
Envs []*KeyVal `bson:"envs" json:"envs"`
Builds []*types.Repository `bson:"builds" json:"builds"`
}
type TestCase ¶
type TestCase struct {
Name string `bson:"tc_name" json:"tc_name" xml:"name,attr"`
ClassName string `bson:"classname" json:"classname" xml:"classname,attr"`
Time float64 `bson:"time" json:"time" xml:"time,attr"`
Failure *Failure `bson:"failure,omitempty" json:"failure" xml:"failure,omitempty"`
Skipped *Skipped `bson:"skipped,omitempty" json:"skipped" xml:"skipped,omitempty"`
SystemOut string `bson:"system_out,omitempty" json:"system_out" xml:"system-out,omitempty"`
SystemErr string `bson:"system-err,omitempty" json:"system_err" xml:"system-err,omitempty"`
Error *Error `bson:"error,omitempty" json:"error" xml:"error,omitempty"`
}
type TestConfig ¶
type TestConfig struct {
KubeNamespace string
}
type TestExecArgs ¶
type TestExecArgs struct {
Name string `bson:"test_name" json:"test_name"`
Envs []*KeyVal `bson:"envs" json:"envs"`
}
TestExecArgs ...
type TestReport ¶
type TestReport struct {
FunctionTestSuite *TestSuite `bson:"function_test_suite,omitempty" json:"functionTestSuite,omitempty"`
PerformanceTestSuites []*PerformanceTestSuite `bson:"performance_test_suite,omitempty" json:"performanceTestSuite,omitempty"`
Security map[string]map[string]int `bson:"security,omitempty" json:"security,omitempty"`
}
type TestReportObject ¶
type TestReportObject struct {
TestResultPath string `bson:"test_result_path" json:"testResultPath"`
WorkflowName string `bson:"workflow_name" json:"workflowName"`
TaskID int64 `bson:"task_id" json:"taskId"`
TestName string `bson:"test_name" json:"testName"`
FunctionTestSuite *TestSuite `bson:"test_suite" json:"testSuite"`
PerformanceTestSuites []*PerformanceTestSuite `bson:"performance_test_suite" json:"performanceTestSuite"`
StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"`
EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"`
}
TestReportObject ...
type TestStage ¶
type TestStage struct {
Enabled bool `bson:"enabled" json:"enabled"`
TestNames []string `bson:"test_names,omitempty" json:"test_names,omitempty"`
Tests []*TestExecArgs `bson:"tests,omitempty" json:"tests,omitempty"`
}
type TestSuite ¶
type TestSuite struct {
// 总数=tests+skips 成功=tests-failures-errors
Tests int `bson:"tests" json:"tests" xml:"tests,attr"`
Failures int `bson:"failures" json:"failures" xml:"failures,attr"`
Successes int `bson:"successes,omitempty" json:"successes,omitempty" xml:"successes,attr,omitempty"`
Skips int `bson:"skips" json:"skips" xml:"skips,attr"`
Errors int `bson:"errors,omitempty" json:"errors" xml:"errors,attr,omitempty"`
Time float64 `bson:"time" json:"time" xml:"time,attr"`
SystemOut string `bson:"system_out,omitempty" json:"system_out" xml:"system-out,omitempty"`
SystemErr string `bson:"system-err,omitempty" json:"system_err" xml:"system-err,omitempty"`
TestCases []TestCase `bson:"testcase" json:"testcase" xml:"testcase"`
SuiteType string `bson:"-" json:"-" xml:"-"`
Name string `bson:"name" json:"-" xml:"-"`
}
type TestSuiteSummary ¶
type TestSuiteSummary struct {
Tests int `bson:"tests" json:"tests" xml:"tests,attr"`
Failures int `bson:"failures" json:"failures" xml:"failures,attr"`
Skips int `bson:"skips" json:"skips" xml:"skips,attr"`
Errors int `bson:"errors" json:"errors" xml:"errors,attr"`
Time float64 `bson:"time" json:"time" xml:"time,attr"`
}
type TestTaskArgs ¶
type TestTaskArgs struct {
ProductName string `bson:"product_name" json:"product_name"`
TestName string `bson:"test_name" json:"test_name"`
TestTaskCreator string `bson:"test_task_creator" json:"test_task_creator"`
NotificationID string `bson:"notification_id" json:"notification_id"`
ReqID string `bson:"req_id" json:"req_id"`
// webhook触发测试任务时,触发任务的repo、prID和commitID
MergeRequestID string `bson:"merge_request_id" json:"merge_request_id"`
CommitID string `bson:"commit_id" json:"commit_id"`
Source string `bson:"source" json:"source"`
CodehostID int `bson:"codehost_id" json:"codehost_id"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoNamespace string `bson:"repo_namespace" json:"repo_namespace"`
RepoName string `bson:"repo_name" json:"repo_name"`
}
type TestTaskStat ¶
type TestTaskStat struct {
Name string `bson:"name" json:"name"`
TotalSuccess int `bson:"total_success" json:"totalSuccess"`
TotalFailure int `bson:"total_failure" json:"totalFailure"`
TotalDuration int64 `bson:"total_duration" json:"totalDuration"`
TestCaseNum int `bson:"test_case_num" json:"testCaseNum"`
CreateTime int64 `bson:"create_time" json:"createTime"`
UpdateTime int64 `bson:"update_time" json:"updateTime"`
}
func (TestTaskStat) TableName ¶
func (TestTaskStat) TableName() string
type Testing ¶
type Testing struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
ProductName string `bson:"product_name" json:"product_name"`
Desc string `bson:"desc" json:"desc"`
Timeout int `bson:"timeout" json:"timeout"`
Team string `bson:"team" json:"team"`
Repos []*types.Repository `bson:"repos" json:"repos"`
PreTest *PreTest `bson:"pre_test" json:"pre_test"`
Scripts string `bson:"scripts" json:"scripts"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
UpdateBy string `bson:"update_by" json:"update_by"`
// Junit 测试报告
TestResultPath string `bson:"test_result_path" json:"test_result_path"`
// html 测试报告
TestReportPath string `bson:"test_report_path" json:"test_report_path"`
Threshold int `bson:"threshold" json:"threshold"`
TestType string `bson:"test_type" json:"test_type"`
// 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"`
}
type TestingHook ¶
type TestingHook struct {
AutoCancel bool `bson:"auto_cancel" json:"auto_cancel"`
MainRepo *MainHookRepo `bson:"main_repo" json:"main_repo"`
TestArgs *TestTaskArgs `bson:"test_args" json:"test_args"`
}
type TestingHookCtrl ¶
type TestingHookCtrl struct {
Enabled bool `bson:"enabled" json:"enabled"`
Items []*TestingHook `bson:"items" json:"items"`
}
type TriggerBy ¶
type TriggerBy struct {
// 触发此次任务的代码库信息
CodehostID int `bson:"codehost_id,omitempty" json:"codehost_id,omitempty"`
RepoOwner string `bson:"repo_owner,omitempty" json:"repo_owner,omitempty"`
RepoName string `bson:"repo_name,omitempty" json:"repo_name,omitempty"`
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"`
}
type User ¶ added in v1.9.9
type User struct {
UserID string `bson:"user_id" yaml:"user_id" json:"user_id"`
UserName string `bson:"user_name" yaml:"user_name" json:"user_name"`
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 VersionArgs ¶
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"`
}
type WebHookUser ¶
type WebHookUser struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Domain string `bson:"domain,omitempty" json:"domain,omitempty"`
UserName string `bson:"user_name" json:"user_name"`
Email string `bson:"email" json:"email"`
Source string `bson:"source" json:"source"`
CreatedAt int64 `bson:"created_at" json:"created_at"`
}
func (WebHookUser) TableName ¶
func (WebHookUser) TableName() string
type Workflow ¶
type Workflow struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
Enabled bool `bson:"enabled" json:"enabled"`
ProductTmplName string `bson:"product_tmpl_name" json:"product_tmpl_name"`
Team string `bson:"team,omitempty" json:"team,omitempty"`
EnvName string `bson:"env_name" json:"env_name,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
UpdateBy string `bson:"update_by" json:"update_by,omitempty"`
CreateBy string `bson:"create_by" json:"create_by,omitempty"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
CreateTime int64 `bson:"create_time" json:"create_time"`
Schedules *ScheduleCtrl `bson:"schedules,omitempty" json:"schedules,omitempty"`
ScheduleEnabled bool `bson:"schedule_enabled" json:"schedule_enabled"`
Slack *Slack `bson:"slack,omitempty" json:"slack,omitempty"`
BuildStage *BuildStage `bson:"build_stage" json:"build_stage"`
ArtifactStage *ArtifactStage `bson:"artifact_stage,omitempty" json:"artifact_stage,omitempty"`
TestStage *TestStage `bson:"test_stage" json:"test_stage"`
SecurityStage *SecurityStage `bson:"security_stage" json:"security_stage"`
DistributeStage *DistributeStage `bson:"distribute_stage" json:"distribute_stage"`
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"`
}
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"`
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 ¶ added in v1.9.9
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"`
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"`
MultiRun bool `bson:"multi_run" json:"multi_run"`
}
func (WorkflowQueue) TableName ¶ added in v1.9.9
func (WorkflowQueue) TableName() string
type WorkflowStage ¶ added in v1.9.9
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 ¶ 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"`
WorkflowArgs *WorkflowV4 `bson:"workflow_args" json:"workflow_args"`
KeyVals []*KeyVal `bson:"key_vals" json:"key_vals"`
GlobalContext map[string]string `bson:"global_context" json:"global_context"`
Status config.Status `bson:"status" json:"status,omitempty"`
TaskCreator string `bson:"task_creator" json:"task_creator,omitempty"`
TaskRevoker string `bson:"task_revoker,omitempty" json:"task_revoker,omitempty"`
CreateTime int64 `bson:"create_time" json:"create_time,omitempty"`
StartTime int64 `bson:"start_time" json:"start_time,omitempty"`
EndTime int64 `bson:"end_time" json:"end_time,omitempty"`
Stages []*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"`
MultiRun bool `bson:"multi_run" json:"multi_run"`
}
func (WorkflowTask) TableName ¶ added in v1.9.9
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"`
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 ¶ added in v1.9.9
type WorkflowTaskCtx struct {
WorkflowName string
ProjectName string
TaskID int64
DockerHost string
Workspace string
DistDir string
DockerMountDir string
ConfigMapMountDir string
WorkflowKeyVals []*KeyVal
GlobalContextGet func(key string) (string, bool)
GlobalContextSet func(key, value string)
GlobalContextEach func(f func(k, v string) bool)
}
type WorkflowV3 ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (WorkflowV3) TableName() string
type WorkflowV3Args ¶ added in v1.8.0
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 ¶ added in v1.9.9
type WorkflowV4 struct {
ID primitive.ObjectID `bson:"_id,omitempty" yaml:"-" json:"id"`
Name string `bson:"name" yaml:"name" json:"name"`
KeyVals []*KeyVal `bson:"key_vals" yaml:"key_vals" json:"key_vals"`
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"`
MultiRun bool `bson:"multi_run" yaml:"multi_run" json:"multi_run"`
}
func (WorkflowV4) TableName ¶ added in v1.9.9
func (WorkflowV4) TableName() string
type WorkloadStat ¶ added in v1.5.0
type WorkloadStat struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
ClusterID string `bson:"cluster_id" json:"cluster_id"`
Namespace string `bson:"namespace" json:"namespace"`
Workloads []Workload `bson:"workloads" json:"workloads"`
}
func (WorkloadStat) TableName ¶ added in v1.5.0
func (WorkloadStat) TableName() string
type YamlPreview ¶
type YamlPreview struct {
Kind string `bson:"-" json:"kind"`
}
type YamlPreviewForPorts ¶
type YamlTemplate ¶ added in v1.6.0
type YamlTemplate struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name" json:"name"`
Content string `bson:"content" json:"content"`
Variables []*Variable `bson:"variables" json:"variables"`
}
func (YamlTemplate) TableName ¶ added in v1.6.0
func (YamlTemplate) TableName() string
type ZadigBuildJobSpec ¶ added in v1.9.9
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"`
}
type ZadigDeployJobSpec ¶ added in v1.9.9
type ZadigDeployJobSpec struct {
Env string `bson:"env" yaml:"env" json:"env"`
DeployType string `bson:"-" yaml:"-" json:"deploy_type"`
// 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"`
ServiceAndImages []*ServiceAndImage `bson:"-" yaml:"-" json:"service_and_images"`
}
Source Files
¶
- basic_images.go
- build.go
- build_template.go
- callback_request.go
- chart.go
- counter.go
- cronjob.go
- delivery_activity.go
- delivery_artifact.go
- delivery_build.go
- delivery_deploy.go
- delivery_distribute.go
- delivery_security.go
- delivery_testing.go
- delivery_version.go
- diff_note.go
- dind_clean.go
- dockerfile.go
- env_resource.go
- env_svc_depend.go
- external_link.go
- external_system.go
- favorite_pipeline.go
- github_app.go
- helm_repo.go
- install.go
- it_report.go
- jenkins.go
- k8s_cluster.go
- notification.go
- notify.go
- pipeline.go
- private_key.go
- product.go
- project_cluster_relation.go
- proxy.go
- queue.go
- registry_namespace.go
- render_set.go
- s3.go
- scanning.go
- service.go
- services_in_external_env.go
- settings.go
- sonar.go
- stats.go
- strategy.go
- subscription.go
- test_task_stat.go
- testing.go
- user_stat.go
- webhook.go
- wokflow_task_v4.go
- workflow.go
- workflow_queue.go
- workflow_stat.go
- workflow_v3.go
- workflow_v4.go
- workload_stat.go
- yaml_template.go