-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
67 lines (63 loc) · 1.33 KB
/
main.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
package main
import (
"log"
"os"
"github.com/urfave/cli/v2"
"github.com/yuichiro12/envelope/cmd"
)
func main() {
app := &cli.App{
Commands: []*cli.Command{
{
Name: "list",
Usage: "list all parameters in aws parameter store with given prefix",
UsageText: "envelope list /Myservice/MyApp/Dev",
Action: cmd.List,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "region",
},
},
},
{
Name: "apply",
Usage: "apply .env to aws parameter store with given prefix and filepath",
UsageText: "envelope apply -f /path/to/.env /Myservice/MyApp/Dev",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "file",
Aliases: []string{"f"},
Required: true,
},
&cli.BoolFlag{
Name: "no-interactive",
Aliases: []string{"y"},
},
&cli.StringFlag{
Name: "region",
},
},
Action: cmd.Apply,
},
{
Name: "diff",
Usage: "show diff before applying .env",
UsageText: "envelope diff -f /path/to/.env /Myservice/MyApp/Dev",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "file",
Aliases: []string{"f"},
Required: true,
},
&cli.StringFlag{
Name: "region",
},
},
Action: cmd.Diff,
},
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}