本文整理汇总了Golang中github.com/convox/rack/cmd/convox/stdcli.RegisterCommand函数的典型用法代码示例。如果您正苦于以下问题:Golang RegisterCommand函数的具体用法?Golang RegisterCommand怎么用?Golang RegisterCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RegisterCommand函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "start",
Description: "start an app for local development",
Usage: "[directory]",
Action: cmdStart,
Flags: []cli.Flag{
cli.StringFlag{
Name: "file, f",
Value: "docker-compose.yml",
Usage: "a file to use in place of docker-compose.yml",
},
cli.BoolFlag{
Name: "no-cache",
Usage: "Do not use Docker cache during build.",
},
},
})
stdcli.RegisterCommand(cli.Command{
Name: "init",
Description: "initialize an app for local development",
Usage: "[directory]",
Action: cmdInit,
})
}
示例2: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "start",
Description: "start an app for local development",
Usage: "[directory]",
Action: cmdStart,
Flags: []cli.Flag{
cli.StringFlag{
Name: "file, f",
Value: "docker-compose.yml",
Usage: "path to an alternate docker compose manifest file",
},
cli.BoolFlag{
Name: "no-cache",
Usage: "pull fresh image dependencies",
},
cli.BoolTFlag{
Name: "sync",
Usage: "synchronize local file changes into the running containers",
},
},
})
stdcli.RegisterCommand(cli.Command{
Name: "init",
Description: "initialize an app for local development",
Usage: "[directory]",
Action: cmdInit,
})
}
示例3: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "build",
Description: "create a new build",
Usage: "",
Action: cmdBuildsCreate,
Flags: buildCreateFlags,
})
stdcli.RegisterCommand(cli.Command{
Name: "builds",
Description: "manage an app's builds",
Usage: "",
Action: cmdBuilds,
Flags: []cli.Flag{appFlag, rackFlag},
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new build",
Usage: "",
Action: cmdBuildsCreate,
Flags: buildCreateFlags,
},
{
Name: "copy",
Description: "copy a build to an app",
Usage: "<ID> <app>",
Action: cmdBuildsCopy,
Flags: []cli.Flag{
appFlag,
rackFlag,
cli.BoolFlag{
Name: "promote",
Usage: "promote the release after copy",
},
},
},
{
Name: "info",
Description: "print output for a build",
Usage: "<ID>",
Action: cmdBuildsInfo,
Flags: []cli.Flag{appFlag, rackFlag},
},
{
Name: "delete",
Description: "Archive a build and its artifacts",
Usage: "<ID>",
Action: cmdBuildsDelete,
Flags: []cli.Flag{appFlag, rackFlag},
},
},
})
}
示例4: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "build",
Description: "create a new build",
Usage: "",
Action: cmdBuildsCreate,
Flags: []cli.Flag{
appFlag,
cli.BoolFlag{
Name: "no-cache",
Usage: "Do not use Docker cache during build.",
},
cli.StringFlag{
Name: "file, f",
Value: "docker-compose.yml",
Usage: "a file to use in place of docker-compose.yml",
},
},
})
stdcli.RegisterCommand(cli.Command{
Name: "builds",
Description: "manage an app's builds",
Usage: "",
Action: cmdBuilds,
Flags: []cli.Flag{appFlag},
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new build",
Usage: "",
Action: cmdBuildsCreate,
Flags: []cli.Flag{
appFlag,
cli.StringFlag{
Name: "file, f",
Value: "docker-compose.yml",
Usage: "a file to use in place of docker-compose.yml",
},
},
},
{
Name: "info",
Description: "print output for a build",
Usage: "<ID>",
Action: cmdBuildsInfo,
Flags: []cli.Flag{appFlag},
},
},
})
}
示例5: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "start",
Description: "start an app for local development",
Usage: "[directory]",
Action: cmdStart,
})
stdcli.RegisterCommand(cli.Command{
Name: "init",
Description: "initialize an app for local development",
Usage: "[directory]",
Action: cmdInit,
})
}
示例6: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "builds",
Description: "manage an app's builds",
Usage: "",
Action: cmdBuilds,
Flags: []cli.Flag{appFlag},
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new build",
Usage: "",
Action: cmdBuildsCreate,
Flags: []cli.Flag{appFlag},
},
{
Name: "info",
Description: "print output for a build",
Usage: "<ID>",
Action: cmdBuildsInfo,
Flags: []cli.Flag{appFlag},
},
},
})
}
示例7: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "env",
Description: "manage an app's environment variables",
Usage: "[get|set|unset]",
Action: cmdEnvList,
Flags: []cli.Flag{appFlag},
Subcommands: []cli.Command{
{
Name: "get",
Description: "get all environment variables",
Usage: "VARIABLE",
Action: cmdEnvGet,
Flags: []cli.Flag{appFlag},
},
{
Name: "set",
Description: "set an environment variable",
Usage: "VARIABLE=VALUE",
Action: cmdEnvSet,
Flags: []cli.Flag{appFlag},
},
{
Name: "unset",
Description: "delete an environment varible",
Usage: "VARIABLE",
Action: cmdEnvUnset,
Flags: []cli.Flag{appFlag},
},
},
})
}
示例8: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "doctor",
Action: cmdDoctor,
Description: "Check your app for common Convox compatibility issues.",
})
}
示例9: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "deploy",
Description: "deploy an app to AWS",
Usage: "<directory>",
Action: cmdDeploy,
Flags: []cli.Flag{
appFlag,
cli.BoolFlag{
Name: "no-cache",
Usage: "pull fresh image dependencies",
},
cli.BoolFlag{
Name: "incremental",
Usage: "use incremental build",
},
cli.StringFlag{
Name: "file, f",
Value: "docker-compose.yml",
Usage: "location of docker-compose.yml",
},
cli.StringFlag{
Name: "description",
Value: "",
Usage: "description of the build",
},
},
})
}
示例10: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "logs",
Description: "stream the logs for an application",
Usage: "",
Action: cmdLogsStream,
Flags: []cli.Flag{
appFlag,
rackFlag,
cli.StringFlag{
Name: "filter",
Usage: "filter the logs by a given token",
},
cli.BoolTFlag{
Name: "follow",
Usage: "keep streaming new log output (default)",
},
cli.DurationFlag{
Name: "since",
Usage: "show logs since a duration (e.g. 10m or 1h2m10s)",
Value: 2 * time.Minute,
},
},
})
}
示例11: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "scale",
Description: "scale an app's processes",
Usage: "<process> [--count=2] [--memory=256] [--cpu=256]",
Action: cmdScale,
Flags: []cli.Flag{
appFlag,
rackFlag,
cli.IntFlag{
Name: "count",
Usage: "Number of processes to keep running for specified process type.",
},
cli.IntFlag{
Name: "memory",
Usage: "Amount of memory, in MB, available to specified process type.",
},
cli.IntFlag{
Name: "cpu",
Usage: "CPU units available to specified process type.",
},
cli.BoolFlag{
Name: "wait",
Usage: "wait for app to finish scaling before returning",
},
},
})
}
示例12: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "ssl",
Action: cmdSSLList,
Description: "manage SSL certificates",
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new SSL listener",
Usage: "<port> <foo.crt> <foo.key>",
Action: cmdSSLCreate,
Flags: []cli.Flag{
appFlag,
},
},
{
Name: "delete",
Description: "delete an SSL listener",
Usage: "<port>",
Action: cmdSSLDelete,
Flags: []cli.Flag{
appFlag,
},
},
},
})
}
示例13: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "rack",
Description: "manage your Convox rack",
Usage: "",
Action: cmdRack,
Subcommands: []cli.Command{
{
Name: "update",
Description: "update rack to the latest version",
Usage: "[version]",
Action: cmdRackUpdate,
},
{
Name: "scale",
Description: "scale the rack capacity",
Usage: "",
Action: cmdRackScale,
Flags: []cli.Flag{
cli.IntFlag{
Name: "count",
Usage: "horizontally scale the instance count, e.g. 3 or 10",
},
cli.StringFlag{
Name: "type",
Usage: "vertically scale the instance type, e.g. t2.small or c3.xlargs",
},
},
},
},
})
}
示例14: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "instances",
Description: "list your Convox rack's instances",
Usage: "",
Action: cmdInstancesList,
Flags: []cli.Flag{rackFlag},
Subcommands: []cli.Command{
{
Name: "keyroll",
Description: "generate and replace the ec2 keypair used for SSH",
Usage: "",
Action: cmdInstancesKeyroll,
Flags: []cli.Flag{rackFlag},
},
{
Name: "ssh",
Description: "establish secure shell with EC2 instance",
Usage: "<id> [command]",
Action: cmdInstancesSSH,
Flags: []cli.Flag{rackFlag},
SkipFlagParsing: true,
},
{
Name: "terminate",
Description: "terminate an EC2 instance",
Usage: "<id>",
Flags: []cli.Flag{rackFlag},
Action: cmdInstancesTerminate,
},
},
})
}
示例15: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "services",
Description: "manage services",
Usage: "",
Action: cmdServices,
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new service",
Usage: "<type> <name>",
Action: cmdServiceCreate,
},
{
Name: "delete",
Description: "delete a service",
Usage: "<name>",
Action: cmdServiceDelete,
},
{
Name: "info",
Description: "info about a service",
Usage: "<name>",
Action: cmdServiceInfo,
},
},
})
}