Cleanup docker build output before saving (#23)

This commit is contained in:
2023-04-07 20:08:43 -06:00
parent 7f44e5ed41
commit e1382e50ea
2 changed files with 26 additions and 8 deletions
+25
View File
@@ -0,0 +1,25 @@
package pipeline_executor
import (
"bufio"
"encoding/json"
"io"
)
func cleanupBuildOutput(input io.ReadCloser) string {
output := ""
scanner := bufio.NewScanner(input)
for scanner.Scan() {
var log map[string]any
json.Unmarshal(scanner.Bytes(), &log)
if logVar, ok := log["stream"]; ok {
if log, ok := logVar.(string); ok {
output += log
}
}
}
return output
}