-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflags.go
More file actions
101 lines (92 loc) · 2.8 KB
/
Copy pathflags.go
File metadata and controls
101 lines (92 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package cageapp
import (
"io"
"github.com/loilo-inc/canarycage/env"
"github.com/urfave/cli/v2"
)
type App struct {
CI bool
Stdin io.Reader
}
func RegionFlag(dest *string) *cli.StringFlag {
return &cli.StringFlag{
Name: "region",
EnvVars: []string{env.RegionKey},
Usage: "aws region for ecs. if not specified, try to load from aws sessions automatically",
Destination: dest,
Required: true,
}
}
func ClusterFlag(dest *string) *cli.StringFlag {
return &cli.StringFlag{
Name: "cluster",
EnvVars: []string{env.ClusterKey},
Usage: "ecs cluster name. if not specified, load from service.json",
Destination: dest,
}
}
func ServiceFlag(dest *string) *cli.StringFlag {
return &cli.StringFlag{
Name: "service",
EnvVars: []string{env.ServiceKey},
Usage: "service name. if not specified, load from service.json",
Destination: dest,
}
}
func TaskDefinitionArnFlag(dest *string) *cli.StringFlag {
return &cli.StringFlag{
Name: "taskDefinitionArn",
EnvVars: []string{env.TaskDefinitionArnKey},
Usage: "full arn or family:revision of task definition. if not specified, new task definition will be created based on task-definition.json",
Destination: dest,
}
}
func CanaryTaskIdleDurationFlag(dest *int) *cli.IntFlag {
return &cli.IntFlag{
Name: "canaryTaskIdleDuration",
EnvVars: []string{env.CanaryTaskIdleDuration},
Usage: "duration seconds for waiting canary task that isn't attached to target group considered as ready for serving traffic",
Destination: dest,
Value: 15,
}
}
func TaskRunningWaitFlag(dest *int) *cli.IntFlag {
return &cli.IntFlag{
Name: "taskRunningTimeout",
EnvVars: []string{env.TaskRunningTimeout},
Usage: "max duration seconds for waiting canary task running",
Destination: dest,
Category: "ADVANCED",
Value: 900, // 15 minutes
}
}
func TaskHealthCheckWaitFlag(dest *int) *cli.IntFlag {
return &cli.IntFlag{
Name: "taskHealthCheckTimeout",
EnvVars: []string{env.TaskHealthCheckTimeout},
Usage: "max duration seconds for waiting canary task health check",
Destination: dest,
Category: "ADVANCED",
Value: 900,
}
}
func TaskStoppedWaitFlag(dest *int) *cli.IntFlag {
return &cli.IntFlag{
Name: "taskStoppedTimeout",
EnvVars: []string{env.TaskStoppedTimeout},
Usage: "max duration seconds for waiting canary task stopped",
Destination: dest,
Category: "ADVANCED",
Value: 900,
}
}
func ServiceStableWaitFlag(dest *int) *cli.IntFlag {
return &cli.IntFlag{
Name: "serviceStableTimeout",
EnvVars: []string{env.ServiceStableTimeout},
Usage: "max duration seconds for waiting service stable",
Destination: dest,
Category: "ADVANCED",
Value: 900,
}
}