Skip to content
Snippets Groups Projects
Commit 06a425a5 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Allow to overwrite build log limit

parent 076477cf
No related branches found
No related tags found
No related merge requests found
v 0.4.0
- Added CI=true and GITLAB_CI=true to environment variables
- Added output_limit (in kilobytes) to runner config which allows to enlarge default build log size
- Make the debug log human readable
- Make default build log limit set to 4096 (4MB)
- Updated kardianos service to fix OSX service installation
- Updated logrus to make console output readable on Windows
- Change default log level to warning
......
......@@ -49,6 +49,7 @@ type RunnerConfig struct {
Shell *string `toml:"shell" json:"shell"`
DisableVerbose *bool `toml:"disable_verbose" json:"disable_verbose"`
OutputLimit *int `toml:"output_limit"`
SSH *ssh.Config `toml:"ssh" json:"ssh"`
Docker *DockerConfig `toml:"docker" json:"docker"`
......
......@@ -12,5 +12,5 @@ const HealthyChecks = 3
const HealthCheckInterval = 3600
const DefaultWaitForServicesTimeout = 30
const ShutdownTimeout = 30
const MaxTraceOutputSize = 1024 * 1024 // 1MB
const DefaultOutputLimit = 4096 // 4MB in kilobytes
const ForceTraceSentInterval time.Duration = 300
......@@ -30,6 +30,7 @@ This defines one runner entry.
| `builds_dir` | directory where builds will be stored in context of selected executor (Locally, Docker, SSH) |
| `environment` | append or overwrite environment variables |
| `disable_verbose` | don't print run commands |
| `output_limit` | set maximum build log size in kilobytes, by default set to 4096 (4MB) |
Example:
......
......@@ -32,6 +32,8 @@ func (e *AbstractExecutor) ReadTrace(pipe *io.PipeReader) {
defer e.Debugln("ReadTrace finished")
traceStopped := false
traceOutputLimit := helpers.NonZeroOrDefault(e.Config.OutputLimit, common.DefaultOutputLimit)
traceOutputLimit *= 1024
reader := bufio.NewReader(pipe)
for {
......@@ -48,8 +50,8 @@ func (e *AbstractExecutor) ReadTrace(pipe *io.PipeReader) {
continue
}
if e.Build.BuildLogLen() > common.MaxTraceOutputSize {
output := fmt.Sprintf("\nBuild log exceeded limit of %v bytes.", common.MaxTraceOutputSize)
if e.Build.BuildLogLen() > traceOutputLimit {
output := fmt.Sprintf("\nBuild log exceeded limit of %v bytes.", traceOutputLimit)
e.Build.WriteString(output)
traceStopped = true
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment