Documentation ¶
Index ¶
- Constants
- func RegisterExecutor(executor string, provider ExecutorProvider)
- type AtomInfo
- type AtomRequest
- type AtomResponse
- type Atoms
- type BuildError
- type Docker
- type DockerVolume
- type Execution
- type Executor
- type ExecutorProvider
- type GitConfig
- type Image
- type Job
- type JobInfo
- type JobRequest
- type JobResponse
- type JobVariable
- type JobVariables
- type KafkaConfig
- type Kubernetes
- type MinioConfig
- type Read
- type RunnerConfig
- type RunnerCredentials
- type Services
- type VersionInfo
- type Volume
- type Writer
Constants ¶
View Source
const BashDetectShell = `` /* 401-byte string literal not displayed */
View Source
const DefaultDockerWorkspace = "/workspace" // docker executor worspace dir
View Source
const DefaultLivessTimeout = 1800 // pod 生产时间
View Source
const DefaultMetricsServerPort = 9252 //prometheus metrics 端口
View Source
const DefaultNetworkClientTimeout = 60 * time.Minute // http 底层 timeout 超时时间
View Source
const KubernetesPollAttempts = 100 // 尝试获得 Pod 详情次数
View Source
const KubernetesPollInterval = 10 * time.Second // 每次查询 pod 详情 间隔时间
View Source
const NAME = "super-runner"
View Source
const SshConnectRetries = 3 // ssh 重试次数
View Source
const SshRetryInterval = 3 //ssh 间隔时间
View Source
const VERSION = "2020-12-08"
Variables ¶
This section is empty.
Functions ¶
func RegisterExecutor ¶
func RegisterExecutor(executor string, provider ExecutorProvider)
Types ¶
type AtomInfo ¶
type AtomInfo struct { AtomName string `json:"atom_name"` Execution Execution `json:"execution"` Variables JobVariables `json:"variables,omitempty"` }
type AtomRequest ¶
type AtomResponse ¶
type BuildError ¶
type BuildError struct {
Inner error
}
func (*BuildError) Error ¶
func (b *BuildError) Error() string
type Docker ¶
type Docker struct { DNS []string `toml:"dns,omitempty" json:"dns" long:"dns" env:"DOCKER_DNS" description:"A list of DNS servers for the container to use"` DockerWorkspace string `toml:"workspace"` Privileged bool `` /* 138-byte string literal not displayed */ Volumes []DockerVolume `` /* 284-byte string literal not displayed */ }
type DockerVolume ¶
type ExecutorProvider ¶
func GetExecutor ¶
func GetExecutor(executorStr string) ExecutorProvider
type Job ¶
type Job struct { Runner RunnerConfig JobResponse }
type JobInfo ¶
type JobInfo struct { Pipeline string `json:"pipeline"` Stage string `json:"stage"` StageIndex int `json:"stage_index"` JobName string `json:"job_name"` JobIndex int `json:"job_index"` Timestamp int64 `json:"timestamp"` Image Image `json:"image"` Services Services `json:"services,omitempty"` Volumes []Volume `json:"volumes,omitempty"` Variables JobVariables `json:"variables,omitempty"` Atoms Atoms `json:"atoms"` Timeout int32 `json:"timeout,omitempty"` }
type JobRequest ¶
type JobRequest struct { Info VersionInfo `json:"info,omitempty"` Token string `json:"token,omitempty"` }
type JobResponse ¶
type JobResponse struct { ID int `json:"id"` Token string `json:"token"` JobInfo JobInfo `json:"job_info"` }
JobResponse 为解析 json 的结构体
type JobVariable ¶
func ParseVariable ¶
func ParseVariable(text string) (variable JobVariable, err error)
func (JobVariable) String ¶
func (b JobVariable) String() string
type JobVariables ¶
type JobVariables []JobVariable
func (JobVariables) Expand ¶
func (b JobVariables) Expand() (variables JobVariables)
func (JobVariables) ExpandValue ¶
func (b JobVariables) ExpandValue(value string) string
func (JobVariables) Get ¶
func (b JobVariables) Get(key string) string
func (JobVariables) StringList ¶
func (b JobVariables) StringList() (variables []string)
type KafkaConfig ¶
type Kubernetes ¶
type MinioConfig ¶
type RunnerConfig ¶
type RunnerConfig struct { Name string `toml:"name"` Executor string `toml:"executor"` Concurrent int `toml:"concurrent"` Log_level string `toml:"log_level"` ListenAddress string `toml:"listen_address,omitempty" json:"listen_address"` KafkaConfig KafkaConfig `toml:"kafka"` Kubernetes Kubernetes `toml:"kubernetes"` MinioConfig MinioConfig `toml:"minio"` Docker Docker `toml:"docker"` GitConfig GitConfig `toml:"git"` RunnerCredentials }
func (*RunnerConfig) GetListenAddress ¶
func (config *RunnerConfig) GetListenAddress() (string, error)
获取 ListenAddress 配置地址
func (*RunnerConfig) LoadConfig ¶
func (config *RunnerConfig) LoadConfig(config_file string) error
解析配置文件
type RunnerCredentials ¶
type RunnerCredentials struct { URL string `toml:"url" json:"url" short:"u" long:"url" env:"CI_SERVER_URL" required:"true" description:"Runner URL"` Token string `toml:"token" json:"token" short:"t" long:"token" env:"CI_SERVER_TOKEN" required:"true" description:"Runner token"` }
func (*RunnerCredentials) GetToken ¶
func (c *RunnerCredentials) GetToken() string
func (*RunnerCredentials) GetURL ¶
func (c *RunnerCredentials) GetURL() string
type VersionInfo ¶
Click to show internal directories.
Click to hide internal directories.