Versions in this module Expand all Collapse all v1 v1.0.0 Feb 20, 2018 Changes in this version + const AfterScriptTimeout + const CheckInterval + const DefaultArtifactDownloadAttempts + const DefaultCacheRequestTimeout + const DefaultExecTimeout + const DefaultGetSourcesAttempts + const DefaultMetricsServerPort + const DefaultNetworkClientTimeout + const DefaultOutputLimit + const DefaultRestoreCacheAttempts + const DefaultTimeout + const DefaultWaitForServicesTimeout + const ForceTraceSentInterval + const HealthCheckInterval + const HealthyChecks + const KubernetesPollInterval + const KubernetesPollTimeout + const NotHealthyCheckInterval + const PreparationRetries + const PullPolicyAlways + const PullPolicyIfNotPresent + const PullPolicyNever + const ReloadConfigInterval + const ShutdownTimeout + const UpdateInterval + const UpdateRetryInterval + var BRANCH = "HEAD" + var BUILT = "unknown" + var NAME = "gitlab-runner" + var PreparationRetryInterval = 3 * time.Second + var REVISION = "HEAD" + var VERSION = "development version" + 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 struct + Architecture string + Branch string + BuiltAt string + GOVersion string + Name string + OS string + Revision string + Version string + var AppVersion 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 + type Artifact struct + ExpireIn string + Name string + Paths ArtifactPaths + Untracked bool + When ArtifactWhen + func (a Artifact) ShouldUpload(state error) bool + type ArtifactPaths []string + type ArtifactWhen string + const ArtifactWhenAlways + const ArtifactWhenOnFailure + const ArtifactWhenOnSuccess + func (when ArtifactWhen) OnFailure() bool + func (when ArtifactWhen) OnSuccess() bool + type Artifacts []Artifact + type Build struct + BuildDir string + CacheDir string + CurrentStage BuildStage + CurrentState BuildRuntimeState + ExecutorData ExecutorData + ExecutorFeatures FeaturesInfo + Hostname string + ProjectRunnerID int + RootDir string + Runner *RunnerConfig + RunnerID int + SystemInterrupt chan os.Signal + func (b *Build) CurrentExecutorStage() ExecutorStage + 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) 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) IsDebugTraceEnabled() 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) Run(globalConfig *Config, trace JobTrace) (err error) + func (b *Build) StartBuild(rootDir, cacheDir string, sharedDir bool) + func (b *Build) String() string + type BuildError struct + Inner error + func (b *BuildError) Error() string + type BuildLogger struct + func NewBuildLogger(log JobTrace, entry *logrus.Entry) 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{}) + type BuildRuntimeState string + const BuildRunRuntimeCanceled + const BuildRunRuntimeFinished + const BuildRunRuntimeRunning + const BuildRunRuntimeTerminated + const BuildRunRuntimeTimedout + const BuildRunStatePending + type BuildStage string + const BuildStageAfterScript + const BuildStageArchiveCache + const BuildStageDownloadArtifacts + const BuildStageGetSources + const BuildStagePrepare + const BuildStageRestoreCache + const BuildStageUploadArtifacts + const BuildStageUserScript + type Cache struct + Key string + Paths ArtifactPaths + Policy CachePolicy + Untracked bool + func (c Cache) CheckPolicy(wanted CachePolicy) (bool, error) + type CacheConfig struct + AccessKey string + BucketLocation string + BucketName string + Insecure bool + Path string + SecretKey string + ServerAddress string + Shared bool + Type string + type CachePolicy string + const CachePolicyPull + const CachePolicyPullPush + const CachePolicyPush + const CachePolicyUndefined + type Caches []Cache + type Commander interface + Execute func(c *cli.Context) + type Config struct + CheckInterval int + Concurrent int + Loaded bool + LogLevel *string + MetricsServerAddress string + ModTime time.Time + Runners []*RunnerConfig + SentryDSN *string + User string + func NewConfig() *Config + func (c *Config) GetCheckInterval() time.Duration + func (c *Config) LoadConfig(configFile string) error + func (c *Config) SaveConfig(configFile string) error + func (c *Config) StatConfig(configFile string) error + type ContainerCommand []string + var ContainerCommandBuild ContainerCommand = []string{ ... } + type Credentials struct + Password string + Type string + URL string + Username string + type Dependencies []Dependency + type Dependency struct + ArtifactsFile DependencyArtifactsFile + ID int + Name string + Token string + type DependencyArtifactsFile struct + Filename string + Size int64 + type DockerConfig struct + AllowedImages []string + AllowedServices []string + CPUS string + CPUSetCPUs string + CacheDir string + CapAdd []string + CapDrop []string + DNS []string + DNSSearch []string + Devices []string + DisableCache bool + ExtraHosts []string + HelperImage string + Hostname string + Image string + Links []string + NetworkMode string + Privileged bool + PullPolicy DockerPullPolicy + Runtime string + SecurityOpt []string + Services []string + ServicesTmpfs map[string]string + ShmSize int64 + SysCtls DockerSysCtls + Tmpfs map[string]string + UsernsMode string + VolumeDriver string + Volumes []string + VolumesFrom []string + WaitForServicesTimeout int + func (c *DockerConfig) GetNanoCPUs() (int64, error) + type DockerMachine struct + IdleCount int + IdleTime int + MachineDriver string + MachineName string + MachineOptions []string + MaxBuilds int + OffPeakIdleCount int + OffPeakIdleTime int + OffPeakPeriods []string + OffPeakTimezone string + func (c *DockerMachine) CompileOffPeakPeriods() (err error) + func (c *DockerMachine) GetIdleCount() int + func (c *DockerMachine) GetIdleTime() int + type DockerPullPolicy string + func (p DockerPullPolicy) Get() (DockerPullPolicy, error) + type DockerSysCtls map[string]string + type DownloadState int + const DownloadFailed + const DownloadForbidden + const DownloadNotFound + const DownloadSucceeded + type Executor interface + Cleanup func() + Finish func(err error) + GetCurrentStage func() ExecutorStage + Prepare func(options ExecutorPrepareOptions) error + Run func(cmd ExecutorCommand) error + SetCurrentStage func(stage ExecutorStage) + Shell func() *ShellScriptInfo + func NewExecutor(executor string) Executor + type ExecutorCommand struct + Context context.Context + Predefined bool + Script string + type ExecutorData interface + type ExecutorPrepareOptions struct + Build *Build + Config *RunnerConfig + Context context.Context + Trace JobTrace + User string + type ExecutorProvider interface + Acquire func(config *RunnerConfig) (ExecutorData, error) + CanCreate func() bool + Create func() Executor + GetFeatures func(features *FeaturesInfo) + Release func(config *RunnerConfig, data ExecutorData) error + func GetExecutor(executor string) ExecutorProvider + func GetExecutorProviders() (providers []ExecutorProvider) + type ExecutorStage string + const ExecutorStageCleanup + const ExecutorStageCreated + const ExecutorStageFinish + const ExecutorStagePrepare + type FailuresCollector interface + RecordFailure func(reason JobFailureReason, runnerDescription string) + type FeaturesInfo struct + Artifacts bool + Cache bool + Image bool + Services bool + Shared bool + Variables bool + type GitInfo struct + BeforeSha string + Ref string + RefType GitInfoRefType + RepoURL string + Sha string + type GitInfoRefType string + const RefTypeBranch + const RefTypeTag + type GitStrategy int + const GitClone + const GitFetch + const GitNone + type GitlabFeatures struct + TraceSections bool + type Image struct + Alias string + Command []string + Entrypoint []string + Name string + type JobCredentials struct + ID int + TLSCAFile string + TLSCertFile string + TLSKeyFile string + Token string + URL string + func (j *JobCredentials) GetTLSCAFile() string + func (j *JobCredentials) GetTLSCertFile() string + func (j *JobCredentials) GetTLSKeyFile() string + func (j *JobCredentials) GetToken() string + func (j *JobCredentials) GetURL() string + type JobFailureReason string + const NoneFailure + const RunnerSystemFailure + const ScriptFailure + type JobInfo struct + Name string + ProjectID int + ProjectName string + Stage string + type JobRequest struct + Info VersionInfo + LastUpdate string + Token string + type JobResponse struct + AllowGitFetch bool + Artifacts Artifacts + Cache Caches + Credentials []Credentials + Dependencies Dependencies + Features GitlabFeatures + GitInfo GitInfo + ID int + Image Image + JobInfo JobInfo + RunnerInfo RunnerInfo + Services Services + Steps Steps + TLSAuthCert string + TLSAuthKey string + TLSCAChain string + Token string + Variables JobVariables + func GetFailedBuild() (JobResponse, error) + func GetLongRunningBuild() (JobResponse, error) + func GetMultilineBashBuild() (JobResponse, error) + func GetRemoteBrokenTLSBuild() (job JobResponse, err error) + func GetRemoteFailedBuild() (JobResponse, error) + func GetRemoteGitLabComTLSBuild() (job JobResponse, err error) + func GetRemoteLongRunningBuild() (JobResponse, error) + func GetRemoteSuccessfulBuild() (JobResponse, error) + func GetRemoteSuccessfulBuildWithAfterScript() (JobResponse, error) + func GetRemoteSuccessfulBuildWithDumpedVariables() (response JobResponse, err error) + func GetSuccessfulBuild() (JobResponse, error) + func (j *JobResponse) RepoCleanURL() string + type JobState string + const Failed + const Pending + const Running + const Success + type JobTrace interface + Fail func(err error, failureReason JobFailureReason) + IsStdout func() bool + SetCancelFunc func(cancelFunc context.CancelFunc) + SetFailuresCollector func(fc FailuresCollector) + Success func() + type JobTracePatch interface + Limit func() int + Offset func() int + Patch func() []byte + SetNewOffset func(newOffset int) + ValidateRange func() bool + type JobVariable struct + File bool + Internal bool + Key string + Public bool + Value string + func ParseVariable(text string) (variable JobVariable, err error) + func (b JobVariable) String() string + type JobVariables []JobVariable + func (b JobVariables) Expand() (variables JobVariables) + func (b JobVariables) ExpandValue(value string) string + func (b JobVariables) Get(key string) string + func (b JobVariables) PublicOrInternal() (variables JobVariables) + func (b JobVariables) StringList() (variables []string) + type KubernetesConfig struct + BearerToken string + BearerTokenOverwriteAllowed bool + CAFile string + CPULimit string + CPURequest string + CertFile string + HelperCPULimit string + HelperCPURequest string + HelperImage string + HelperMemoryLimit string + HelperMemoryRequest string + Host string + Image string + ImagePullSecrets []string + KeyFile string + MemoryLimit string + MemoryRequest string + Namespace string + NamespaceOverwriteAllowed string + NodeSelector map[string]string + PodAnnotations map[string]string + PodAnnotationsOverwriteAllowed string + PodLabels map[string]string + PollInterval int + PollTimeout int + Privileged bool + PullPolicy KubernetesPullPolicy + ServiceAccount string + ServiceAccountOverwriteAllowed string + ServiceCPULimit string + ServiceCPURequest string + ServiceMemoryLimit string + ServiceMemoryRequest string + TerminationGracePeriodSeconds int64 + Volumes KubernetesVolumes + func (c *KubernetesConfig) GetHelperImage() string + func (c *KubernetesConfig) GetPollAttempts() int + func (c *KubernetesConfig) GetPollInterval() int + type KubernetesConfigMap struct + Items map[string]string + MountPath string + Name string + ReadOnly bool + type KubernetesEmptyDir struct + Medium string + MountPath string + Name string + type KubernetesHostPath struct + HostPath string + MountPath string + Name string + ReadOnly bool + type KubernetesPVC struct + MountPath string + Name string + ReadOnly bool + type KubernetesPullPolicy string + func (p KubernetesPullPolicy) Get() (KubernetesPullPolicy, error) + type KubernetesSecret struct + Items map[string]string + MountPath string + Name string + ReadOnly bool + type KubernetesVolumes struct + ConfigMaps []KubernetesConfigMap + EmptyDirs []KubernetesEmptyDir + HostPaths []KubernetesHostPath + PVCs []KubernetesPVC + Secrets []KubernetesSecret + type MockCommander struct + func (_m *MockCommander) Execute(c *cli.Context) + type MockExecutor struct + 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 struct + type MockExecutorProvider struct + func (_m *MockExecutorProvider) Acquire(config *RunnerConfig) (ExecutorData, error) + func (_m *MockExecutorProvider) CanCreate() bool + func (_m *MockExecutorProvider) Create() Executor + func (_m *MockExecutorProvider) GetFeatures(features *FeaturesInfo) + func (_m *MockExecutorProvider) Release(config *RunnerConfig, data ExecutorData) error + type MockJobTrace struct + func (_m *MockJobTrace) Fail(err error, failureReason JobFailureReason) + func (_m *MockJobTrace) IsStdout() bool + func (_m *MockJobTrace) SetCancelFunc(cancelFunc context.CancelFunc) + func (_m *MockJobTrace) Success() + func (_m *MockJobTrace) Write(p []byte) (int, error) + type MockJobTracePatch struct + func (_m *MockJobTracePatch) Limit() int + func (_m *MockJobTracePatch) Offset() int + func (_m *MockJobTracePatch) Patch() []byte + func (_m *MockJobTracePatch) SetNewOffset(newOffset int) + func (_m *MockJobTracePatch) ValidateRange() bool + type MockNetwork struct + 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, description string, tags string, runUntagged bool, ...) *RegisterRunnerResponse + func (_m *MockNetwork) RequestJob(config RunnerConfig) (*JobResponse, bool) + func (_m *MockNetwork) UnregisterRunner(config RunnerCredentials) bool + func (_m *MockNetwork) UpdateJob(config RunnerConfig, jobCredentials *JobCredentials, jobInfo UpdateJobInfo) UpdateState + func (_m *MockNetwork) UploadArtifacts(config JobCredentials, artifactsFile string) UploadState + func (_m *MockNetwork) UploadRawArtifacts(config JobCredentials, reader io.Reader, baseName string, expireIn string) UploadState + func (_m *MockNetwork) VerifyRunner(config RunnerCredentials) bool + type MockShell struct + 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 interface + DownloadArtifacts func(config JobCredentials, artifactsFile string) DownloadState + PatchTrace func(config RunnerConfig, jobCredentials *JobCredentials, tracePart JobTracePatch) UpdateState + ProcessJob func(config RunnerConfig, buildCredentials *JobCredentials) JobTrace + RegisterRunner func(config RunnerCredentials, description, tags string, runUntagged, locked bool) *RegisterRunnerResponse + RequestJob func(config RunnerConfig) (*JobResponse, bool) + UnregisterRunner func(config RunnerCredentials) bool + UpdateJob func(config RunnerConfig, jobCredentials *JobCredentials, jobInfo UpdateJobInfo) UpdateState + UploadArtifacts func(config JobCredentials, artifactsFile string) UploadState + UploadRawArtifacts func(config JobCredentials, reader io.Reader, baseName string, expireIn string) UploadState + VerifyRunner func(config RunnerCredentials) bool + type ParallelsConfig struct + BaseName string + DisableSnapshots bool + TemplateName string + type RegisterRunnerRequest struct + Description string + Info VersionInfo + Locked bool + RunUntagged bool + Tags string + Token string + type RegisterRunnerResponse struct + Token string + type RunnerConfig struct + Limit int + Name string + OutputLimit int + RequestConcurrency int + func (c *RunnerConfig) GetRequestConcurrency() int + func (c *RunnerConfig) GetVariables() JobVariables + func (c *RunnerConfig) String() string + type RunnerCredentials struct + TLSCAFile string + TLSCertFile string + TLSKeyFile string + Token string + URL string + 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 struct + Timeout int + type RunnerSettings struct + BuildsDir string + Cache *CacheConfig + CacheDir string + CloneURL string + Docker *DockerConfig + Environment []string + Executor string + Kubernetes *KubernetesConfig + Machine *DockerMachine + Parallels *ParallelsConfig + PostBuildScript string + PreBuildScript string + PreCloneScript string + SSH *ssh.Config + Shell string + VirtualBox *VirtualBoxConfig + type Services []Image + type Shell interface + GenerateScript func(buildStage BuildStage, info ShellScriptInfo) (string, error) + GetConfiguration func(info ShellScriptInfo) (*ShellConfiguration, error) + GetFeatures func(features *FeaturesInfo) + GetName func() string + IsDefault func() bool + func GetShell(shell string) Shell + type ShellConfiguration struct + Arguments []string + Command string + DockerCommand []string + Environment []string + Extension string + PassFile bool + func GetShellConfiguration(info ShellScriptInfo) (*ShellConfiguration, error) + func (s *ShellConfiguration) GetCommandWithArguments() []string + func (s *ShellConfiguration) String() string + type ShellScriptInfo struct + Build *Build + PostBuildScript string + PreBuildScript string + PreCloneScript string + RunnerCommand string + Shell string + Type ShellType + User string + type ShellType int + const LoginShell + const NormalShell + type Step struct + AllowFailure bool + Name StepName + Script StepScript + Timeout int + When StepWhen + type StepName string + const StepNameAfterScript + const StepNameScript + type StepScript []string + type StepWhen string + const StepWhenAlways + const StepWhenOnFailure + const StepWhenOnSuccess + type Steps []Step + type SubmoduleStrategy int + const SubmoduleInvalid + const SubmoduleNone + const SubmoduleNormal + const SubmoduleRecursive + type Trace struct + CancelFunc context.CancelFunc + Writer io.Writer + 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) Success() + func (s *Trace) Write(p []byte) (n int, err error) + type UnregisterRunnerRequest struct + Token string + type UpdateJobInfo struct + FailureReason JobFailureReason + ID int + State JobState + Trace *string + type UpdateJobRequest struct + FailureReason JobFailureReason + Info VersionInfo + State JobState + Token string + Trace *string + type UpdateState int + const UpdateAbort + const UpdateFailed + const UpdateNotFound + const UpdateRangeMismatch + const UpdateSucceeded + type UploadState int + const UploadFailed + const UploadForbidden + const UploadSucceeded + const UploadTooLarge + type VerifyRunnerRequest struct + Token string + type VersionInfo struct + Architecture string + Executor string + Features FeaturesInfo + Name string + Platform string + Revision string + Version string + type VirtualBoxConfig struct + BaseName string + BaseSnapshot string + DisableSnapshots bool