Documentation ¶
Index ¶
- Constants
- type Archive
- type ArtifactInfo
- type Context
- type DockerBuildCtx
- type DockerRegistry
- type EnvVar
- type Error
- type Failure
- type FileArchiveCtx
- type GinkgoTest
- type Git
- func (g *Git) GetEmail() string
- func (g *Git) GetGithubHost() string
- func (g *Git) GetGitlabHost() string
- func (g *Git) GetUserName() string
- func (g *Git) HTTPSCloneURL(source, token, owner, name string) string
- func (g *Git) OAuthCloneURL(source, token, address, owner, name, scheme string) string
- func (g *Git) SSHCloneURL(source, owner, name string) string
- func (g *Git) WriteGithubSSHFile() error
- func (g *Git) WriteGitlabSSHFile() error
- func (g *Git) WriteKnownHostFile() error
- func (g *Git) WriteSSHConfigFile(proxy *Proxy) error
- type Install
- type Proxy
- type Repo
- type SSH
- type Skipped
- type TestCase
- type TestSuite
- type TestSuites
Constants ¶
const ( // ProviderGithub ... ProviderGithub = "github" // ProviderGitlab ... ProviderGitlab = "gitlab" // ProviderGerrit ProviderGerrit = "gerrit" // ProviderCodehub ProviderCodehub = "codehub" // ProviderGitee ProviderGitee = "gitee" // Oauth prefix OauthTokenPrefix = "oauth2" FileName = "reaper.tar.gz" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct { Dir string `yaml:"dir"` File string `yaml:"file"` TestReportFile string `yaml:"test_report_file"` }
Archive ...
type ArtifactInfo ¶ added in v1.6.0
type Context ¶
type Context struct { // API token 服务访问使用的api token APIToken string `yaml:"api_token"` // Workspace 容器工作目录 [必填] Workspace string `yaml:"workspace"` // TODO: Deprecated. // CleanWorkspace 是否清理工作目录 [选填, 默认为 false] CleanWorkspace bool `yaml:"clean_workspace"` // Paths 执行脚本Path Paths string `yaml:"-"` // Proxy 翻墙配置信息 Proxy *Proxy `yaml:"proxy"` // Envs 用户注入环境变量, 包括安装脚本环境变量 [optional] Envs EnvVar `yaml:"envs"` // SecretEnvs 用户注入敏感信息环境变量, value不能在stdout stderr中输出 [optional] SecretEnvs EnvVar `yaml:"secret_envs"` // Installs 安装程序脚本 [optional] Installs []*Install `yaml:"installs"` // Repos 用户需要下载的repos Repos []*Repo `yaml:"repos"` // Scripts 执行主要编译脚本 Scripts []string `yaml:"scripts"` // PostScripts 后置编译脚本 PostScripts []string `yaml:"post_scripts"` // PMDeployScripts 物理机部署脚本 PMDeployScripts []string `yaml:"pm_deploy_scripts"` // SSH ssh连接参数 SSHs []*SSH `yaml:"sshs"` // GinkgoTest 执行 ginkgo test 配置 GinkgoTest *GinkgoTest `yaml:"ginkgo_test"` // Archive: 归档配置 [optional] Archive *Archive `yaml:"archive"` // DockerRegistry: 镜像仓库配置 [optional] DockerRegistry *DockerRegistry `yaml:"docker_registry"` // DockerBuildContext image 构建context DockerBuildCtx *DockerBuildCtx `yaml:"docker_build_ctx"` // FileArchiveCtx 二进制包构建 FileArchiveCtx *FileArchiveCtx `yaml:"file_archive_ctx"` // Git Github/Gitlab 配置 Git *Git `yaml:"git"` // TODO: Deprecated. // Caches Caches配置 Caches []string `yaml:"caches"` // testType TestType string `yaml:"test_type"` // Classic build ClassicBuild bool `yaml:"classic_build"` // StorageURI StorageURI string `yaml:"storage_uri"` // PipelineName PipelineName string `yaml:"pipeline_name"` // TaskID TaskID int64 `yaml:"task_id"` // ServiceName ServiceName string `yaml:"service_name"` // ResetCache ignore workspace cache [runtime] ResetCache bool `yaml:"reset_cache"` // IgnoreCache ignore docker build cache [runtime] IgnoreCache bool `yaml:"ignore_cache"` StorageEndpoint string `yaml:"storage_endpoint"` StorageAK string `yaml:"storage_ak"` StorageSK string `yaml:"storage_sk"` StorageBucket string `yaml:"storage_bucket"` StorageProvider int `yaml:"storage_provider"` ArtifactInfo *ArtifactInfo `yaml:"artifact_info"` ArtifactPath string `yaml:"artifact_path"` AesKey string `yaml:"aes_key"` // New since V1.10.0. CacheEnable bool `yaml:"cache_enable"` Cache types.Cache `yaml:"cache"` CacheDirType types.CacheDirType `yaml:"cache_dir_type"` CacheUserDir string `yaml:"cache_user_dir"` // Upload To S3 related context UploadEnabled bool `yaml:"upload_enabled"` UploadStorageInfo *types.ObjectStorageInfo `yaml:"upload_storage_info"` UploadInfo []*types.ObjectStoragePathDetail `yaml:"upload_info"` }
type DockerBuildCtx ¶
type DockerBuildCtx struct { Source string `yaml:"source" bson:"source" json:"source"` 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"` 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/spock-release-candidates/image:tag
func (*DockerBuildCtx) GetDockerFile ¶
func (c *DockerBuildCtx) GetDockerFile() string
type DockerRegistry ¶
type DockerRegistry struct { Host string `yaml:"host"` Namespace string `yaml:"namespace"` UserName string `yaml:"username"` Password string `yaml:"password"` }
DockerRegistry 推送镜像到 docker registry 配置
type FileArchiveCtx ¶
type GinkgoTest ¶
type GinkgoTest struct { ResultPath string `yaml:"result_path"` TestReportPath string `yaml:"test_report_path"` ArtifactPaths []string `yaml:"artifact_paths"` }
GinkgoTest ...
type Git ¶
type Git struct { UserName string `yaml:"username"` Email string `yaml:"email"` GithubHost string `yaml:"github_host"` GithubSSHKey string `yaml:"github_ssh_key"` GitlabHost string `yaml:"gitlab_host"` // encoded in base64 GitlabSSHKey string `yaml:"gitlab_ssh_key"` GitKnownHost string `yaml:"git_known_host"` }
Git ...
func (*Git) GetGithubHost ¶
GetGithubHost returns github host By default it returns github.com
func (*Git) GetGitlabHost ¶
GetGitlabHost returns gitlab host By default it returns gitlab.koderover.io
func (*Git) HTTPSCloneURL ¶
HTTPSCloneURL returns HTTPS clone url
func (*Git) OAuthCloneURL ¶
SSHCloneURL returns Oauth clone url e.g. https://oauth2:ACCESS_TOKEN@somegitlab.com/owner/name.git
func (*Git) SSHCloneURL ¶
SSHCloneURL returns SSH clone url
func (*Git) WriteSSHConfigFile ¶
WriteSSHConfigFile ...
type Install ¶
type Install struct { // 安装名称 Name string `yaml:"name"` // 安装版本 Version string `yaml:"version"` // 安装脚本 Scripts []string `yaml:"scripts"` // 可执行文件目录 BinPath string `yaml:"bin_path"` // Optional: 安装脚本环境变量 Envs EnvVar `yaml:"envs"` // 安装包位置 Download string `yaml:"download"` }
Install ...
type Proxy ¶
type Proxy struct { Type string `yaml:"type"` Address string `yaml:"address"` Port int `yaml:"port"` NeedPassword bool `yaml:"need_password"` Username string `yaml:"username"` Password string `yaml:"password"` EnableRepoProxy bool `yaml:"enable_repo_proxy"` EnableApplicationProxy bool `yaml:"enable_application_proxy"` }
Proxy 翻墙配置信息
func (*Proxy) GetProxyURL ¶
type Repo ¶
type Repo struct { Source string `yaml:"source"` Address string `yaml:"address"` Owner string `yaml:"owner"` Name string `yaml:"name"` RemoteName string `yaml:"remote_name"` Branch string `yaml:"branch"` PR int `yaml:"pr"` Tag string `yaml:"tag"` CheckoutPath string `yaml:"checkout_path"` SubModules bool `yaml:"submodules"` OauthToken string `yaml:"oauthToken"` User string `yaml:"username"` Password string `yaml:"password"` CheckoutRef string `yaml:"checkout_ref"` EnableProxy bool `yaml:"enable_proxy"` }
Repo ...
func (*Repo) PRRef ¶
PRRef returns refs format It will check repo provider type, by default returns github refs format.
e.g. github returns refs/pull/1/head e.g. gitlab returns merge-requests/1/head
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 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 TestSuites ¶
type TestSuites struct { Tests int `bson:"tests" json:"tests" xml:"tests,attr"` Skips int `bson:"skips" json:"skips" xml:"skips,attr"` Failures int `bson:"failures" json:"failures" xml:"failures,attr"` Errors int `bson:"errors,omitempty" json:"errors" xml:"errors,attr,omitempty"` Time float64 `bson:"time" json:"time" xml:"time,attr"` TestSuites []*TestSuite `bson:"testsuite" json:"testsuite" xml:"testsuite"` }