New ๐ŸŒŠ wave for @helm

Commit b1d74d6a

b1d74d6a20c9Merged

zhiliaev <[email protected]> ยท 4 years ago ยท 4 files ยท ~4 modified

Description

auto build for up / down / rollback

Details

Commit
b1d74d6a20c9
Parent
1322fb53d755

pkg/action/down.gomodifiedView file

@@ -8,10 +8,19 @@
88 // Down is struct for running 'down' command.
99 type Down struct {
1010 plandir string
11+
12+ autoBuild bool
13+ build *Build
1114 }
1215
1316 // Run is main function for 'down' command.
1417 func (i *Down) Run() error {
18+ if i.autoBuild {
19+ if err := i.build.Run(); err != nil {
20+ return err
21+ }
22+ }
23+
1524 p := plan.New(i.plandir)
1625 if err := p.Import(); err != nil {
1726 return err
@@ -23,11 +32,20 @@
2332 // Cmd returns 'down' *cli.Command.
2433 func (i *Down) Cmd() *cli.Command {
2534 return &cli.Command{
26- Name: "down",
27- Usage: "๐Ÿ”ช Delete all",
28- Flags: []cli.Flag{
29- flagPlandir(&i.plandir),
30- },
35+ Name: "down",
36+ Usage: "๐Ÿ”ช Delete all",
37+ Flags: i.flags(),
3138 Action: toCtx(i.Run),
3239 }
3340 }
41+
42+func (i *Down) flags() []cli.Flag {
43+ // Init sub-structures
44+ i.build = &Build{}
45+
46+ self := []cli.Flag{
47+ flagAutoBuild(&i.autoBuild),
48+ }
49+
50+ return append(self, i.build.flags()...)
51+}