-
Notifications
You must be signed in to change notification settings - Fork 5
/
plis.go
90 lines (85 loc) · 2.05 KB
/
plis.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package main
import (
"os"
"github.com/IcaliaLabs/plis/cmd"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "Plis"
app.Usage = "Translates common development actions into docker/docker-compose commands by asking nicely"
app.Version = "0.0.0.build11"
app.Commands = []cli.Command{
{
Name: "start",
Usage: "Starts the project's containers",
Action: cmd.Start,
},
{
Name: "stop",
Usage: "Stop the project's running processes",
Action: cmd.Compose,
SkipFlagParsing: true,
},
{
Name: "restart",
Usage: "Restarts the project's running processes",
Action: cmd.Compose,
SkipFlagParsing: true,
},
{
Name: "attach",
Usage: "Attach the console to a running process",
Action: cmd.Attach,
SkipFlagParsing: true,
},
{
Name: "run",
Usage: "Runs a command in a running or new container of a particular service",
Action: cmd.Run,
SkipFlagParsing: true,
},
{
Name: "ps",
Usage: "Lists the project's running processes",
Action: cmd.Compose,
SkipFlagParsing: true,
},
{
Name: "rm",
Usage: "Removes the project's running processes",
Action: cmd.Compose,
SkipFlagParsing: true,
},
{
Name: "logs",
Usage: "Opens the logs of running processes",
Action: cmd.Compose,
SkipFlagParsing: true,
},
{
Name: "down",
Usage: "Stops and removes all containers",
Action: cmd.Compose,
SkipFlagParsing: true,
},
{
Name: "build",
Usage: "Build or rebuild services",
Action: cmd.Compose,
SkipFlagParsing: true,
},
{
Name: "check",
Usage: "Performs several checks inside your project",
Subcommands: []cli.Command{
{
Name: "context",
Usage: "Displays the project context",
Action: cmd.CheckContext,
},
},
},
}
app.Run(os.Args)
}