take OOMkill into consideration

This commit is contained in:
Brad Rydzewski 2016-01-22 12:01:23 -08:00
parent e70c11f06a
commit 807040abb5

View file

@ -1,6 +1,7 @@
package engine package engine
import ( import (
"fmt"
"io" "io"
"github.com/drone/drone/shared/docker" "github.com/drone/drone/shared/docker"
@ -66,6 +67,9 @@ func (w *worker) Build(name string, stdin []byte, pr bool) (_ int, err error) {
if err != nil { if err != nil {
return 1, err return 1, err
} }
if w.build.State.OOMKilled {
return 1, fmt.Sprintf("OOMKill received")
}
return w.build.State.ExitCode, err return w.build.State.ExitCode, err
} }