Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateShellScript(buildStage BuildStage, info ShellScriptInfo) (string, error)
- func GetCommands() []cli.Command
- func GetDefaultShell() string
- func GetExecutors() []string
- func GetShells() []string
- func RegisterCommand(command cli.Command)
- func RegisterCommand2(name, usage string, data Commander, flags ...cli.Flag)
- func RegisterExecutor(executor string, provider ExecutorProvider)
- func RegisterShell(shell Shell)
- type AppVersionInfo
- func (v *AppVersionInfo) Extended() string
- func (v *AppVersionInfo) Line() string
- func (v *AppVersionInfo) NewMetricsCollector() *prometheus.GaugeVec
- func (v *AppVersionInfo) Printer(c *cli.Context)
- func (v *AppVersionInfo) ShortLine() string
- func (v *AppVersionInfo) UserAgent() string
- func (v *AppVersionInfo) Variables() JobVariables
- type Artifact
- type ArtifactFormat
- type ArtifactPaths
- type ArtifactWhen
- type Artifacts
- type ArtifactsOptions
- type Build
- func (b *Build) CurrentExecutorStage() ExecutorStage
- func (b *Build) Duration() time.Duration
- func (b *Build) FullProjectDir() string
- func (b *Build) GetAllVariables() JobVariables
- func (b *Build) GetBuildTimeout() time.Duration
- func (b *Build) GetCITLSVariables() JobVariables
- func (b *Build) GetCacheRequestTimeout() int
- func (b *Build) GetDefaultFeatureFlagsVariables() JobVariables
- func (b *Build) GetDefaultVariables() JobVariables
- func (b *Build) GetDockerAuthConfig() string
- func (b *Build) GetDownloadArtifactsAttempts() int
- func (b *Build) GetGetSourcesAttempts() int
- func (b *Build) GetGitCheckout() bool
- func (b *Build) GetGitDepth() string
- func (b *Build) GetGitStrategy() GitStrategy
- func (b *Build) GetGitTLSVariables() JobVariables
- func (b *Build) GetRemoteURL() string
- func (b *Build) GetRestoreCacheAttempts() int
- func (b *Build) GetSharedEnvVariable() JobVariable
- func (b *Build) GetSubmoduleStrategy() SubmoduleStrategy
- func (b *Build) GetTLSVariables(caFile, certFile, keyFile string) JobVariables
- func (b *Build) IsDebugTraceEnabled() bool
- func (b *Build) IsFeatureFlagOn(name string) bool
- func (b *Build) IsLFSSmudgeDisabled() bool
- func (b *Build) IsSharedEnv() bool
- func (b *Build) Log() *logrus.Entry
- func (b *Build) ProjectSlug() (string, error)
- func (b *Build) ProjectUniqueDir(sharedDir bool) string
- func (b *Build) ProjectUniqueName() string
- func (b *Build) RefspecsAvailable() bool
- func (b *Build) Run(globalConfig *Config, trace JobTrace) (err error)
- func (b *Build) StartBuild(rootDir, cacheDir string, sharedDir bool)
- func (b *Build) String() string
- type BuildError
- type BuildLogger
- func (e *BuildLogger) Debugln(args ...interface{})
- func (e *BuildLogger) Errorln(args ...interface{})
- func (e *BuildLogger) Infoln(args ...interface{})
- func (e *BuildLogger) Println(args ...interface{})
- func (e *BuildLogger) SendRawLog(args ...interface{})
- func (e *BuildLogger) SoftErrorln(args ...interface{})
- func (e *BuildLogger) Warningln(args ...interface{})
- func (e *BuildLogger) WithFields(fields logrus.Fields) BuildLogger
- type BuildRuntimeState
- type BuildStage
- type Cache
- type CacheConfig
- func (c *CacheConfig) GetAccessKey() string
- func (c *CacheConfig) GetBucketLocation() string
- func (c *CacheConfig) GetBucketName() string
- func (c *CacheConfig) GetInsecure() bool
- func (c *CacheConfig) GetPath() string
- func (c *CacheConfig) GetSecretKey() string
- func (c *CacheConfig) GetServerAddress() string
- func (c *CacheConfig) GetShared() bool
- type CacheGCSConfig
- type CacheGCSCredentials
- type CachePolicy
- type CacheS3Config
- type Caches
- type Commander
- type Config
- type ContainerCommand
- type Credentials
- type Dependencies
- type Dependency
- type DependencyArtifactsFile
- type DockerConfig
- type DockerMachine
- type DockerPullPolicy
- type DockerSysCtls
- type DownloadState
- type Executor
- type ExecutorCommand
- type ExecutorData
- type ExecutorPrepareOptions
- type ExecutorProvider
- type ExecutorStage
- type FailuresCollector
- type FeaturesInfo
- type GitInfo
- type GitInfoRefType
- type GitStrategy
- type GitlabFeatures
- type Image
- type JobCredentials
- type JobFailureReason
- type JobInfo
- type JobRequest
- type JobResponse
- func GetFailedBuild() (JobResponse, error)
- func GetLocalBuildResponse(commands ...string) (JobResponse, error)
- func GetLongRunningBuild() (JobResponse, error)
- func GetMultilineBashBuild() (JobResponse, error)
- func GetRemoteBrokenTLSBuild() (JobResponse, error)
- func GetRemoteBuildResponse(commands ...string) (JobResponse, error)
- func GetRemoteFailedBuild() (JobResponse, error)
- func GetRemoteGitLabComTLSBuild() (JobResponse, error)
- func GetRemoteLongRunningBuild() (JobResponse, error)
- func GetRemoteSuccessfulBuild() (JobResponse, error)
- func GetRemoteSuccessfulBuildWithAfterScript() (JobResponse, error)
- func GetRemoteSuccessfulBuildWithDumpedVariables() (JobResponse, error)
- func GetRemoteSuccessfulLFSBuild() (JobResponse, error)
- func GetSuccessfulBuild() (JobResponse, error)
- type JobState
- type JobTrace
- type JobTracePatch
- type JobVariable
- type JobVariables
- func (b JobVariables) Expand() (variables JobVariables)
- func (b JobVariables) ExpandValue(value string) string
- func (b JobVariables) Get(key string) string
- func (b JobVariables) Masked() (masked []string)
- func (b JobVariables) PublicOrInternal() (variables JobVariables)
- func (b JobVariables) StringList() (variables []string)
- type KubernetesConfig
- type KubernetesConfigMap
- type KubernetesEmptyDir
- type KubernetesHostPath
- type KubernetesPVC
- type KubernetesPullPolicy
- type KubernetesSecret
- type KubernetesVolumes
- type MockCommander
- type MockExecutor
- func (_m *MockExecutor) Cleanup()
- func (_m *MockExecutor) Finish(err error)
- func (_m *MockExecutor) GetCurrentStage() ExecutorStage
- func (_m *MockExecutor) Prepare(options ExecutorPrepareOptions) error
- func (_m *MockExecutor) Run(cmd ExecutorCommand) error
- func (_m *MockExecutor) SetCurrentStage(stage ExecutorStage)
- func (_m *MockExecutor) Shell() *ShellScriptInfo
- type MockExecutorData
- type MockExecutorProvider
- func (_m *MockExecutorProvider) Acquire(config *RunnerConfig) (ExecutorData, error)
- func (_m *MockExecutorProvider) CanCreate() bool
- func (_m *MockExecutorProvider) Create() Executor
- func (_m *MockExecutorProvider) GetDefaultShell() string
- func (_m *MockExecutorProvider) GetFeatures(features *FeaturesInfo) error
- func (_m *MockExecutorProvider) Release(config *RunnerConfig, data ExecutorData)
- type MockFailuresCollector
- type MockJobTrace
- func (_m *MockJobTrace) Fail(err error, failureReason JobFailureReason)
- func (_m *MockJobTrace) IsStdout() bool
- func (_m *MockJobTrace) SetCancelFunc(cancelFunc context.CancelFunc)
- func (_m *MockJobTrace) SetFailuresCollector(fc FailuresCollector)
- func (_m *MockJobTrace) SetMasked(values []string)
- func (_m *MockJobTrace) Success()
- func (_m *MockJobTrace) Write(p []byte) (int, error)
- type MockJobTracePatch
- type MockNetwork
- func (_m *MockNetwork) DownloadArtifacts(config JobCredentials, artifactsFile string) DownloadState
- func (_m *MockNetwork) PatchTrace(config RunnerConfig, jobCredentials *JobCredentials, tracePart JobTracePatch) UpdateState
- func (_m *MockNetwork) ProcessJob(config RunnerConfig, buildCredentials *JobCredentials) JobTrace
- func (_m *MockNetwork) RegisterRunner(config RunnerCredentials, parameters RegisterRunnerParameters) *RegisterRunnerResponse
- func (_m *MockNetwork) RequestJob(config RunnerConfig, sessionInfo *SessionInfo) (*JobResponse, bool)
- func (_m *MockNetwork) UnregisterRunner(config RunnerCredentials) bool
- func (_m *MockNetwork) UpdateJob(config RunnerConfig, jobCredentials *JobCredentials, jobInfo UpdateJobInfo) UpdateState
- func (_m *MockNetwork) UploadRawArtifacts(config JobCredentials, reader io.Reader, options ArtifactsOptions) UploadState
- func (_m *MockNetwork) VerifyRunner(config RunnerCredentials) bool
- type MockShell
- func (_m *MockShell) GenerateScript(buildStage BuildStage, info ShellScriptInfo) (string, error)
- func (_m *MockShell) GetConfiguration(info ShellScriptInfo) (*ShellConfiguration, error)
- func (_m *MockShell) GetFeatures(features *FeaturesInfo)
- func (_m *MockShell) GetName() string
- func (_m *MockShell) IsDefault() bool
- type Network
- type ParallelsConfig
- type RegisterRunnerParameters
- type RegisterRunnerRequest
- type RegisterRunnerResponse
- type RunnerConfig
- type RunnerCredentials
- func (c *RunnerCredentials) GetTLSCAFile() string
- func (c *RunnerCredentials) GetTLSCertFile() string
- func (c *RunnerCredentials) GetTLSKeyFile() string
- func (c *RunnerCredentials) GetToken() string
- func (c *RunnerCredentials) GetURL() string
- func (c *RunnerCredentials) Log() *log.Entry
- func (c *RunnerCredentials) SameAs(other *RunnerCredentials) bool
- func (c *RunnerCredentials) ShortDescription() string
- func (c *RunnerCredentials) UniqueID() string
- type RunnerInfo
- type RunnerSettings
- type Services
- type SessionInfo
- type SessionServer
- type Shell
- type ShellConfiguration
- type ShellScriptInfo
- type ShellType
- type Step
- type StepName
- type StepScript
- type StepWhen
- type Steps
- type SubmoduleStrategy
- type Trace
- func (s *Trace) Fail(err error, failureReason JobFailureReason)
- func (s *Trace) IsStdout() bool
- func (s *Trace) SetCancelFunc(cancelFunc context.CancelFunc)
- func (s *Trace) SetFailuresCollector(fc FailuresCollector)
- func (s *Trace) SetMasked(values []string)
- func (s *Trace) Success()
- func (s *Trace) Write(p []byte) (n int, err error)
- type UnregisterRunnerRequest
- type UpdateJobInfo
- type UpdateJobRequest
- type UpdateState
- type UploadState
- type VerifyRunnerRequest
- type VersionInfo
- type VirtualBoxConfig
Constants ¶
const ( PullPolicyAlways = "always" PullPolicyNever = "never" PullPolicyIfNotPresent = "if-not-present" )
const ( TestAlpineImage = "alpine:3.7" TestAlpineNoRootImage = "registry.gitlab.com/gitlab-org/gitlab-runner/alpine-no-root:latest" TestDockerDindImage = "docker:18-dind" TestDockerGitImage = "docker:18-git" )
const AfterScriptTimeout = 5 * time.Minute
const CheckInterval = 3 * time.Second
const DefaultArtifactDownloadAttempts = 1
const DefaultCacheRequestTimeout = 10
const DefaultExecTimeout = 1800
const DefaultGetSourcesAttempts = 1
const DefaultMetricsServerPort = 9252
const DefaultNetworkClientTimeout = 60 * time.Minute
const DefaultOutputLimit = 4096 // 4MB in kilobytes
const DefaultRestoreCacheAttempts = 1
const DefaultSessionTimeout = 30 * time.Minute
const DefaultTimeout = 7200
const DefaultWaitForServicesTimeout = 30
const (
FFDockerHelperImageV2 string = "FF_DOCKER_HELPER_IMAGE_V2"
)
const (
FilesLFSFile1LFSsize = int64(2097152)
)
const ForceTraceSentInterval = 30 * time.Second
const HealthCheckInterval = 3600
const HealthyChecks = 3
const KubernetesPollInterval = 3
const KubernetesPollTimeout = 180
const NotHealthyCheckInterval = 300
const PreparationRetries = 3
const ReloadConfigInterval = 3
const ShutdownTimeout = 30
const UpdateInterval = 3 * time.Second
const UpdateRetryInterval = 3 * time.Second
Variables ¶
var BRANCH = "HEAD"
var BUILT = "unknown"
var NAME = "gitlab-runner"
var PreparationRetryInterval = 3 * time.Second
var REVISION = "HEAD"
var VERSION = "development version"
Functions ¶
func GenerateShellScript ¶
func GenerateShellScript(buildStage BuildStage, info ShellScriptInfo) (string, error)
func GetCommands ¶
func GetDefaultShell ¶
func GetDefaultShell() string
func GetExecutors ¶
func GetExecutors() []string
func RegisterCommand ¶
func RegisterCommand2 ¶
func RegisterExecutor ¶
func RegisterExecutor(executor string, provider ExecutorProvider)
func RegisterShell ¶
func RegisterShell(shell Shell)
Types ¶
type AppVersionInfo ¶ added in v1.4.0
type AppVersionInfo struct { Name string `json:"name"` Version string `json:"version"` Revision string `json:"revision"` Branch string `json:"branch"` GOVersion string `json:"go_version"` BuiltAt string `json:"built_at"` OS string `json:"os"` Architecture string `json:"architecture"` }
var AppVersion AppVersionInfo
func (*AppVersionInfo) Extended ¶ added in v1.4.0
func (v *AppVersionInfo) Extended() string
func (*AppVersionInfo) Line ¶ added in v1.4.0
func (v *AppVersionInfo) Line() string
func (*AppVersionInfo) NewMetricsCollector ¶ added in v1.8.0
func (v *AppVersionInfo) NewMetricsCollector() *prometheus.GaugeVec
NewMetricsCollector returns a prometheus.Collector which represents current build information.
func (*AppVersionInfo) Printer ¶ added in v1.4.0
func (v *AppVersionInfo) Printer(c *cli.Context)
func (*AppVersionInfo) ShortLine ¶ added in v1.4.0
func (v *AppVersionInfo) ShortLine() string
func (*AppVersionInfo) UserAgent ¶ added in v1.4.0
func (v *AppVersionInfo) UserAgent() string
func (*AppVersionInfo) Variables ¶
func (v *AppVersionInfo) Variables() JobVariables
type Artifact ¶
type Artifact struct { Name string `json:"name"` Untracked bool `json:"untracked"` Paths ArtifactPaths `json:"paths"` When ArtifactWhen `json:"when"` Type string `json:"artifact_type"` Format ArtifactFormat `json:"artifact_format"` ExpireIn string `json:"expire_in"` }
type ArtifactFormat ¶
type ArtifactFormat string
const ( ArtifactFormatDefault ArtifactFormat = "" ArtifactFormatZip ArtifactFormat = "zip" ArtifactFormatGzip ArtifactFormat = "gzip" ArtifactFormatRaw ArtifactFormat = "raw" )
type ArtifactPaths ¶
type ArtifactPaths []string
type ArtifactWhen ¶
type ArtifactWhen string
const ( ArtifactWhenOnFailure ArtifactWhen = "on_failure" ArtifactWhenOnSuccess ArtifactWhen = "on_success" ArtifactWhenAlways ArtifactWhen = "always" )
func (ArtifactWhen) OnFailure ¶
func (when ArtifactWhen) OnFailure() bool
func (ArtifactWhen) OnSuccess ¶
func (when ArtifactWhen) OnSuccess() bool
type ArtifactsOptions ¶
type ArtifactsOptions struct { BaseName string ExpireIn string Format ArtifactFormat Type string }
type Build ¶
type Build struct { JobResponse `yaml:",inline"` SystemInterrupt chan os.Signal `json:"-" yaml:"-"` RootDir string `json:"-" yaml:"-"` BuildDir string `json:"-" yaml:"-"` CacheDir string `json:"-" yaml:"-"` Hostname string `json:"-" yaml:"-"` Runner *RunnerConfig `json:"runner"` ExecutorData ExecutorData ExecutorFeatures FeaturesInfo `json:"-" yaml:"-"` // Unique ID for all running builds on this runner RunnerID int `json:"runner_id"` // Unique ID for all running builds on this runner and this project ProjectRunnerID int `json:"project_runner_id"` CurrentStage BuildStage CurrentState BuildRuntimeState Session *session.Session // contains filtered or unexported fields }
func NewBuild ¶
func NewBuild(jobData JobResponse, runnerConfig *RunnerConfig, systemInterrupt chan os.Signal, executorData ExecutorData) (*Build, error)
func (*Build) CurrentExecutorStage ¶
func (b *Build) CurrentExecutorStage() ExecutorStage
func (*Build) FullProjectDir ¶
func (*Build) GetAllVariables ¶
func (b *Build) GetAllVariables() JobVariables
func (*Build) GetBuildTimeout ¶
func (*Build) GetCITLSVariables ¶
func (b *Build) GetCITLSVariables() JobVariables
func (*Build) GetCacheRequestTimeout ¶
func (*Build) GetDefaultFeatureFlagsVariables ¶
func (b *Build) GetDefaultFeatureFlagsVariables() JobVariables
func (*Build) GetDefaultVariables ¶
func (b *Build) GetDefaultVariables() JobVariables
func (*Build) GetDockerAuthConfig ¶ added in v1.8.0
func (*Build) GetDownloadArtifactsAttempts ¶ added in v1.9.0
func (*Build) GetGetSourcesAttempts ¶ added in v1.9.0
func (*Build) GetGitCheckout ¶
func (*Build) GetGitDepth ¶ added in v1.3.0
GetGitDepth is deprecated and will be removed in 12.0, use build.GitInfo.Depth instead TODO: Remove in 12.0
func (*Build) GetGitStrategy ¶ added in v1.3.0
func (b *Build) GetGitStrategy() GitStrategy
func (*Build) GetGitTLSVariables ¶
func (b *Build) GetGitTLSVariables() JobVariables
func (*Build) GetRemoteURL ¶
GetRemoteURL checks if the default clone URL is overwritten by the runner configuration option: 'CloneURL'. If it is, we use that to create the clone URL.
func (*Build) GetRestoreCacheAttempts ¶ added in v1.9.0
func (*Build) GetSharedEnvVariable ¶
func (b *Build) GetSharedEnvVariable() JobVariable
func (*Build) GetSubmoduleStrategy ¶ added in v1.10.0
func (b *Build) GetSubmoduleStrategy() SubmoduleStrategy
func (*Build) GetTLSVariables ¶
func (b *Build) GetTLSVariables(caFile, certFile, keyFile string) JobVariables
func (*Build) IsDebugTraceEnabled ¶ added in v1.7.0
func (*Build) IsFeatureFlagOn ¶
func (*Build) IsLFSSmudgeDisabled ¶
func (*Build) IsSharedEnv ¶
func (*Build) ProjectSlug ¶
func (*Build) ProjectUniqueDir ¶
func (*Build) ProjectUniqueName ¶
func (*Build) RefspecsAvailable ¶
func (*Build) StartBuild ¶
type BuildError ¶ added in v1.4.0
type BuildError struct { Inner error FailureReason JobFailureReason }
func (*BuildError) Error ¶ added in v1.4.0
func (b *BuildError) Error() string
type BuildLogger ¶ added in v1.4.0
type BuildLogger struct {
// contains filtered or unexported fields
}
func NewBuildLogger ¶ added in v1.4.0
func NewBuildLogger(log JobTrace, entry *logrus.Entry) BuildLogger
func (*BuildLogger) Debugln ¶ added in v1.4.0
func (e *BuildLogger) Debugln(args ...interface{})
func (*BuildLogger) Errorln ¶ added in v1.4.0
func (e *BuildLogger) Errorln(args ...interface{})
func (*BuildLogger) Infoln ¶ added in v1.4.0
func (e *BuildLogger) Infoln(args ...interface{})
func (*BuildLogger) Println ¶ added in v1.4.0
func (e *BuildLogger) Println(args ...interface{})
func (*BuildLogger) SendRawLog ¶
func (e *BuildLogger) SendRawLog(args ...interface{})
func (*BuildLogger) SoftErrorln ¶ added in v1.4.0
func (e *BuildLogger) SoftErrorln(args ...interface{})
func (*BuildLogger) Warningln ¶ added in v1.4.0
func (e *BuildLogger) Warningln(args ...interface{})
func (*BuildLogger) WithFields ¶
func (e *BuildLogger) WithFields(fields logrus.Fields) BuildLogger
type BuildRuntimeState ¶ added in v1.9.0
type BuildRuntimeState string
const ( BuildRunStatePending BuildRuntimeState = "pending" BuildRunRuntimeRunning BuildRuntimeState = "running" BuildRunRuntimeFinished BuildRuntimeState = "finished" BuildRunRuntimeCanceled BuildRuntimeState = "canceled" BuildRunRuntimeTerminated BuildRuntimeState = "terminated" BuildRunRuntimeTimedout BuildRuntimeState = "timedout" )
type BuildStage ¶ added in v1.9.0
type BuildStage string
const ( BuildStagePrepare BuildStage = "prepare_script" BuildStageGetSources BuildStage = "get_sources" BuildStageRestoreCache BuildStage = "restore_cache" BuildStageDownloadArtifacts BuildStage = "download_artifacts" BuildStageUserScript BuildStage = "build_script" BuildStageAfterScript BuildStage = "after_script" BuildStageArchiveCache BuildStage = "archive_cache" BuildStageUploadOnSuccessArtifacts BuildStage = "upload_artifacts_on_success" BuildStageUploadOnFailureArtifacts BuildStage = "upload_artifacts_on_failure" )
type Cache ¶
type Cache struct { Key string `json:"key"` Untracked bool `json:"untracked"` Policy CachePolicy `json:"policy"` Paths ArtifactPaths `json:"paths"` }
func (Cache) CheckPolicy ¶
func (c Cache) CheckPolicy(wanted CachePolicy) (bool, error)
type CacheConfig ¶
type CacheConfig struct { Type string `toml:"Type,omitempty" long:"type" env:"CACHE_TYPE" description:"Select caching method"` Path string `toml:"Path,omitempty" long:"path" env:"CACHE_PATH" description:"Name of the path to prepend to the cache URL"` S3 *CacheS3Config `toml:"s3,omitempty" json:"s3" namespace:"s3"` GCS *CacheGCSConfig `toml:"gcs,omitempty" json:"gcs" namespace:"gcs"` // TODO: Remove in 12.0 S3CachePath string `toml:"-" long:"s3-cache-path" env:"S3_CACHE_PATH" description:"Name of the path to prepend to the cache URL. DEPRECATED"` // DEPRECATED ServerAddress string `toml:"ServerAddress,omitempty" description:"A host:port to the used S3-compatible server DEPRECATED"` // DEPRECATED AccessKey string `toml:"AccessKey,omitempty" description:"S3 Access Key DEPRECATED"` // DEPRECATED SecretKey string `toml:"SecretKey,omitempty" description:"S3 Secret Key DEPRECATED"` // DEPRECATED BucketName string `toml:"BucketName,omitempty" description:"Name of the bucket where cache will be stored DEPRECATED"` // DEPRECATED BucketLocation string `toml:"BucketLocation,omitempty" description:"Name of S3 region DEPRECATED"` // DEPRECATED Insecure bool `toml:"Insecure,omitempty" description:"Use insecure mode (without https) DEPRECATED"` // DEPRECATED }
func (*CacheConfig) GetAccessKey ¶
func (c *CacheConfig) GetAccessKey() string
DEPRECATED TODO: Remove in 12.0
func (*CacheConfig) GetBucketLocation ¶
func (c *CacheConfig) GetBucketLocation() string
DEPRECATED TODO: Remove in 12.0
func (*CacheConfig) GetBucketName ¶
func (c *CacheConfig) GetBucketName() string
DEPRECATED TODO: Remove in 12.0
func (*CacheConfig) GetInsecure ¶
func (c *CacheConfig) GetInsecure() bool
DEPRECATED TODO: Remove in 12.0
func (*CacheConfig) GetPath ¶
func (c *CacheConfig) GetPath() string
func (*CacheConfig) GetSecretKey ¶
func (c *CacheConfig) GetSecretKey() string
DEPRECATED TODO: Remove in 12.0
func (*CacheConfig) GetServerAddress ¶
func (c *CacheConfig) GetServerAddress() string
DEPRECATED TODO: Remove in 12.0
func (*CacheConfig) GetShared ¶
func (c *CacheConfig) GetShared() bool
type CacheGCSConfig ¶
type CacheGCSConfig struct { CacheGCSCredentials CredentialsFile string `` /* 169-byte string literal not displayed */ BucketName string `` /* 134-byte string literal not displayed */ }
type CacheGCSCredentials ¶
type CachePolicy ¶
type CachePolicy string
const ( CachePolicyUndefined CachePolicy = "" CachePolicyPullPush CachePolicy = "pull-push" CachePolicyPull CachePolicy = "pull" CachePolicyPush CachePolicy = "push" )
type CacheS3Config ¶
type CacheS3Config struct { ServerAddress string `` /* 141-byte string literal not displayed */ AccessKey string `toml:"AccessKey,omitempty" long:"access-key" env:"CACHE_S3_ACCESS_KEY" description:"S3 Access Key"` SecretKey string `toml:"SecretKey,omitempty" long:"secret-key" env:"CACHE_S3_SECRET_KEY" description:"S3 Secret Key"` BucketName string `` /* 133-byte string literal not displayed */ BucketLocation string `toml:"BucketLocation,omitempty" long:"bucket-location" env:"CACHE_S3_BUCKET_LOCATION" description:"Name of S3 region"` Insecure bool `toml:"Insecure,omitempty" long:"insecure" env:"CACHE_S3_INSECURE" description:"Use insecure mode (without https)"` }
func (*CacheS3Config) ShouldUseIAMCredentials ¶
func (c *CacheS3Config) ShouldUseIAMCredentials() bool
type Config ¶
type Config struct { ListenAddress string `toml:"listen_address,omitempty" json:"listen_address"` SessionServer SessionServer `toml:"session_server,omitempty" json:"session_server"` // TODO: Remove in 12.0 MetricsServerAddress string `toml:"metrics_server,omitempty" json:"metrics_server"` // DEPRECATED Concurrent int `toml:"concurrent" json:"concurrent"` CheckInterval int `toml:"check_interval" json:"check_interval" description:"Define active checking interval of jobs"` LogLevel *string `toml:"log_level" json:"log_level" description:"Define log level (one of: panic, fatal, error, warning, info, debug)"` LogFormat *string `toml:"log_format" json:"log_format" description:"Define log format (one of: runner, text, json)"` User string `toml:"user,omitempty" json:"user"` Runners []*RunnerConfig `toml:"runners" json:"runners"` SentryDSN *string `toml:"sentry_dsn"` ModTime time.Time `toml:"-"` Loaded bool `toml:"-"` }
func (*Config) GetCheckInterval ¶ added in v1.3.0
func (*Config) ListenOrServerMetricAddress ¶
func (*Config) LoadConfig ¶
func (*Config) SaveConfig ¶
func (*Config) StatConfig ¶
type ContainerCommand ¶
type ContainerCommand []string
var (
ContainerCommandBuild ContainerCommand = []string{"gitlab-runner-build"}
)
type Credentials ¶
type Dependencies ¶
type Dependencies []Dependency
type Dependency ¶
type Dependency struct { ID int `json:"id"` Token string `json:"token"` Name string `json:"name"` ArtifactsFile DependencyArtifactsFile `json:"artifacts_file"` }
type DependencyArtifactsFile ¶
type DockerConfig ¶
type DockerConfig struct { docker_helpers.DockerCredentials Hostname string `toml:"hostname,omitempty" json:"hostname" long:"hostname" env:"DOCKER_HOSTNAME" description:"Custom container hostname"` Image string `toml:"image" json:"image" long:"image" env:"DOCKER_IMAGE" description:"Docker image to be used"` Runtime string `toml:"runtime,omitempty" json:"runtime" long:"runtime" env:"DOCKER_RUNTIME" description:"Docker runtime to be used"` Memory string `` /* 175-byte string literal not displayed */ MemorySwap string `` /* 201-byte string literal not displayed */ MemoryReservation string `` /* 213-byte string literal not displayed */ CPUSetCPUs string `` /* 159-byte string literal not displayed */ CPUS string `toml:"cpus,omitempty" json:"cpus" long:"cpus" env:"DOCKER_CPUS" description:"Number of CPUs"` DNS []string `toml:"dns,omitempty" json:"dns" long:"dns" env:"DOCKER_DNS" description:"A list of DNS servers for the container to use"` DNSSearch []string `` /* 130-byte string literal not displayed */ Privileged bool `` /* 138-byte string literal not displayed */ DisableEntrypointOverwrite bool `` /* 254-byte string literal not displayed */ UsernsMode string `toml:"userns_mode,omitempty" json:"userns_mode" long:"userns" env:"DOCKER_USERNS_MODE" description:"User namespace to use"` CapAdd []string `toml:"cap_add" json:"cap_add" long:"cap-add" env:"DOCKER_CAP_ADD" description:"Add Linux capabilities"` CapDrop []string `toml:"cap_drop" json:"cap_drop" long:"cap-drop" env:"DOCKER_CAP_DROP" description:"Drop Linux capabilities"` OomKillDisable bool `` /* 200-byte string literal not displayed */ SecurityOpt []string `toml:"security_opt" json:"security_opt" long:"security-opt" env:"DOCKER_SECURITY_OPT" description:"Security Options"` Devices []string `toml:"devices" json:"devices" long:"devices" env:"DOCKER_DEVICES" description:"Add a host device to the container"` DisableCache bool `` /* 142-byte string literal not displayed */ Volumes []string `` /* 284-byte string literal not displayed */ VolumeDriver string `` /* 138-byte string literal not displayed */ CacheDir string `` /* 129-byte string literal not displayed */ ExtraHosts []string `` /* 137-byte string literal not displayed */ VolumesFrom []string `` /* 161-byte string literal not displayed */ NetworkMode string `` /* 143-byte string literal not displayed */ Links []string `toml:"links,omitempty" json:"links" long:"links" env:"DOCKER_LINKS" description:"Add link to another container"` Services []string `` /* 136-byte string literal not displayed */ WaitForServicesTimeout int `` /* 197-byte string literal not displayed */ AllowedImages []string `` /* 142-byte string literal not displayed */ AllowedServices []string `` /* 152-byte string literal not displayed */ PullPolicy DockerPullPolicy `` /* 154-byte string literal not displayed */ ShmSize int64 `` /* 141-byte string literal not displayed */ Tmpfs map[string]string `` /* 344-byte string literal not displayed */ ServicesTmpfs map[string]string `` /* 388-byte string literal not displayed */ SysCtls DockerSysCtls `` /* 178-byte string literal not displayed */ HelperImage string `` /* 195-byte string literal not displayed */ }
func (*DockerConfig) GetMemory ¶
func (c *DockerConfig) GetMemory() int64
func (*DockerConfig) GetMemoryReservation ¶
func (c *DockerConfig) GetMemoryReservation() int64
func (*DockerConfig) GetMemorySwap ¶
func (c *DockerConfig) GetMemorySwap() int64
func (*DockerConfig) GetNanoCPUs ¶
func (c *DockerConfig) GetNanoCPUs() (int64, error)
func (*DockerConfig) GetOomKillDisable ¶
func (c *DockerConfig) GetOomKillDisable() *bool
type DockerMachine ¶
type DockerMachine struct { IdleCount int `long:"idle-nodes" env:"MACHINE_IDLE_COUNT" description:"Maximum idle machines"` IdleTime int `toml:"IdleTime,omitzero" long:"idle-time" env:"MACHINE_IDLE_TIME" description:"Minimum time after node can be destroyed"` MaxBuilds int `` /* 128-byte string literal not displayed */ MachineDriver string `long:"machine-driver" env:"MACHINE_DRIVER" description:"The driver to use when creating machine"` MachineName string `long:"machine-name" env:"MACHINE_NAME" description:"The template for machine name (needs to include %s)"` MachineOptions []string `long:"machine-options" env:"MACHINE_OPTIONS" description:"Additional machine creation options"` OffPeakPeriods []string `long:"off-peak-periods" env:"MACHINE_OFF_PEAK_PERIODS" description:"Time periods when the scheduler is in the OffPeak mode"` OffPeakTimezone string `long:"off-peak-timezone" env:"MACHINE_OFF_PEAK_TIMEZONE" description:"Timezone for the OffPeak periods (defaults to Local)"` OffPeakIdleCount int `` /* 138-byte string literal not displayed */ OffPeakIdleTime int `` /* 158-byte string literal not displayed */ // contains filtered or unexported fields }
func (*DockerMachine) CompileOffPeakPeriods ¶ added in v1.7.0
func (c *DockerMachine) CompileOffPeakPeriods() (err error)
func (*DockerMachine) GetIdleCount ¶ added in v1.7.0
func (c *DockerMachine) GetIdleCount() int
func (*DockerMachine) GetIdleTime ¶ added in v1.7.0
func (c *DockerMachine) GetIdleTime() int
type DockerPullPolicy ¶
type DockerPullPolicy string
func (DockerPullPolicy) Get ¶
func (p DockerPullPolicy) Get() (DockerPullPolicy, error)
Get returns one of the predefined values or returns an error if the value can't match the predefined
type DockerSysCtls ¶
type DownloadState ¶
type DownloadState int
const ( DownloadSucceeded DownloadState = iota DownloadForbidden DownloadFailed DownloadNotFound )
type Executor ¶
type Executor interface { Shell() *ShellScriptInfo Prepare(options ExecutorPrepareOptions) error Run(cmd ExecutorCommand) error Finish(err error) Cleanup() GetCurrentStage() ExecutorStage SetCurrentStage(stage ExecutorStage) }
func NewExecutor ¶
type ExecutorCommand ¶ added in v1.2.0
type ExecutorCommand struct { Script string Stage BuildStage Predefined bool Context context.Context }
type ExecutorData ¶
type ExecutorData interface{}
type ExecutorPrepareOptions ¶
type ExecutorProvider ¶
type ExecutorProvider interface { CanCreate() bool Create() Executor Acquire(config *RunnerConfig) (ExecutorData, error) Release(config *RunnerConfig, data ExecutorData) GetFeatures(features *FeaturesInfo) error GetDefaultShell() string }
func GetExecutor ¶
func GetExecutor(executor string) ExecutorProvider
func GetExecutorProviders ¶ added in v1.9.0
func GetExecutorProviders() (providers []ExecutorProvider)
type ExecutorStage ¶
type ExecutorStage string
const ( ExecutorStageCreated ExecutorStage = "created" ExecutorStagePrepare ExecutorStage = "prepare" ExecutorStageFinish ExecutorStage = "finish" ExecutorStageCleanup ExecutorStage = "cleanup" )
type FailuresCollector ¶
type FailuresCollector interface {
RecordFailure(reason JobFailureReason, runnerDescription string)
}
type FeaturesInfo ¶
type FeaturesInfo struct { Variables bool `json:"variables"` Image bool `json:"image"` Services bool `json:"services"` Artifacts bool `json:"artifacts"` Cache bool `json:"cache"` UploadMultipleArtifacts bool `json:"upload_multiple_artifacts"` UploadRawArtifacts bool `json:"upload_raw_artifacts"` Session bool `json:"session"` Terminal bool `json:"terminal"` Refspecs bool `json:"refspecs"` Masking bool `json:"masking"` }
type GitInfo ¶
type GitInfo struct { RepoURL string `json:"repo_url"` Ref string `json:"ref"` Sha string `json:"sha"` BeforeSha string `json:"before_sha"` RefType GitInfoRefType `json:"ref_type"` Refspecs []string `json:"refspecs"` Depth int `json:"depth"` }
func GetGitInfo ¶
func GetLFSGitInfo ¶
type GitInfoRefType ¶
type GitInfoRefType string
const ( RefTypeBranch GitInfoRefType = "branch" RefTypeTag GitInfoRefType = "tag" )
type GitStrategy ¶ added in v1.3.0
type GitStrategy int
const ( GitClone GitStrategy = iota GitFetch GitNone )
type GitlabFeatures ¶
type GitlabFeatures struct {
TraceSections bool `json:"trace_sections"`
}
type JobCredentials ¶
type JobCredentials struct { ID int `long:"id" env:"CI_JOB_ID" description:"The build ID to upload artifacts for"` Token string `long:"token" env:"CI_JOB_TOKEN" required:"true" description:"Build token"` URL string `long:"url" env:"CI_SERVER_URL" required:"true" description:"GitLab CI URL"` TLSCAFile string `` /* 129-byte string literal not displayed */ TLSCertFile string `` /* 141-byte string literal not displayed */ TLSKeyFile string `` /* 139-byte string literal not displayed */ }
func (*JobCredentials) GetTLSCAFile ¶
func (j *JobCredentials) GetTLSCAFile() string
func (*JobCredentials) GetTLSCertFile ¶
func (j *JobCredentials) GetTLSCertFile() string
func (*JobCredentials) GetTLSKeyFile ¶
func (j *JobCredentials) GetTLSKeyFile() string
func (*JobCredentials) GetToken ¶
func (j *JobCredentials) GetToken() string
func (*JobCredentials) GetURL ¶
func (j *JobCredentials) GetURL() string
type JobFailureReason ¶
type JobFailureReason string
const ( NoneFailure JobFailureReason = "" ScriptFailure JobFailureReason = "script_failure" RunnerSystemFailure JobFailureReason = "runner_system_failure" JobExecutionTimeout JobFailureReason = "job_execution_timeout" )
type JobRequest ¶
type JobRequest struct { Info VersionInfo `json:"info,omitempty"` Token string `json:"token,omitempty"` LastUpdate string `json:"last_update,omitempty"` Session *SessionInfo `json:"session,omitempty"` }
type JobResponse ¶
type JobResponse struct { ID int `json:"id"` Token string `json:"token"` AllowGitFetch bool `json:"allow_git_fetch"` JobInfo JobInfo `json:"job_info"` GitInfo GitInfo `json:"git_info"` RunnerInfo RunnerInfo `json:"runner_info"` Variables JobVariables `json:"variables"` Steps Steps `json:"steps"` Image Image `json:"image"` Services Services `json:"services"` Artifacts Artifacts `json:"artifacts"` Cache Caches `json:"cache"` Credentials []Credentials `json:"credentials"` Dependencies Dependencies `json:"dependencies"` Features GitlabFeatures `json:"features"` TLSCAChain string `json:"-"` TLSAuthCert string `json:"-"` TLSAuthKey string `json:"-"` }
func GetFailedBuild ¶ added in v1.8.0
func GetFailedBuild() (JobResponse, error)
func GetLocalBuildResponse ¶
func GetLocalBuildResponse(commands ...string) (JobResponse, error)
func GetLongRunningBuild ¶ added in v1.8.0
func GetLongRunningBuild() (JobResponse, error)
func GetMultilineBashBuild ¶
func GetMultilineBashBuild() (JobResponse, error)
func GetRemoteBrokenTLSBuild ¶
func GetRemoteBrokenTLSBuild() (JobResponse, error)
func GetRemoteBuildResponse ¶
func GetRemoteBuildResponse(commands ...string) (JobResponse, error)
func GetRemoteFailedBuild ¶ added in v1.8.0
func GetRemoteFailedBuild() (JobResponse, error)
func GetRemoteGitLabComTLSBuild ¶
func GetRemoteGitLabComTLSBuild() (JobResponse, error)
func GetRemoteLongRunningBuild ¶ added in v1.8.0
func GetRemoteLongRunningBuild() (JobResponse, error)
func GetRemoteSuccessfulBuild ¶ added in v1.8.0
func GetRemoteSuccessfulBuild() (JobResponse, error)
func GetRemoteSuccessfulBuildWithAfterScript ¶
func GetRemoteSuccessfulBuildWithAfterScript() (JobResponse, error)
func GetRemoteSuccessfulBuildWithDumpedVariables ¶
func GetRemoteSuccessfulBuildWithDumpedVariables() (JobResponse, error)
func GetRemoteSuccessfulLFSBuild ¶
func GetRemoteSuccessfulLFSBuild() (JobResponse, error)
func GetSuccessfulBuild ¶ added in v1.8.0
func GetSuccessfulBuild() (JobResponse, error)
func (*JobResponse) RepoCleanURL ¶
func (j *JobResponse) RepoCleanURL() string
type JobTrace ¶
type JobTrace interface { io.Writer Success() Fail(err error, failureReason JobFailureReason) SetCancelFunc(cancelFunc context.CancelFunc) SetFailuresCollector(fc FailuresCollector) SetMasked(values []string) IsStdout() bool }
type JobTracePatch ¶
type JobVariable ¶
type JobVariable struct { Key string `json:"key"` Value string `json:"value"` Public bool `json:"public"` Internal bool `json:"-"` File bool `json:"file"` Masked bool `json:"masked"` }
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) Masked ¶
func (b JobVariables) Masked() (masked []string)
func (JobVariables) PublicOrInternal ¶
func (b JobVariables) PublicOrInternal() (variables JobVariables)
func (JobVariables) StringList ¶
func (b JobVariables) StringList() (variables []string)
type KubernetesConfig ¶ added in v1.6.0
type KubernetesConfig struct { Host string `` /* 151-byte string literal not displayed */ CertFile string `` /* 145-byte string literal not displayed */ KeyFile string `` /* 141-byte string literal not displayed */ CAFile string `` /* 140-byte string literal not displayed */ BearerTokenOverwriteAllowed bool `` /* 248-byte string literal not displayed */ BearerToken string `` /* 181-byte string literal not displayed */ Image string `` /* 137-byte string literal not displayed */ Namespace string `` /* 127-byte string literal not displayed */ NamespaceOverwriteAllowed string `` /* 220-byte string literal not displayed */ Privileged bool `` /* 156-byte string literal not displayed */ CPULimit string `` /* 146-byte string literal not displayed */ MemoryLimit string `` /* 164-byte string literal not displayed */ ServiceCPULimit string `` /* 186-byte string literal not displayed */ ServiceMemoryLimit string `` /* 204-byte string literal not displayed */ HelperCPULimit string `` /* 181-byte string literal not displayed */ HelperMemoryLimit string `` /* 199-byte string literal not displayed */ CPURequest string `` /* 159-byte string literal not displayed */ MemoryRequest string `` /* 174-byte string literal not displayed */ ServiceCPURequest string `` /* 199-byte string literal not displayed */ ServiceMemoryRequest string `` /* 213-byte string literal not displayed */ HelperCPURequest string `` /* 194-byte string literal not displayed */ HelperMemoryRequest string `` /* 208-byte string literal not displayed */ PullPolicy KubernetesPullPolicy `` /* 231-byte string literal not displayed */ NodeSelector map[string]string `` /* 270-byte string literal not displayed */ NodeTolerations map[string]string `` /* 344-byte string literal not displayed */ ImagePullSecrets []string `` /* 205-byte string literal not displayed */ HelperImage string `` /* 199-byte string literal not displayed */ TerminationGracePeriodSeconds int64 `` /* 330-byte string literal not displayed */ PollInterval int `` /* 224-byte string literal not displayed */ PollTimeout int `` /* 325-byte string literal not displayed */ PodLabels map[string]string `` /* 268-byte string literal not displayed */ ServiceAccount string `` /* 195-byte string literal not displayed */ ServiceAccountOverwriteAllowed string `` /* 240-byte string literal not displayed */ PodAnnotations map[string]string `` /* 297-byte string literal not displayed */ PodAnnotationsOverwriteAllowed string `` /* 243-byte string literal not displayed */ Volumes KubernetesVolumes `toml:"volumes"` }
func (*KubernetesConfig) GetHelperImage ¶ added in v1.9.0
func (c *KubernetesConfig) GetHelperImage() string
func (*KubernetesConfig) GetNodeTolerations ¶
func (c *KubernetesConfig) GetNodeTolerations() []api.Toleration
func (*KubernetesConfig) GetPollAttempts ¶ added in v1.10.0
func (c *KubernetesConfig) GetPollAttempts() int
func (*KubernetesConfig) GetPollInterval ¶ added in v1.10.0
func (c *KubernetesConfig) GetPollInterval() int
type KubernetesConfigMap ¶
type KubernetesConfigMap struct { Name string `toml:"name" json:"name" description:"The name of the volume and ConfigMap to use"` MountPath string `toml:"mount_path" description:"Path where volume should be mounted inside of container"` ReadOnly bool `toml:"read_only,omitempty" description:"If this volume should be mounted read only"` Items map[string]string `toml:"items,omitempty" description:"Key-to-path mapping for keys from the config map that should be used."` }
type KubernetesEmptyDir ¶
type KubernetesEmptyDir struct { Name string `toml:"name" json:"name" description:"The name of the volume and EmptyDir to use"` MountPath string `toml:"mount_path" description:"Path where volume should be mounted inside of container"` Medium string `toml:"medium,omitempty" description:"Set to 'Memory' to have a tmpfs"` }
type KubernetesHostPath ¶
type KubernetesHostPath struct { Name string `toml:"name" json:"name" description:"The name of the volume"` MountPath string `toml:"mount_path" description:"Path where volume should be mounted inside of container"` ReadOnly bool `toml:"read_only,omitempty" description:"If this volume should be mounted read only"` HostPath string `toml:"host_path,omitempty" description:"Path from the host that should be mounted as a volume"` }
type KubernetesPVC ¶
type KubernetesPVC struct { Name string `toml:"name" json:"name" description:"The name of the volume and PVC to use"` MountPath string `toml:"mount_path" description:"Path where volume should be mounted inside of container"` ReadOnly bool `toml:"read_only,omitempty" description:"If this volume should be mounted read only"` }
type KubernetesPullPolicy ¶ added in v1.8.0
type KubernetesPullPolicy string
func (KubernetesPullPolicy) Get ¶ added in v1.8.0
func (p KubernetesPullPolicy) Get() (KubernetesPullPolicy, error)
Get returns one of the predefined values in kubernetes notation or returns an error if the value can't match the predefined
type KubernetesSecret ¶
type KubernetesSecret struct { Name string `toml:"name" json:"name" description:"The name of the volume and Secret to use"` MountPath string `toml:"mount_path" description:"Path where volume should be mounted inside of container"` ReadOnly bool `toml:"read_only,omitempty" description:"If this volume should be mounted read only"` Items map[string]string `toml:"items,omitempty" description:"Key-to-path mapping for keys from the secret that should be used."` }
type KubernetesVolumes ¶
type KubernetesVolumes struct { HostPaths []KubernetesHostPath `toml:"host_path" description:"The host paths which will be mounted"` PVCs []KubernetesPVC `toml:"pvc" description:"The persistent volume claims that will be mounted"` ConfigMaps []KubernetesConfigMap `toml:"config_map" description:"The config maps which will be mounted as volumes"` Secrets []KubernetesSecret `toml:"secret" description:"The secret maps which will be mounted"` EmptyDirs []KubernetesEmptyDir `toml:"empty_dir" description:"The empty dirs which will be mounted"` }
type MockCommander ¶ added in v1.5.0
MockCommander is an autogenerated mock type for the Commander type
func (*MockCommander) Execute ¶ added in v1.5.0
func (_m *MockCommander) Execute(c *cli.Context)
Execute provides a mock function with given fields: c
type MockExecutor ¶ added in v1.5.0
MockExecutor is an autogenerated mock type for the Executor type
func (*MockExecutor) Cleanup ¶ added in v1.5.0
func (_m *MockExecutor) Cleanup()
Cleanup provides a mock function with given fields:
func (*MockExecutor) Finish ¶ added in v1.5.0
func (_m *MockExecutor) Finish(err error)
Finish provides a mock function with given fields: err
func (*MockExecutor) GetCurrentStage ¶
func (_m *MockExecutor) GetCurrentStage() ExecutorStage
GetCurrentStage provides a mock function with given fields:
func (*MockExecutor) Prepare ¶ added in v1.5.0
func (_m *MockExecutor) Prepare(options ExecutorPrepareOptions) error
Prepare provides a mock function with given fields: options
func (*MockExecutor) Run ¶ added in v1.5.0
func (_m *MockExecutor) Run(cmd ExecutorCommand) error
Run provides a mock function with given fields: cmd
func (*MockExecutor) SetCurrentStage ¶
func (_m *MockExecutor) SetCurrentStage(stage ExecutorStage)
SetCurrentStage provides a mock function with given fields: stage
func (*MockExecutor) Shell ¶ added in v1.5.0
func (_m *MockExecutor) Shell() *ShellScriptInfo
Shell provides a mock function with given fields:
type MockExecutorData ¶ added in v1.5.0
MockExecutorData is an autogenerated mock type for the ExecutorData type
type MockExecutorProvider ¶ added in v1.5.0
MockExecutorProvider is an autogenerated mock type for the ExecutorProvider type
func (*MockExecutorProvider) Acquire ¶ added in v1.5.0
func (_m *MockExecutorProvider) Acquire(config *RunnerConfig) (ExecutorData, error)
Acquire provides a mock function with given fields: config
func (*MockExecutorProvider) CanCreate ¶ added in v1.5.0
func (_m *MockExecutorProvider) CanCreate() bool
CanCreate provides a mock function with given fields:
func (*MockExecutorProvider) Create ¶ added in v1.5.0
func (_m *MockExecutorProvider) Create() Executor
Create provides a mock function with given fields:
func (*MockExecutorProvider) GetDefaultShell ¶
func (_m *MockExecutorProvider) GetDefaultShell() string
GetDefaultShell provides a mock function with given fields:
func (*MockExecutorProvider) GetFeatures ¶ added in v1.5.0
func (_m *MockExecutorProvider) GetFeatures(features *FeaturesInfo) error
GetFeatures provides a mock function with given fields: features
func (*MockExecutorProvider) Release ¶ added in v1.5.0
func (_m *MockExecutorProvider) Release(config *RunnerConfig, data ExecutorData)
Release provides a mock function with given fields: config, data
type MockFailuresCollector ¶
MockFailuresCollector is an autogenerated mock type for the FailuresCollector type
func (*MockFailuresCollector) RecordFailure ¶
func (_m *MockFailuresCollector) RecordFailure(reason JobFailureReason, runnerDescription string)
RecordFailure provides a mock function with given fields: reason, runnerDescription
type MockJobTrace ¶
MockJobTrace is an autogenerated mock type for the JobTrace type
func (*MockJobTrace) Fail ¶
func (_m *MockJobTrace) Fail(err error, failureReason JobFailureReason)
Fail provides a mock function with given fields: err, failureReason
func (*MockJobTrace) IsStdout ¶
func (_m *MockJobTrace) IsStdout() bool
IsStdout provides a mock function with given fields:
func (*MockJobTrace) SetCancelFunc ¶
func (_m *MockJobTrace) SetCancelFunc(cancelFunc context.CancelFunc)
SetCancelFunc provides a mock function with given fields: cancelFunc
func (*MockJobTrace) SetFailuresCollector ¶
func (_m *MockJobTrace) SetFailuresCollector(fc FailuresCollector)
SetFailuresCollector provides a mock function with given fields: fc
func (*MockJobTrace) SetMasked ¶
func (_m *MockJobTrace) SetMasked(values []string)
SetMasked provides a mock function with given fields: values
func (*MockJobTrace) Success ¶
func (_m *MockJobTrace) Success()
Success provides a mock function with given fields:
type MockJobTracePatch ¶
MockJobTracePatch is an autogenerated mock type for the JobTracePatch type
func (*MockJobTracePatch) Offset ¶
func (_m *MockJobTracePatch) Offset() int
Offset provides a mock function with given fields:
func (*MockJobTracePatch) Patch ¶
func (_m *MockJobTracePatch) Patch() []byte
Patch provides a mock function with given fields:
func (*MockJobTracePatch) SetNewOffset ¶
func (_m *MockJobTracePatch) SetNewOffset(newOffset int)
SetNewOffset provides a mock function with given fields: newOffset
func (*MockJobTracePatch) TotalSize ¶
func (_m *MockJobTracePatch) TotalSize() int
TotalSize provides a mock function with given fields:
func (*MockJobTracePatch) ValidateRange ¶
func (_m *MockJobTracePatch) ValidateRange() bool
ValidateRange provides a mock function with given fields:
type MockNetwork ¶ added in v1.5.0
MockNetwork is an autogenerated mock type for the Network type
func (*MockNetwork) DownloadArtifacts ¶ added in v1.5.0
func (_m *MockNetwork) DownloadArtifacts(config JobCredentials, artifactsFile string) DownloadState
DownloadArtifacts provides a mock function with given fields: config, artifactsFile
func (*MockNetwork) PatchTrace ¶ added in v1.5.0
func (_m *MockNetwork) PatchTrace(config RunnerConfig, jobCredentials *JobCredentials, tracePart JobTracePatch) UpdateState
PatchTrace provides a mock function with given fields: config, jobCredentials, tracePart
func (*MockNetwork) ProcessJob ¶
func (_m *MockNetwork) ProcessJob(config RunnerConfig, buildCredentials *JobCredentials) JobTrace
ProcessJob provides a mock function with given fields: config, buildCredentials
func (*MockNetwork) RegisterRunner ¶ added in v1.5.0
func (_m *MockNetwork) RegisterRunner(config RunnerCredentials, parameters RegisterRunnerParameters) *RegisterRunnerResponse
RegisterRunner provides a mock function with given fields: config, parameters
func (*MockNetwork) RequestJob ¶
func (_m *MockNetwork) RequestJob(config RunnerConfig, sessionInfo *SessionInfo) (*JobResponse, bool)
RequestJob provides a mock function with given fields: config, sessionInfo
func (*MockNetwork) UnregisterRunner ¶
func (_m *MockNetwork) UnregisterRunner(config RunnerCredentials) bool
UnregisterRunner provides a mock function with given fields: config
func (*MockNetwork) UpdateJob ¶
func (_m *MockNetwork) UpdateJob(config RunnerConfig, jobCredentials *JobCredentials, jobInfo UpdateJobInfo) UpdateState
UpdateJob provides a mock function with given fields: config, jobCredentials, jobInfo
func (*MockNetwork) UploadRawArtifacts ¶ added in v1.5.0
func (_m *MockNetwork) UploadRawArtifacts(config JobCredentials, reader io.Reader, options ArtifactsOptions) UploadState
UploadRawArtifacts provides a mock function with given fields: config, reader, options
func (*MockNetwork) VerifyRunner ¶ added in v1.5.0
func (_m *MockNetwork) VerifyRunner(config RunnerCredentials) bool
VerifyRunner provides a mock function with given fields: config
type MockShell ¶ added in v1.5.0
MockShell is an autogenerated mock type for the Shell type
func (*MockShell) GenerateScript ¶ added in v1.5.0
func (_m *MockShell) GenerateScript(buildStage BuildStage, info ShellScriptInfo) (string, error)
GenerateScript provides a mock function with given fields: buildStage, info
func (*MockShell) GetConfiguration ¶ added in v1.5.0
func (_m *MockShell) GetConfiguration(info ShellScriptInfo) (*ShellConfiguration, error)
GetConfiguration provides a mock function with given fields: info
func (*MockShell) GetFeatures ¶ added in v1.5.0
func (_m *MockShell) GetFeatures(features *FeaturesInfo)
GetFeatures provides a mock function with given fields: features
type Network ¶
type Network interface { RegisterRunner(config RunnerCredentials, parameters RegisterRunnerParameters) *RegisterRunnerResponse VerifyRunner(config RunnerCredentials) bool UnregisterRunner(config RunnerCredentials) bool RequestJob(config RunnerConfig, sessionInfo *SessionInfo) (*JobResponse, bool) UpdateJob(config RunnerConfig, jobCredentials *JobCredentials, jobInfo UpdateJobInfo) UpdateState PatchTrace(config RunnerConfig, jobCredentials *JobCredentials, tracePart JobTracePatch) UpdateState DownloadArtifacts(config JobCredentials, artifactsFile string) DownloadState UploadRawArtifacts(config JobCredentials, reader io.Reader, options ArtifactsOptions) UploadState ProcessJob(config RunnerConfig, buildCredentials *JobCredentials) JobTrace }
type ParallelsConfig ¶
type ParallelsConfig struct { BaseName string `toml:"base_name" json:"base_name" long:"base-name" env:"PARALLELS_BASE_NAME" description:"VM name to be used"` TemplateName string `` /* 142-byte string literal not displayed */ DisableSnapshots bool `` /* 174-byte string literal not displayed */ TimeServer string `` /* 176-byte string literal not displayed */ }
type RegisterRunnerRequest ¶
type RegisterRunnerRequest struct { RegisterRunnerParameters Info VersionInfo `json:"info,omitempty"` Token string `json:"token,omitempty"` }
type RegisterRunnerResponse ¶
type RegisterRunnerResponse struct {
Token string `json:"token,omitempty"`
}
type RunnerConfig ¶
type RunnerConfig struct { Name string `toml:"name" json:"name" short:"name" long:"description" env:"RUNNER_NAME" description:"Runner name"` Limit int `` /* 130-byte string literal not displayed */ OutputLimit int `` /* 126-byte string literal not displayed */ RequestConcurrency int `` /* 146-byte string literal not displayed */ RunnerCredentials RunnerSettings }
func (*RunnerConfig) DeepCopy ¶
func (c *RunnerConfig) DeepCopy() (*RunnerConfig, error)
DeepCopy attempts to make a deep clone of the object
func (*RunnerConfig) GetRequestConcurrency ¶ added in v1.10.8
func (c *RunnerConfig) GetRequestConcurrency() int
func (*RunnerConfig) GetVariables ¶
func (c *RunnerConfig) GetVariables() JobVariables
func (*RunnerConfig) String ¶
func (c *RunnerConfig) String() string
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"` TLSCAFile string `` /* 177-byte string literal not displayed */ TLSCertFile string `` /* 181-byte string literal not displayed */ TLSKeyFile string `` /* 177-byte string literal not displayed */ }
func (*RunnerCredentials) GetTLSCAFile ¶
func (c *RunnerCredentials) GetTLSCAFile() string
func (*RunnerCredentials) GetTLSCertFile ¶
func (c *RunnerCredentials) GetTLSCertFile() string
func (*RunnerCredentials) GetTLSKeyFile ¶
func (c *RunnerCredentials) GetTLSKeyFile() string
func (*RunnerCredentials) GetToken ¶
func (c *RunnerCredentials) GetToken() string
func (*RunnerCredentials) GetURL ¶
func (c *RunnerCredentials) GetURL() string
func (*RunnerCredentials) Log ¶
func (c *RunnerCredentials) Log() *log.Entry
func (*RunnerCredentials) SameAs ¶
func (c *RunnerCredentials) SameAs(other *RunnerCredentials) bool
func (*RunnerCredentials) ShortDescription ¶
func (c *RunnerCredentials) ShortDescription() string
func (*RunnerCredentials) UniqueID ¶
func (c *RunnerCredentials) UniqueID() string
type RunnerInfo ¶
type RunnerInfo struct {
Timeout int `json:"timeout"`
}
type RunnerSettings ¶
type RunnerSettings struct { Executor string `` /* 140-byte string literal not displayed */ BuildsDir string `` /* 135-byte string literal not displayed */ CacheDir string `` /* 135-byte string literal not displayed */ CloneURL string `` /* 151-byte string literal not displayed */ Environment []string `` /* 148-byte string literal not displayed */ PreCloneScript string `` /* 187-byte string literal not displayed */ PreBuildScript string `` /* 214-byte string literal not displayed */ PostBuildScript string `` /* 220-byte string literal not displayed */ Shell string `toml:"shell,omitempty" json:"shell" long:"shell" env:"RUNNER_SHELL" description:"Select bash, cmd or powershell"` SSH *ssh.Config `toml:"ssh,omitempty" json:"ssh" group:"ssh executor" namespace:"ssh"` Docker *DockerConfig `toml:"docker,omitempty" json:"docker" group:"docker executor" namespace:"docker"` Parallels *ParallelsConfig `toml:"parallels,omitempty" json:"parallels" group:"parallels executor" namespace:"parallels"` VirtualBox *VirtualBoxConfig `toml:"virtualbox,omitempty" json:"virtualbox" group:"virtualbox executor" namespace:"virtualbox"` Cache *CacheConfig `toml:"cache,omitempty" json:"cache" group:"cache configuration" namespace:"cache"` Machine *DockerMachine `toml:"machine,omitempty" json:"machine" group:"docker machine provider" namespace:"machine"` Kubernetes *KubernetesConfig `toml:"kubernetes,omitempty" json:"kubernetes" group:"kubernetes executor" namespace:"kubernetes"` }
type SessionInfo ¶
type SessionServer ¶
type SessionServer struct { ListenAddress string `toml:"listen_address,omitempty" json:"listen_address" description:"Address that the runner will communicate directly with"` AdvertiseAddress string `` /* 150-byte string literal not displayed */ SessionTimeout int `` /* 147-byte string literal not displayed */ }
func (*SessionServer) GetSessionTimeout ¶
func (c *SessionServer) GetSessionTimeout() time.Duration
type Shell ¶
type Shell interface { GetName() string GetFeatures(features *FeaturesInfo) IsDefault() bool GetConfiguration(info ShellScriptInfo) (*ShellConfiguration, error) GenerateScript(buildStage BuildStage, info ShellScriptInfo) (string, error) }
type ShellConfiguration ¶ added in v1.3.0
type ShellConfiguration struct { Environment []string DockerCommand []string Command string Arguments []string PassFile bool Extension string }
func GetShellConfiguration ¶ added in v1.3.0
func GetShellConfiguration(info ShellScriptInfo) (*ShellConfiguration, error)
func (*ShellConfiguration) GetCommandWithArguments ¶ added in v1.3.0
func (s *ShellConfiguration) GetCommandWithArguments() []string
func (*ShellConfiguration) String ¶ added in v1.3.0
func (s *ShellConfiguration) String() string
type ShellScriptInfo ¶
type Step ¶
type Step struct { Name StepName `json:"name"` Script StepScript `json:"script"` Timeout int `json:"timeout"` When StepWhen `json:"when"` AllowFailure bool `json:"allow_failure"` }
type StepScript ¶
type StepScript []string
type SubmoduleStrategy ¶ added in v1.10.0
type SubmoduleStrategy int
const ( SubmoduleInvalid SubmoduleStrategy = iota SubmoduleNone SubmoduleNormal SubmoduleRecursive )
type Trace ¶ added in v1.4.0
type Trace struct { Writer io.Writer CancelFunc context.CancelFunc // contains filtered or unexported fields }
func (*Trace) Fail ¶ added in v1.4.0
func (s *Trace) Fail(err error, failureReason JobFailureReason)
func (*Trace) SetCancelFunc ¶
func (s *Trace) SetCancelFunc(cancelFunc context.CancelFunc)
func (*Trace) SetFailuresCollector ¶
func (s *Trace) SetFailuresCollector(fc FailuresCollector)
type UnregisterRunnerRequest ¶
type UnregisterRunnerRequest struct {
Token string `json:"token,omitempty"`
}
type UpdateJobInfo ¶
type UpdateJobInfo struct { ID int State JobState Trace *string FailureReason JobFailureReason }
type UpdateJobRequest ¶
type UpdateJobRequest struct { Info VersionInfo `json:"info,omitempty"` Token string `json:"token,omitempty"` State JobState `json:"state,omitempty"` FailureReason JobFailureReason `json:"failure_reason,omitempty"` Trace *string `json:"trace,omitempty"` }
type UpdateState ¶
type UpdateState int
const ( UpdateSucceeded UpdateState = iota UpdateNotFound UpdateAbort UpdateFailed UpdateRangeMismatch )
type UploadState ¶
type UploadState int
const ( UploadSucceeded UploadState = iota UploadTooLarge UploadForbidden UploadFailed )
type VerifyRunnerRequest ¶
type VerifyRunnerRequest struct {
Token string `json:"token,omitempty"`
}
type VersionInfo ¶
type VersionInfo struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Revision string `json:"revision,omitempty"` Platform string `json:"platform,omitempty"` Architecture string `json:"architecture,omitempty"` Executor string `json:"executor,omitempty"` Shell string `json:"shell,omitempty"` Features FeaturesInfo `json:"features"` }
type VirtualBoxConfig ¶
Source Files ¶
- build.go
- build_logger.go
- command.go
- config.go
- consts.go
- container.go
- executor.go
- mock_Commander.go
- mock_Executor.go
- mock_ExecutorData.go
- mock_ExecutorProvider.go
- mock_FailuresCollector.go
- mock_JobTrace.go
- mock_JobTracePatch.go
- mock_Network.go
- mock_Shell.go
- network.go
- shell.go
- support.go
- time.go
- trace.go
- variables.go
- version.go