-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsteer.go
More file actions
127 lines (122 loc) · 2.44 KB
/
steer.go
File metadata and controls
127 lines (122 loc) · 2.44 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package main
import (
"os"
"fmt"
"github.com/urfave/cli"
"github.com/fadion/steer/commands"
)
func main() {
app := cli.NewApp()
app.Name = "steer"
app.Usage = "deploy with git via ftp and ssh"
app.Authors = []cli.Author{{
Name: "Fadion Dashi",
Email: "jonidashi@gmail.com",
}}
app.Version = "0.4.1"
app.Commands = []cli.Command{
{
Name: "init",
Usage: "Create a template .steer file",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force",
Usage: "Override existing .steer file if it exists",
},
},
Action: commands.Init,
},
{
Name: "preview",
Usage: "Preview changed files",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "all",
Usage: "Preview all servers",
},
cli.StringFlag{
Name: "commit, c",
Usage: "Changes from `COMMIT`",
},
},
Action: commands.Preview,
},
{
Name: "deploy",
Usage: "Deploy to the server",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "fresh",
Usage: "Upload every file as it is a fresh deploy",
},
cli.BoolFlag{
Name: "all",
Usage: "Deploy to all servers",
},
cli.StringFlag{
Name: "commit, c",
Usage: "Changes from `COMMIT`",
},
cli.StringFlag{
Name: "message, m",
Usage: "`MESSAGE` for the log",
},
},
Action: commands.Deploy,
},
{
Name: "sync",
Usage: "Sync remote revision to current head",
Flags: []cli.Flag{
cli.StringFlag{
Name: "commit, c",
Usage: "Sync to `COMMIT` hash",
},
cli.BoolFlag{
Name: "all",
Usage: "Sync all servers",
},
},
Action: commands.Sync,
},
{
Name: "log",
Usage: "Get information from the remote log",
Flags: []cli.Flag{
cli.IntFlag{
Name: "latest",
Usage: "Get the latest `NUMBER` of lines",
},
cli.BoolFlag{
Name: "all",
Usage: "Get log info from all servers",
},
cli.BoolFlag{
Name: "clear",
Usage: "Clear the log",
},
},
Action: commands.Log,
},
{
Name: "status",
Usage: "Show server status",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "all",
Usage: "Status for all servers",
},
},
Action: commands.Status,
},
{
Name: "update",
Usage: "Update steer to the latest version",
Action: commands.Update,
},
}
app.CommandNotFound = func(ctx *cli.Context, command string) {
fmt.Fprintf(ctx.App.Writer, "Command %q doesn't exist.\n", command)
}
app.Run(os.Args)
}