/
step.go
72 lines (68 loc) · 1.72 KB
/
step.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
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
package demo
import "time"
const Pause = 3 * time.Second
type Step struct {
Narration string
Command string
ChangeBranch bool
CreateManifests bool
WaitForHealthy bool
WaitForBuildError bool
WaitForPodRestart bool
}
var steps = []Step{
Step{
Narration: "\t🚀 Launching demo... ",
},
Step{
Narration: "\t📚 git clone https://github.com/windmilleng/tiltdemo",
Command: "git clone https://github.com/windmilleng/tiltdemo $(pwd)",
},
Step{
Narration: "\t🌲 Changing branch",
ChangeBranch: true,
},
Step{
Narration: "\t🎂 Building and deploying demo server",
CreateManifests: true,
WaitForHealthy: true,
},
Step{
Narration: "\t🎉 Deployment success!",
},
Step{
Narration: "\t⚒️ Introducing build error on demoserver1",
Command: "sed -i -e 's!// \\(.*// tilt:BUILD_ERROR\\)!\\1!' cmd/demoserver1/main.go",
WaitForBuildError: true,
},
Step{
Narration: "\t😱 Oh no!",
},
Step{
Narration: "\t🚑 Fixing build error",
Command: "sed -i -e 's!^\\(.*// tilt:BUILD_ERROR\\)!// \\1!' cmd/demoserver1/main.go",
WaitForHealthy: true,
},
Step{
Narration: "\t😌 Whew! Back to normal...",
},
Step{
Narration: "\t⚒️ Introducing panic on demoserver1",
Command: "sed -i -e 's!// \\(.*// tilt:STARTUP_PANIC\\)!\\1!' cmd/demoserver1/main.go",
WaitForPodRestart: true,
},
Step{
Narration: "\t😱 Oh no!",
},
Step{
Narration: "\t🚒 Fixing panic",
Command: "sed -i -e 's!^\\(.*// tilt:STARTUP_PANIC\\)!// \\1!' cmd/demoserver1/main.go",
WaitForHealthy: true,
},
Step{
Narration: "\t😌 Whew! Back to normal...",
},
Step{
Narration: "\t😎 Demo Complete!",
},
}