Remove `compose up` timeout

Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
aiordache 2020-07-27 16:23:46 +02:00 committed by Nicolas De Loof
parent cec3187bbb
commit 55531eb6b4
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
3 changed files with 13 additions and 6 deletions

View File

@ -3,6 +3,9 @@ package backend
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/compose-spec/compose-go/cli"
"github.com/compose-spec/compose-go/types"
@ -84,6 +87,15 @@ func (b *Backend) Up(ctx context.Context, options cli.ProjectOptions) error {
for k := range template.Resources {
w.ResourceEvent(k, "PENDING", "")
}
signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-signalChan
fmt.Println("user interrupted deployment. Deleting stack...")
b.Down(ctx, options)
}()
return b.WaitStackCompletion(ctx, project.Name, operation, w)
}

View File

@ -181,7 +181,7 @@ func (s sdk) CreateStack(ctx context.Context, name string, template *cf.Template
StackName: aws.String(name),
TemplateBody: aws.String(string(json)),
Parameters: param,
TimeoutInMinutes: aws.Int64(15),
TimeoutInMinutes: nil,
Capabilities: []*string{
aws.String(cloudformation.CapabilityCapabilityIam),
},

View File

@ -9,11 +9,6 @@ type StackResource struct {
Status string
}
type PortMapping struct {
Source int
Target int
}
type LoadBalancer struct {
URL string
TargetPort int