Documentation ¶
Index ¶
- func IToi(before interface{}, after interface{}) error
- type AdvancedConfig
- type Artifact
- type ArtifactArgs
- type ArtifactInfo
- type ArtifactPackage
- type ArtifactPackageTaskArgs
- type Build
- type BuildArgs
- type BuildConfig
- type BuildStatus
- type BuildStep
- type CallbackArgs
- type CallbackPayload
- type CallbackPayloadObj
- type ConfigPayload
- type Container
- type Deploy
- type DeployArgs
- type DeployEnv
- type DistributeToS3
- type DockerBuild
- type DockerBuildCtx
- type DockerBuildStatus
- type DockerConfig
- type EnvConfig
- type FileArchiveCtx
- type GithubConfig
- type GitlabConfig
- type HookPayload
- type ImageData
- type ImageReleaseConfig
- type ImagesByService
- type Install
- type Item
- type JenkinsBuild
- type JenkinsBuildArgs
- type JenkinsBuildConfig
- type JenkinsBuildParam
- type JenkinsIntegration
- type Jira
- type JiraIssue
- type JobCtx
- type JobCtxBuilder
- type K8SCluster
- type KeyVal
- type NodeSelectorRequirement
- type PipelineCtx
- type PrivateKey
- type ProductService
- type Proxy
- type ProxyConfig
- type RegistryConfig
- type RegistryNamespace
- type ReleaseConfig
- type ReleaseImage
- type ReleaseImageItem
- type RenderInfo
- type Repo
- type RepoCoverage
- type RepoImage
- type RepoStaticCheck
- type Repository
- type Resource
- type S3Config
- type SSH
- type Security
- type ServiceConfig
- type ServiceTaskArgs
- type Stage
- type StaticCheckStatus
- type StepStatus
- type TargetArgs
- type Task
- type TaskArgs
- type TaskOutput
- type TestArgs
- type TestConfig
- type TestTaskArgs
- type Testing
- type Trigger
- type TriggerBy
- type UTStatus
- type VersionArgs
- type WebhookPayload
- type WorkflowTaskArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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"` }
type Artifact ¶
type Artifact struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` Name string `bson:"name" json:"name"` Image string `bson:"image" json:"image"` RegistryID string `bson:"registry_id" json:"registry_id"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` LogFile string `bson:"log_file" json:"log_file"` IsRestart bool `bson:"is_restart" json:"is_restart"` }
type ArtifactArgs ¶
type ArtifactArgs struct { Name string `bson:"name" json:"name"` ServiceName string `bson:"service_name" json:"service_name"` Image string `bson:"image" json:"image"` 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 ArtifactInfo ¶ added in v1.6.0
type ArtifactPackage ¶ added in v1.8.0
type ArtifactPackage struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` Progress string `bson:"progress" json:"progress"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` LogFile string `bson:"log_file" json:"log_file"` // source images Images []*ImagesByService `bson:"images" json:"images"` // target registries to push images SourceRegistries []string `bson:"source_registries" json:"source_registries"` // target registries to push images TargetRegistries []string `bson:"target_registries" json:"target_registries"` }
func (*ArtifactPackage) ToSubTask ¶ added in v1.8.0
func (ri *ArtifactPackage) ToSubTask() (map[string]interface{}, error)
type ArtifactPackageTaskArgs ¶ added in v1.8.0
type ArtifactPackageTaskArgs struct { ProductName string `bson:"product_name" json:"product_name"` Images []*ImagesByService `bson:"images" json:"images"` SourceRegistries []string `bson:"source_registries" json:"source_registries"` TargetRegistries []string `bson:"target_registries" json:"target_registries"` }
type Build ¶
type Build struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` ProductName string `bson:"product_name" json:"product_name"` // 新增一个service表示服务名称 Service string `bson:"service" json:"service"` // 该名称实际为服务组件名称 ServiceName string `bson:"service_name" json:"service_name"` ServiceType string `bson:"service_type" json:"service_type"` EnvName string `bson:"env_name" json:"env_name"` Namespace string `bson:"namespace" json:"namespace"` Timeout int `bson:"timeout" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time" json:"start_time,omitempty"` EndTime int64 `bson:"end_time" json:"end_time,omitempty"` JobCtx JobCtx `bson:"job_ctx" json:"job_ctx"` DockerBuild *DockerBuild `bson:"docker_build,omitempty" json:"docker_build,omitempty"` InstallItems []*Item `bson:"install_items" json:"install_items"` BuildOS string `bson:"build_os" json:"build_os,omitempty"` ImageFrom string `bson:"image_from" json:"image_from,omitempty"` ImageID string `bson:"image_id" json:"image_id"` ResReq setting.Request `bson:"res_req" json:"res_req"` ResReqSpec setting.RequestSpec `bson:"res_req_spec" json:"res_req_spec"` LogFile string `bson:"log_file" json:"log_file"` InstallCtx []*Install `bson:"-" json:"install_ctx,omitempty"` Registries []*RegistryNamespace `bson:"-" json:"registries"` StaticCheckStatus *StaticCheckStatus `bson:"static_check_status,omitempty" json:"static_check_status,omitempty"` UTStatus *UTStatus `bson:"ut_status,omitempty" json:"ut_status,omitempty"` DockerBuildStatus *DockerBuildStatus `bson:"docker_build_status,omitempty" json:"docker_build_status,omitempty"` BuildStatus *BuildStatus `bson:"build_status,omitempty" json:"build_status,omitempty"` IsRestart bool `bson:"is_restart" json:"is_restart"` // Get the host bound to the environment of the cloud host service configuration EnvHostInfo map[string][]string `bson:"env_host_info,omitempty" json:"env_host_info,omitempty"` ArtifactInfo *ArtifactInfo `bson:"artifact_info,omitempty" json:"artifact_info,omitempty"` ClusterID string `bson:"cluster_id,omitempty" json:"cluster_id,omitempty"` }
type BuildArgs ¶
type BuildArgs struct {
Repos []*Repository `bson:"repos" json:"repos"`
}
type BuildConfig ¶
type BuildConfig struct {
KubeNamespace string
}
type BuildStatus ¶
type BuildStatus struct {
StepStatus
}
type CallbackArgs ¶ added in v1.8.0
type CallbackPayload ¶ added in v1.8.0
type CallbackPayload struct {
QRCodeURL string `bson:"QR_code_URL,omitempty" json:"QR_code_URL,omitempty"`
}
type CallbackPayloadObj ¶ added in v1.8.0
type ConfigPayload ¶
type ConfigPayload struct { APIToken string `json:"api_token"` 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"` JenkinsBuildConfig JenkinsBuildConfig `json:"jenkins_build_config"` // 推送线上镜像需要的用户名密码, 根据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"` PrivateKeys []*PrivateKey `json:"private_keys"` K8SClusters []*K8SCluster `json:"k8s_clusters"` RegistryID string `json:"registry_id"` }
func (*ConfigPayload) GetGitKnownHost ¶
func (cp *ConfigPayload) GetGitKnownHost() string
type Deploy ¶
type Deploy struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` Namespace string `bson:"namespace" json:"namespace"` EnvName string `bson:"env_name" json:"env_name"` ProductName string `bson:"product_name" json:"product_name"` ServiceName string `bson:"service_name" json:"service_name"` ServiceType string `bson:"service_type" json:"service_type"` ServiceRevision int64 `bson:"service_revision,omitempty" json:"service_revision,omitempty"` ContainerName string `bson:"container_name" json:"container_name"` Image string `bson:"image" json:"image"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` ClusterID string `bson:"cluster_id,omitempty" json:"cluster_id,omitempty"` ReplaceResources []Resource `bson:"replace_resources" json:"replace_resources"` SkipWaiting bool `bson:"skipWaiting" json:"skipWaiting"` IsRestart bool `bson:"is_restart" json:"is_restart"` ResetImage bool `bson:"reset_image" json:"reset_image"` }
Deploy 容器部署任务
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 DistributeToS3 ¶
type DistributeToS3 struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` PackageFile string `bson:"package_file" json:"package_file"` ProductName string `bson:"product_name" json:"product_name"` ServiceName string `bson:"service_name" json:"service_name"` RemoteFileKey string `bson:"remote_file_key" json:"remote_file_key,omitempty"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` DestStorageURL string `bson:"dest_storage_url" json:"dest_storage_url"` //SrcStorageUrl string `bson:"src_storage_url" json:"src_storage_url"` S3StorageID string `bson:"s3_storage_id" json:"s3_storage_id"` }
func (*DistributeToS3) SetPackageFile ¶
func (d *DistributeToS3) SetPackageFile(packageFile string)
SetPackageFile ...
func (*DistributeToS3) ToSubTask ¶
func (d *DistributeToS3) ToSubTask() (*map[string]interface{}, error)
ToSubTask ...
type DockerBuild ¶
type DockerBuild struct { Source string `bson:"source" json:"source"` // Dockerfile source TemplateID string `bson:"template_id" json:"template_id"` TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` WorkDir string `bson:"work_dir" json:"work_dir"` // Dockerfile 路径 DockerFile string `bson:"docker_file" json:"docker_file"` // Dockerfile 名称, 默认为Dockerfile BuildArgs string `bson:"build_args,omitempty" json:"build_args,omitempty"` // Docker build可变参数 Image string `bson:"image" json:"image"` OnSetup string `bson:"setup,omitempty" json:"setup,omitempty"` Timeout int `bson:"timeout" json:"timeout,omitempty"` Error string `bson:"error" json:"error,omitempty"` StartTime int64 `bson:"start_time" json:"start_time,omitempty"` EndTime int64 `bson:"end_time" json:"end_time,omitempty"` JobName string `bson:"job_name" json:"job_name"` LogFile string `bson:"log_file" json:"log_file"` }
func (*DockerBuild) ToSubTask ¶
func (db *DockerBuild) ToSubTask() (map[string]interface{}, error)
type DockerBuildCtx ¶
type DockerBuildCtx struct { WorkDir string `yaml:"work_dir" bson:"work_dir" json:"work_dir"` DockerFile string `yaml:"docker_file" bson:"docker_file" json:"docker_file"` ImageName string `yaml:"image_name" bson:"image_name" json:"image_name"` BuildArgs string `yaml:"build_args" bson:"build_args" json:"build_args"` ImageReleaseTag string `yaml:"image_release_tag,omitempty" bson:"image_release_tag,omitempty" json:"image_release_tag"` Source string `yaml:"source" bson:"source" json:"source"` DockerTemplateContent string `yaml:"docker_template_content" bson:"docker_template_content" json:"docker_template_content"` }
DockerBuildCtx ... Docker build参数 WorkDir: docker build执行路径 DockerFile: dockerfile名称, 默认为Dockerfile ImageBuild: build image镜像全称, e.g. xxx.com/release-candidates/image:tag
func (*DockerBuildCtx) GetDockerFile ¶
func (buildCtx *DockerBuildCtx) GetDockerFile() string
GetDockerFile ...
type DockerBuildStatus ¶
type DockerBuildStatus struct { StepStatus ImageName string `bson:"image_name" json:"image_name"` RegistryRepo string `bson:"registry_repo" json:"registry_repo"` }
type DockerConfig ¶
type DockerConfig struct {
HostList []string
}
type FileArchiveCtx ¶
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 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 ImageData ¶ added in v1.8.0
type ImageData struct { ImageUrl string `bson:"image_url" json:"image_url" yaml:"image_url"` ImageName string `bson:"image_name" json:"image_name" yaml:"image_name"` ImageTag string `bson:"image_tag" json:"image_tag" yaml:"image_tag"` RegistryID string `bson:"registry_id" json:"registry_id" yaml:"registry_id"` }
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 JenkinsBuild ¶
type JenkinsBuild struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` ServiceName string `bson:"service_name" json:"service_name"` Service string `bson:"service" json:"service"` OnSetup string `bson:"setup,omitempty" json:"setup,omitempty"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` ResReq setting.Request `bson:"res_req" json:"res_req"` ResReqSpec setting.RequestSpec `bson:"res_req_spec" json:"res_req_spec"` JenkinsIntegration *JenkinsIntegration `bson:"jenkins_integration" json:"jenkins_integration"` JenkinsBuildArgs *JenkinsBuildArgs `bson:"jenkins_build_args" json:"jenkins_build_args"` Registries []*RegistryNamespace `bson:"registries" json:"registries"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` LogFile string `bson:"log_file" json:"log_file"` Image string `bson:"image,omitempty" json:"image,omitempty"` IsRestart bool `bson:"is_restart" json:"is_restart"` }
JenkinsBuild ...
func (*JenkinsBuild) SetIntegration ¶
func (j *JenkinsBuild) SetIntegration(jenkinsIntegration *JenkinsIntegration)
SetIntegration ...
func (*JenkinsBuild) SetJenkinsBuildArgs ¶
func (j *JenkinsBuild) SetJenkinsBuildArgs(jenkinsBuildArgs *JenkinsBuildArgs)
SetIntegration ...
func (*JenkinsBuild) ToSubTask ¶
func (j *JenkinsBuild) ToSubTask() (map[string]interface{}, error)
type JenkinsBuildArgs ¶
type JenkinsBuildArgs struct { JobName string `bson:"job_name" json:"job_name"` JenkinsBuildParams []*JenkinsBuildParam `bson:"jenkins_build_param" json:"jenkins_build_params"` }
type JenkinsBuildConfig ¶
type JenkinsBuildConfig struct {
JenkinsBuildImage string
}
type JenkinsBuildParam ¶
type JenkinsBuildParam struct { Name string `json:"name"` Value interface{} `json:"value"` }
type JenkinsIntegration ¶
type Jira ¶
type Jira struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` Builds []*Repository `bson:"builds,omitempty" json:"builds,omitempty"` // TODO: (min) move JiraIssue back to this file Issues []*JiraIssue `bson:"issues,omitempty" json:"issues,omitempty"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` }
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"` }
type JobCtx ¶
type JobCtx struct { EnableProxy bool `bson:"enable_proxy" json:"enable_proxy"` Proxy *Proxy `bson:"proxy" json:"proxy"` CleanWorkspace bool `bson:"clean_workspace" json:"clean_workspace"` // BuildJobCtx Builds []*Repository `bson:"builds" json:"builds"` BuildSteps []*BuildStep `bson:"build_steps,omitempty" json:"build_steps"` SSHs []*SSH `bson:"sshs,omitempty" json:"sshs"` // Envs stores user defined env key val for build // TODO: 之后可以不用keystore, 将用户敏感信息保存在此字段 EnvVars []*KeyVal `bson:"envs,omitempty" json:"envs"` UploadPkg bool `bson:"upload_pkg" json:"upload_pkg"` PackageFile string `bson:"package_file,omitempty" json:"package_file,omitempty"` Image string `bson:"image,omitempty" json:"image,omitempty"` // TestJobCtx TestThreshold int `bson:"test_threshold" json:"test_threshold"` TestResultPath string `bson:"test_result_path,omitempty" json:"test_result_path,omitempty"` TestReportPath string `bson:"test_report_path,omitempty" json:"test_report_path,omitempty"` TestJobName string `bson:"test_job_name,omitempty" json:"test_job_name,omitempty"` // DockerBuildCtx DockerBuildCtx *DockerBuildCtx `bson:"docker_build_ctx,omitempty" json:"docker_build_ctx,omitempty"` FileArchiveCtx *FileArchiveCtx `bson:"file_archive_ctx,omitempty" json:"file_archive_ctx,omitempty"` // TestType TestType string `bson:"test_type" json:"test_type"` // Caches Caches []string `bson:"caches" json:"caches"` // buildV3 ArtifactPath string `bson:"artifact_path,omitempty" json:"artifact_path,omitempty"` ArtifactPaths []string `bson:"artifact_paths,omitempty" json:"artifact_paths,omitempty"` IsHasArtifact bool `bson:"is_has_artifact" json:"is_has_artifact"` // ClassicBuild used by qbox build ClassicBuild bool `bson:"classic_build" json:"classic_build"` PostScripts string `bson:"post_scripts,omitempty" json:"post_scripts"` PMDeployScripts string `bson:"pm_deploy_scripts,omitempty" json:"pm_deploy_scripts"` }
type JobCtxBuilder ¶
type K8SCluster ¶ added in v1.8.0
type K8SCluster struct { ID string `json:"id,omitempty" bson:"_id,omitempty"` Name string `json:"name" bson:"name"` AdvancedConfig *AdvancedConfig `json:"advanced_config,omitempty" bson:"advanced_config,omitempty"` }
type NodeSelectorRequirement ¶ added in v1.8.0
type NodeSelectorRequirement struct { Key string `json:"key"` Value []string `json:"value"` Operator corev1.NodeSelectorOperator `json:"operator"` }
type PipelineCtx ¶
type PrivateKey ¶ added in v1.2.0
type PrivateKey struct {
Name string `json:"name"`
}
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"` Configs []*ServiceConfig `bson:"configs,omitempty" json:"configs,omitempty"` Render *RenderInfo `bson:"render,omitempty" json:"render,omitempty"` // 记录每个服务render信息 便于更新单个服务 EnvConfigs []*EnvConfig `bson:"-" json:"env_configs,omitempty"` }
type Proxy ¶
type Proxy struct { //ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` // http或socks5 暂时只支持http代理 Type string `bson:"type" json:"type"` Address string `bson:"address" json:"address"` Port int `bson:"port" json:"port"` NeedPassword bool `bson:"need_password" json:"need_password"` Username string `bson:"username" json:"username"` Password string `bson:"password" json:"password"` // 代理用途,app表示应用代理,repo表示代码库代理。保留字段,暂时默认设置为default,以后可能用到。 Usage string `bson:"usage" json:"usage"` EnableRepoProxy bool `bson:"enable_repo_proxy" json:"enable_repo_proxy"` EnableApplicationProxy bool `bson:"enable_application_proxy" json:"enable_application_proxy"` CreateTime int64 `bson:"create_time" json:"create_time"` UpdateTime int64 `bson:"update_time" json:"update_time"` UpdateBy string `bson:"update_by" json:"update_by"` }
func (*Proxy) GetProxyURL ¶
type ProxyConfig ¶
type RegistryConfig ¶
type RegistryNamespace ¶
type RegistryNamespace struct { ID string `bson:"_id,omitempty" json:"id,omitempty"` RegAddr string `bson:"reg_addr" json:"reg_addr"` RegType string `bson:"reg_type" json:"reg_type"` RegProvider string `bson:"reg_provider" json:"reg_provider"` IsDefault bool `bson:"is_default" json:"is_default"` Namespace string `bson:"namespace" json:"namespace"` AccessKey string `bson:"access_key" json:"access_key"` SecretKey string `bson:"secret_key" json:"secret_key"` Region string `bson:"region,omitempty" json:"region,omitempty"` UpdateTime int64 `bson:"update_time" json:"update_time"` UpdateBy string `bson:"update_by" json:"update_by"` }
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/packager-plugin:v0.1.0 PackagerImage string }
type ReleaseImage ¶
type ReleaseImage struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` ImageTest string `bson:"image_test" json:"image_test"` ImageRelease string `bson:"image_release" json:"image_release"` ImageRepo string `bson:"image_repo" json:"image_repo"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` LogFile string `bson:"log_file" json:"log_file"` // destinations to distribute images Releases []RepoImage `bson:"releases" json:"releases"` }
ReleaseImage 线上镜像分发任务
func (*ReleaseImage) SetImage ¶
func (ri *ReleaseImage) SetImage(image string)
func (*ReleaseImage) ToSubTask ¶
func (ri *ReleaseImage) ToSubTask() (map[string]interface{}, error)
type ReleaseImageItem ¶
type RenderInfo ¶
type RepoCoverage ¶
type RepoStaticCheck ¶
type Repository ¶
type Repository struct { // Source is github, gitlab Source string `bson:"source,omitempty" json:"source,omitempty"` RepoOwner string `bson:"repo_owner" json:"repo_owner"` RepoName string `bson:"repo_name" json:"repo_name"` RemoteName string `bson:"remote_name,omitempty" json:"remote_name,omitempty"` 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"` CheckoutPath string `bson:"checkout_path,omitempty" json:"checkout_path,omitempty"` SubModules bool `bson:"submodules,omitempty" json:"submodules,omitempty"` // UseDefault defines if the repo can be configured in start pipeline task page UseDefault bool `bson:"use_default,omitempty" json:"use_default,omitempty"` // IsPrimary used to generated image and package name, each build has one primary repo IsPrimary bool `bson:"is_primary" json:"is_primary"` CodehostID int `bson:"codehost_id" json:"codehost_id"` // add OauthToken string `bson:"oauth_token" json:"oauth_token"` Address string `bson:"address" json:"address"` AuthorName string `bson:"author_name,omitempty" json:"author_name,omitempty"` CheckoutRef string `bson:"checkout_ref,omitempty" json:"checkout_ref,omitempty"` Username string `bson:"username,omitempty" json:"username,omitempty"` Password string `bson:"password,omitempty" json:"password,omitempty"` ProjectUUID string `bson:"project_uuid,omitempty" json:"project_uuid,omitempty"` RepoUUID string `bson:"repo_uuid,omitempty" json:"repo_uuid,omitempty"` RepoID string `bson:"repo_id,omitempty" json:"repo_id,omitempty"` }
type Security ¶
type Security struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` ImageName string `bson:"image_name" json:"image_name"` ImageID string `bson:"image_id" json:"image_id"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` LogFile string `bson:"log_file" json:"log_file"` Summary map[string]int `bson:"summary" json:"summary"` }
func (*Security) SetImageName ¶
type ServiceConfig ¶
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 Stage ¶
type Stage struct { // 注意: 同一个stage暂时不能运行不同类型的Task TaskType config.TaskType `bson:"type" json:"type"` Status config.Status `bson:"status" json:"status"` RunParallel bool `bson:"run_parallel" json:"run_parallel"` Desc string `bson:"desc,omitempty" json:"desc,omitempty"` SubTasks map[string]map[string]interface{} `bson:"sub_tasks" json:"sub_tasks"` AfterAll bool `json:"after_all" bson:"after_all"` }
type StaticCheckStatus ¶
type StaticCheckStatus struct { StepStatus Repos []RepoStaticCheck `bson:"repos" json:"repos"` }
type StepStatus ¶
type TargetArgs ¶
type TargetArgs struct { Name string `bson:"name" json:"name"` ServiceName string `bson:"service_name" json:"service_name"` ServiceType string `bson:"service_type,omitempty" json:"service_type,omitempty"` Build *BuildArgs `bson:"build" json:"build"` Version string `bson:"version" json:"version"` Deploy []DeployEnv `bson:"deloy" json:"deploy"` Image string `bson:"image" json:"image"` BinFile string `bson:"bin_file" json:"bin_file"` Envs []*KeyVal `bson:"envs" json:"envs"` HasBuild bool `bson:"has_build" json:"has_build"` JenkinsBuildArgs *JenkinsBuildArgs `bson:"jenkins_build_args" json:"jenkins_build_args"` }
type Task ¶
type Task 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"` Namespace string `bson:"namespace,omitempty" json:"namespace,omitempty"` Type config.PipelineType `bson:"type" json:"type"` Status config.Status `bson:"status" json:"status,omitempty"` Description string `bson:"description,omitempty" json:"description,omitempty"` TaskCreator string `bson:"task_creator" json:"task_creator,omitempty"` TaskRevoker string `bson:"task_revoker,omitempty" json:"task_revoker,omitempty"` CreateTime int64 `bson:"create_time" json:"create_time,omitempty"` StartTime int64 `bson:"start_time" json:"start_time,omitempty"` EndTime int64 `bson:"end_time" json:"end_time,omitempty"` SubTasks []map[string]interface{} `bson:"sub_tasks" json:"sub_tasks"` Stages []*Stage `bson:"stages" json:"stages"` ReqID string `bson:"req_id,omitempty" json:"req_id,omitempty"` AgentHost string `bson:"agent_host,omitempty" json:"agent_host,omitempty"` DockerHost string `bson:"-" json:"docker_host,omitempty"` TeamID int `bson:"team_id,omitempty" json:"team_id,omitempty"` TeamName string `bson:"team,omitempty" json:"team,omitempty"` IsDeleted bool `bson:"is_deleted" json:"is_deleted"` IsArchived bool `bson:"is_archived" json:"is_archived"` AgentID string `bson:"agent_id" json:"agent_id"` // 是否允许同时运行多次 MultiRun bool `bson:"multi_run" json:"multi_run"` // target 服务名称, k8s为容器名称, 物理机为服务名 Target string `bson:"target,omitempty" json:"target"` // 使用预定义编译管理模块中的内容生成SubTasks, // 查询条件为 服务模板名称: ServiceTmpl, 版本: BuildModuleVer // 如果为空,则使用pipeline自定义SubTasks BuildModuleVer string `bson:"build_module_ver,omitempty" json:"build_module_ver"` ServiceName string `bson:"service_name,omitempty" json:"service_name,omitempty"` // TaskArgs 单服务工作流任务参数 TaskArgs *TaskArgs `bson:"task_args,omitempty" json:"task_args,omitempty"` // WorkflowArgs 多服务工作流任务参数 WorkflowArgs *WorkflowTaskArgs `bson:"workflow_args" json:"workflow_args,omitempty"` // TestArgs 测试任务参数 TestArgs *TestTaskArgs `bson:"test_args,omitempty" json:"test_args,omitempty"` // ServiceTaskArgs 脚本部署工作流任务参数 ServiceTaskArgs *ServiceTaskArgs `bson:"service_args,omitempty" json:"service_args,omitempty"` // ArtifactPackageTaskArgs arguments for artifact-package type tasks ArtifactPackageTaskArgs *ArtifactPackageTaskArgs `bson:"artifact_package_args,omitempty" json:"artifact_package_args,omitempty"` // ConfigPayload 系统配置信息 ConfigPayload *ConfigPayload `json:"config_payload,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` Services [][]*ProductService `bson:"services" json:"services"` Render *RenderInfo `bson:"render" json:"render"` StorageURI string `bson:"storage_uri,omitempty" json:"storage_uri,omitempty"` // interface{} 为types.TestReport TestReports map[string]interface{} `bson:"test_reports,omitempty" json:"test_reports,omitempty"` RwLock sync.Mutex `bson:"-" json:"-"` ResetImage bool `json:"resetImage" bson:"resetImage"` TriggerBy *TriggerBy `json:"trigger_by,omitempty" bson:"trigger_by,omitempty"` Features []string `bson:"features" json:"features"` IsRestart bool `bson:"is_restart" json:"is_restart"` StorageEndpoint string `bson:"storage_endpoint" json:"storage_endpoint"` ArtifactInfo *ArtifactInfo `bson:"artifact_info" json:"artifact_info"` }
type TaskArgs ¶
type TaskArgs struct { ProductName string `bson:"product_name" json:"product_name"` PipelineName string `bson:"pipeline_name" json:"pipeline_name"` Builds []*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"` }
type TaskOutput ¶ added in v1.8.0
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 []*Repository `bson:"builds" json:"builds"` }
type TestConfig ¶
type TestConfig struct {
KubeNamespace string
}
type TestTaskArgs ¶
type TestTaskArgs struct { ProductName string `bson:"product_name" json:"product_name"` TestName string `bson:"test_name" json:"test_name"` TestTaskCreator string `bson:"test_task_creator" json:"test_task_creator"` NotificationID string `bson:"notification_id" json:"notification_id"` ReqID string `bson:"req_id" json:"req_id"` // webhook触发测试任务时,触发任务的repo、prID和commitID MergeRequestID string `bson:"merge_request_id" json:"merge_request_id"` CommitID string `bson:"commit_id" json:"commit_id"` Source string `bson:"source" json:"source"` CodehostID int `bson:"codehost_id" json:"codehost_id"` RepoOwner string `bson:"repo_owner" json:"repo_owner"` RepoName string `bson:"repo_name" json:"repo_name"` }
type Testing ¶
type Testing struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` TestName string `bson:"test_name" json:"test_name"` Timeout int `bson:"timeout,omitempty" json:"timeout,omitempty"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time,omitempty" json:"start_time,omitempty"` EndTime int64 `bson:"end_time,omitempty" json:"end_time,omitempty"` JobCtx JobCtx `bson:"job_ctx" json:"job_ctx"` InstallItems []*Item `bson:"install_items" json:"install_items"` InstallCtx []*Install `bson:"-" json:"install_ctx"` BuildOS string `bson:"build_os" json:"build_os,omitempty"` ImageFrom string `bson:"image_from" json:"image_from,omitempty"` ImageID string `bson:"image_id" json:"image_id"` // ResReq defines job requested resources ResReq setting.Request `bson:"res_req" json:"res_req"` ResReqSpec setting.RequestSpec `bson:"res_req_spec" json:"res_req_spec"` LogFile string `bson:"log_file" json:"log_file"` TestModuleName string `bson:"test_module_name" json:"test_module_name"` ReportReady bool `bson:"report_ready" json:"report_ready"` IsRestart bool `bson:"is_restart" json:"is_restart"` Registries []*RegistryNamespace `bson:"-" json:"registries"` ClusterID string `bson:"cluster_id" json:"cluster_id"` Namespace string `bson:"namespace" json:"namespace"` }
type Trigger ¶ added in v1.8.0
type Trigger struct { TaskType config.TaskType `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` TaskStatus config.Status `bson:"status" json:"status"` URL string `bson:"url,omitempty" json:"url,omitempty"` Path string `bson:"path,omitempty" json:"path,omitempty"` IsCallback bool `bson:"is_callback,omitempty" json:"is_callback,omitempty"` CallbackType string `bson:"callback_type,omitempty" json:"callback_type,omitempty"` CallbackPayload *CallbackPayload `bson:"callback_payload,omitempty" json:"callback_payload,omitempty"` Headers []*models.KeyVal `bson:"headers,omitempty" json:"headers,omitempty"` Timeout int `bson:"timeout" json:"timeout,omitempty"` IsRestart bool `bson:"is_restart" json:"is_restart"` Error string `bson:"error,omitempty" json:"error,omitempty"` StartTime int64 `bson:"start_time" json:"start_time,omitempty"` EndTime int64 `bson:"end_time" json:"end_time,omitempty"` }
type TriggerBy ¶
type TriggerBy struct { // 触发此次任务的代码库信息 CodehostID int `bson:"codehost_id,omitempty" json:"codehost_id,omitempty"` RepoOwner string `bson:"repo_owner,omitempty" json:"repo_owner,omitempty"` RepoName string `bson:"repo_name,omitempty" json:"repo_name,omitempty"` Source string `json:"source,omitempty" bson:"source,omitempty"` // 触发此次任务的merge request id,用于判断多个任务对应的commit是否属于同一个merge request MergeRequestID string `json:"merge_request_id,omitempty" bson:"merge_request_id,omitempty"` // 触发此次任务的commit id CommitID string `json:"commit_id,omitempty" bson:"commit_id,omitempty"` }
type UTStatus ¶
type UTStatus struct { StepStatus Repos []RepoCoverage `bson:"repos" json:"repos"` }
type VersionArgs ¶
type WebhookPayload ¶ added in v1.8.0
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"` WorklowTaskCreator string `bson:"workflow_task_creator" json:"workflow_task_creator"` // Ignore docker build cache IgnoreCache bool `json:"ignore_cache" bson:"ignore_cache"` // Ignore workspace cache and reset volume ResetCache bool `json:"reset_cache" bson:"reset_cache"` // NotificationId is the id of scmnotify.Notification NotificationID string `bson:"notification_id" json:"notification_id"` // webhook触发工作流任务时,触发任务的repo信息、prID和commitID MergeRequestID string `bson:"merge_request_id" json:"merge_request_id"` CommitID string `bson:"commit_id" json:"commit_id"` Source string `bson:"source" json:"source"` CodehostID int `bson:"codehost_id" json:"codehost_id"` RepoOwner string `bson:"repo_owner" json:"repo_owner"` RepoName string `bson:"repo_name" json:"repo_name"` //github check run HookPayload *HookPayload `bson:"hook_payload" json:"hook_payload,omitempty"` // 请求模式,openAPI表示外部客户调用 RequestMode string `json:"request_mode,omitempty"` IsParallel bool `json:"is_parallel" bson:"is_parallel"` Callback *CallbackArgs `bson:"callback" json:"callback"` }
Click to show internal directories.
Click to hide internal directories.