-
Notifications
You must be signed in to change notification settings - Fork 288
/
mode.go
36 lines (28 loc) · 850 Bytes
/
mode.go
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
package store
// Defines different executions modes for running Tilt,
// and deciding when to exit.
type EngineMode struct {
Name string
}
var (
// "up" is an interactive dev mode that watches files and resources.
EngineModeUp = EngineMode{}
// "apply" is a dev mode that builds and applies all resources,
// but doesn't wait to see if they come up.
EngineModeApply = EngineMode{Name: "apply"}
// "CI" is a mode that builds and applies all resources,
// waits until they come up, then exits.
EngineModeCI = EngineMode{Name: "ci"}
)
func (m EngineMode) WatchesFiles() bool {
return m == EngineModeUp
}
func (m EngineMode) WatchesRuntime() bool {
return m == EngineModeUp || m == EngineModeCI
}
func (m EngineMode) IsApplyMode() bool {
return m == EngineModeApply
}
func (m EngineMode) IsCIMode() bool {
return m == EngineModeCI
}