2016-04-20 01:37:53 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2017-03-16 10:14:02 +00:00
|
|
|
"fmt"
|
2016-04-20 01:37:53 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/drone/drone/drone/agent"
|
|
|
|
"github.com/drone/drone/version"
|
|
|
|
|
|
|
|
"github.com/ianschenck/envflag"
|
|
|
|
_ "github.com/joho/godotenv/autoload"
|
2017-03-16 10:14:02 +00:00
|
|
|
"github.com/urfave/cli"
|
2016-04-20 01:37:53 +00:00
|
|
|
)
|
|
|
|
|
2016-04-28 21:10:32 +00:00
|
|
|
func main() {
|
2016-04-20 01:37:53 +00:00
|
|
|
envflag.Parse()
|
|
|
|
|
|
|
|
app := cli.NewApp()
|
|
|
|
app.Name = "drone"
|
|
|
|
app.Version = version.Version
|
|
|
|
app.Usage = "command line utility"
|
2016-04-23 11:27:28 +00:00
|
|
|
app.Flags = []cli.Flag{
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "t, token",
|
|
|
|
Usage: "server auth token",
|
|
|
|
EnvVar: "DRONE_TOKEN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "s, server",
|
|
|
|
Usage: "server location",
|
|
|
|
EnvVar: "DRONE_SERVER",
|
|
|
|
},
|
|
|
|
}
|
2016-04-20 01:37:53 +00:00
|
|
|
app.Commands = []cli.Command{
|
|
|
|
agent.AgentCmd,
|
2016-05-06 17:59:36 +00:00
|
|
|
buildCmd,
|
|
|
|
deployCmd,
|
2016-05-10 05:57:57 +00:00
|
|
|
execCmd,
|
2016-05-06 17:59:36 +00:00
|
|
|
infoCmd,
|
|
|
|
secretCmd,
|
|
|
|
serverCmd,
|
|
|
|
signCmd,
|
|
|
|
repoCmd,
|
|
|
|
userCmd,
|
2016-07-31 20:09:55 +00:00
|
|
|
orgCmd,
|
2016-10-20 00:13:21 +00:00
|
|
|
globalCmd,
|
2016-04-20 01:37:53 +00:00
|
|
|
}
|
|
|
|
|
2017-03-16 10:14:02 +00:00
|
|
|
if err := app.Run(os.Args); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2016-04-20 01:37:53 +00:00
|
|
|
}
|