Skip to content

Commit

Permalink
Adds a default timeout of 8 hours for build (#194)
Browse files Browse the repository at this point in the history
* Adds a default timeout of 8 hours for build

* Update VERSION
  • Loading branch information
ehotinger authored Aug 8, 2018
1 parent 549cb48 commit e161650
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.0
v1.0.3
10 changes: 8 additions & 2 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ import (
"github.com/spf13/cobra"
)

const buildLongDesc = `
const (
buildLongDesc = `
This command can be used to build images.
`

// 8 hours
timeoutInSec = 60 * 60 * 8
)

type buildCmd struct {
out io.Writer
context string
Expand Down Expand Up @@ -128,7 +133,8 @@ func (b *buildCmd) run(cmd *cobra.Command, args []string) error {

taskManager := taskmanager.NewTaskManager(b.dryRun)
defaultStep := &graph.Step{
Run: rendered,
Run: rendered,
Timeout: timeoutInSec,
}

steps := []*graph.Step{defaultStep}
Expand Down
2 changes: 1 addition & 1 deletion graph/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (p *Pipeline) initialize() error {
for i, s := range p.Steps {
// If individual steps don't have step timeouts specified,
// stamp the global timeout on them.
if s.Timeout == 0 {
if s.Timeout <= 0 {
s.Timeout = p.StepTimeout
}

Expand Down

0 comments on commit e161650

Please sign in to comment.