Skip to content

Commit e161650

Browse files
authored
Adds a default timeout of 8 hours for build (#194)
* Adds a default timeout of 8 hours for build * Update VERSION
1 parent 549cb48 commit e161650

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.0
1+
v1.0.3

cmd/build.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ import (
2323
"github.com/spf13/cobra"
2424
)
2525

26-
const buildLongDesc = `
26+
const (
27+
buildLongDesc = `
2728
This command can be used to build images.
2829
`
2930

31+
// 8 hours
32+
timeoutInSec = 60 * 60 * 8
33+
)
34+
3035
type buildCmd struct {
3136
out io.Writer
3237
context string
@@ -128,7 +133,8 @@ func (b *buildCmd) run(cmd *cobra.Command, args []string) error {
128133

129134
taskManager := taskmanager.NewTaskManager(b.dryRun)
130135
defaultStep := &graph.Step{
131-
Run: rendered,
136+
Run: rendered,
137+
Timeout: timeoutInSec,
132138
}
133139

134140
steps := []*graph.Step{defaultStep}

graph/pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func (p *Pipeline) initialize() error {
133133
for i, s := range p.Steps {
134134
// If individual steps don't have step timeouts specified,
135135
// stamp the global timeout on them.
136-
if s.Timeout == 0 {
136+
if s.Timeout <= 0 {
137137
s.Timeout = p.StepTimeout
138138
}
139139

0 commit comments

Comments
 (0)