예제 #1
0
파일: install.go 프로젝트: rjocoleman/cli
func init() {
	rand.Seed(time.Now().UTC().UnixNano())

	stdcli.RegisterCommand(cli.Command{
		Name:        "install",
		Description: "install convox into an aws account",
		Usage:       "",
		Action:      cmdInstall,
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "dedicated",
				Usage: "create EC2 instances on dedicated hardware",
			},
		},
	})

	stdcli.RegisterCommand(cli.Command{
		Name:        "uninstall",
		Description: "uninstall convox from an aws account",
		Usage:       "",
		Action:      cmdUninstall,
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "force",
				Usage: "uninstall even if apps exist",
			},
		},
	})
}
예제 #2
0
파일: install.go 프로젝트: apeckham/cli
func init() {
	rand.Seed(time.Now().UTC().UnixNano())

	stdcli.RegisterCommand(cli.Command{
		Name:        "install",
		Description: "install convox into an aws account",
		Usage:       "",
		Action:      cmdInstall,
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "dedicated",
				Usage: "create EC2 instances on dedicated hardware",
			},
			cli.IntFlag{
				Name:  "instance-count",
				Value: 3,
				Usage: "number of EC2 instances",
			},
			cli.StringFlag{
				Name:  "instance-type",
				Value: "t2.small",
				Usage: "type of EC2 instances",
			},
			cli.StringFlag{
				Name:   "region",
				Value:  "us-east-1",
				Usage:  "aws region to install in",
				EnvVar: "AWS_REGION",
			},
		},
	})

	stdcli.RegisterCommand(cli.Command{
		Name:        "uninstall",
		Description: "uninstall convox from an aws account",
		Usage:       "",
		Action:      cmdUninstall,
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "force",
				Usage: "uninstall even if apps exist",
			},
			cli.StringFlag{
				Name:   "region",
				Value:  "us-east-1",
				Usage:  "aws region to uninstall from",
				EnvVar: "AWS_REGION",
			},
		},
	})
}
예제 #3
0
파일: builds.go 프로젝트: noqcks/cli
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:      cmdBuild,
				Flags:       []cli.Flag{appFlag},
			},
			{
				Name:        "info",
				Description: "print output for a build",
				Usage:       "<ID>",
				Action:      cmdBuildsInfo,
				Flags:       []cli.Flag{appFlag},
			},
		},
	})
}
예제 #4
0
파일: env.go 프로젝트: nguyendangminh/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "env",
		Description: "manage an app's environment variables",
		Usage:       "get|set|unset",
		Action:      cmdEnvGetAll,
		Flags:       []cli.Flag{appFlag},
		Subcommands: []cli.Command{
			{
				Name:   "get",
				Usage:  "VARIABLE",
				Action: cmdEnvGet,
				Flags:  []cli.Flag{appFlag},
			},
			{
				Name:   "set",
				Usage:  "VARIABLE=VALUE",
				Action: cmdEnvSet,
				Flags:  []cli.Flag{appFlag},
			},
			{
				Name:   "unset",
				Usage:  "VARIABLE",
				Action: cmdEnvUnset,
				Flags:  []cli.Flag{appFlag},
			},
		},
	})
}
예제 #5
0
파일: system.go 프로젝트: ngotnghet/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "system",
		Description: "manage your Convox rack",
		Usage:       "",
		Action:      cmdSystem,
		Subcommands: []cli.Command{
			{
				Name:        "update",
				Description: "update rack to the latest version",
				Usage:       "[version]",
				Action:      cmdSystemUpdate,
			},
			{
				Name:        "scale",
				Description: "scale the rack capacity",
				Usage:       "",
				Action:      cmdSystemScale,
				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",
					},
				},
			},
		},
	})
}
예제 #6
0
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:       "<name> <postgres|redis>",
				Action:      cmdServiceCreate,
			},
			{
				Name:        "delete",
				Description: "delete a service",
				Usage:       "<name>",
				Action:      cmdServiceDelete,
			},
			{
				Name:        "info",
				Description: "info about a service",
				Usage:       "<name>",
				Action:      cmdServiceInfo,
			},
		},
	})
}
예제 #7
0
파일: apps.go 프로젝트: rjocoleman/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "apps",
		Action:      cmdApps,
		Description: "list deployed apps",
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "app name. If not specified, use current directory.",
			},
		},
		Subcommands: []cli.Command{
			{
				Name:        "create",
				Description: "create a new application",
				Usage:       "[name]",
				Action:      cmdAppCreate,
			},
			{
				Name:        "delete",
				Description: "delete an application",
				Usage:       "<name>",
				Action:      cmdAppDelete,
			},
		},
	})
}
예제 #8
0
파일: system.go 프로젝트: rjocoleman/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "system",
		Description: "manage the base convox system",
		Usage:       "",
		Action:      cmdSystem,
		Subcommands: []cli.Command{
			{
				Name:        "update",
				Description: "update the convox system API",
				Usage:       "<version>",
				Action:      cmdSystemUpate,
			},
			{
				Name:        "scale",
				Description: "scale the convox system cluster",
				Usage:       "",
				Action:      cmdSystemScale,
				Flags: []cli.Flag{
					cli.IntFlag{
						Name:  "count",
						Usage: "instance count, e.g. 3 or 10",
					},
					cli.StringFlag{
						Name:  "type",
						Usage: "instance type, e.g. t2.small or c3.xlargs",
					},
				},
			},
		},
	})
}
예제 #9
0
파일: apps.go 프로젝트: ngotnghet/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "apps",
		Action:      cmdApps,
		Description: "list deployed apps",
		Subcommands: []cli.Command{
			{
				Name:        "create",
				Description: "create a new application",
				Usage:       "[name]",
				Action:      cmdAppCreate,
			},
			{
				Name:        "delete",
				Description: "delete an application",
				Usage:       "[name]",
				Action:      cmdAppDelete,
			},
			{
				Name:        "info",
				Description: "see info about an app",
				Usage:       "[name]",
				Action:      cmdAppInfo,
			},
		},
	})
}
예제 #10
0
파일: releases.go 프로젝트: ngotnghet/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "releases",
		Description: "list an app's releases",
		Usage:       "",
		Action:      cmdReleases,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "App name. Inferred from current directory if not specified.",
			},
		},
		Subcommands: []cli.Command{
			{
				Name:        "promote",
				Description: "promote a release",
				Usage:       "<release id>",
				Action:      cmdReleasePromote,
				Flags: []cli.Flag{
					cli.StringFlag{
						Name:  "app",
						Usage: "app name. Inferred from current directory if not specified.",
					},
				},
			},
		},
	})
}
예제 #11
0
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "switch",
		Description: "switch to another convox rack",
		Usage:       "host",
		Action:      cmdSwitch,
	})
}
예제 #12
0
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "update",
		Description: "update the cli",
		Usage:       "",
		Action:      cmdUpdate,
	})
}
예제 #13
0
파일: top.go 프로젝트: 2opremio/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "top",
		Action:      cmdTop,
		Description: "resource utilization stats",
		Usage:       "",
	})
}
예제 #14
0
파일: start.go 프로젝트: nguyendangminh/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "start",
		Description: "start an app for local development",
		Usage:       "<directory>",
		Action:      cmdStart,
	})
}
예제 #15
0
파일: info.go 프로젝트: redbadger/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "info",
		Description: "see info about an app",
		Usage:       "[--app name]",
		Action:      cmdInfo,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "app name. Inferred from current directory if not specified.",
			},
		},
	})
}
예제 #16
0
파일: ps.go 프로젝트: oren/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "ps",
		Description: "list an app's processes",
		Usage:       "",
		Action:      cmdPs,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "app name. Inferred from current directory if not specified.",
			},
		},
	})
}
예제 #17
0
파일: exec.go 프로젝트: nguyendangminh/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "exec",
		Description: "exec a local process",
		Usage:       "ps cmd",
		Action:      cmdExec,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "app name. Inferred from current directory if not specified.",
			},
		},
	})
}
예제 #18
0
파일: logs.go 프로젝트: nguyendangminh/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "logs",
		Description: "stream the logs for an application",
		Usage:       "",
		Action:      cmdLogsStream,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "app name. Inferred from current directory if not specified.",
			},
		},
	})
}
예제 #19
0
파일: debug.go 프로젝트: ngotnghet/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "debug",
		Description: "get low-level system events for debugging purposes",
		Usage:       "",
		Action:      cmdDebug,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "App name. Inferred from current directory if not specified.",
			},
		},
	})
}
예제 #20
0
파일: exec.go 프로젝트: ngotnghet/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "exec",
		Description: "run a one-off command in a local Convox process",
		Usage:       "[process] [command]",
		Action:      cmdExec,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "App name. Inferred from current directory if not specified.",
			},
		},
	})
}
예제 #21
0
파일: deploy.go 프로젝트: noqcks/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "deploy",
		Description: "deploy an app to AWS",
		Usage:       "<directory>",
		Action:      cmdDeploy,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "App name. Inferred from current directory if not specified.",
			},
		},
	})
}
예제 #22
0
파일: run.go 프로젝트: noqcks/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "run",
		Description: "run a one-off command in your Convox rack",
		Usage:       "[process] [command]",
		Action:      cmdRun,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "App name. Inferred from current directory if not specified.",
			},
			cli.BoolFlag{
				Name:  "attach",
				Usage: "attach to an interactive session",
			},
		},
	})
}
예제 #23
0
파일: ps.go 프로젝트: ngotnghet/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "ps",
		Description: "list an app's processes",
		Usage:       "",
		Action:      cmdPs,
		Flags:       []cli.Flag{appFlag},
		Subcommands: []cli.Command{
			{
				Name:        "stop",
				Description: "stop a process",
				Usage:       "id",
				Action:      cmdPsStop,
				Flags:       []cli.Flag{appFlag},
			},
		},
	})
}
예제 #24
0
파일: scale.go 프로젝트: noqcks/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "scale",
		Description: "scale an app's processes",
		Usage:       "PROCESS [--count 2] [--memory 512]",
		Action:      cmdScale,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "App name. Inferred from current directory if not specified.",
			},
			cli.IntFlag{
				Name:  "count",
				Value: 1,
				Usage: "Number of processes to keep running for specified process type.",
			},
			cli.IntFlag{
				Name:  "memory",
				Value: 256,
				Usage: "Amount of memory, in MB, available to specified process type.",
			},
		},
	})
}
예제 #25
0
파일: login.go 프로젝트: ngotnghet/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "login",
		Description: "log into your convox rack",
		Usage:       "[hostname]",
		Action:      cmdLogin,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "password",
				Usage: "Password to use for authentication. If not specified, prompt for password.",
			},
		},
	})

	home, err := homedir.Dir()

	if err != nil {
		log.Fatal(err)
	}

	ConfigRoot = filepath.Join(home, ".convox")

	stat, err := os.Stat(ConfigRoot)

	if err != nil && !os.IsNotExist(err) {
		log.Fatal(err)
	}

	if stat != nil && !stat.IsDir() {
		err := upgradeConfig()

		if err != nil {
			log.Fatal(err)
		}
	}
}
예제 #26
0
파일: scale.go 프로젝트: nguyendangminh/cli
func init() {
	stdcli.RegisterCommand(cli.Command{
		Name:        "scale",
		Description: "scale an app's processes",
		Usage:       "",
		Action:      cmdScale,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "app",
				Usage: "app name. Inferred from current directory if not specified.",
			},
			cli.IntFlag{
				Name:  "count",
				Value: 1,
				Usage: "number of processes to keep running for every process type.",
			},
			cli.IntFlag{
				Name:  "memory",
				Value: 256,
				Usage: "amount of memory, in megabytes, available to every process.",
			},
		},
	})
}
예제 #27
0
파일: install.go 프로젝트: ngotnghet/cli
func init() {
	rand.Seed(time.Now().UTC().UnixNano())

	stdcli.RegisterCommand(cli.Command{
		Name:        "install",
		Description: "install convox into an aws account",
		Usage:       "",
		Action:      cmdInstall,
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "dedicated",
				Usage: "create EC2 instances on dedicated hardware",
			},
			cli.IntFlag{
				Name:  "instance-count",
				Value: 3,
				Usage: "number of EC2 instances",
			},
			cli.StringFlag{
				Name:  "instance-type",
				Value: "t2.small",
				Usage: "type of EC2 instances",
			},
			cli.StringFlag{
				Name:   "region",
				Value:  "us-east-1",
				Usage:  "aws region to install in",
				EnvVar: "AWS_REGION",
			},
			cli.StringFlag{
				Name:   "stack-name",
				EnvVar: "STACK_NAME",
				Value:  "convox",
				Usage:  "name of the CloudFormation stack",
			},
			cli.BoolFlag{
				Name:   "development",
				EnvVar: "DEVELOPMENT",
				Usage:  "create additional CloudFormation outputs to copy development .env file",
			},
			cli.StringFlag{
				Name:  "key",
				Usage: "name of an SSH keypair to install on EC2 instances",
			},
			cli.StringFlag{
				Name:   "version",
				EnvVar: "VERSION",
				Value:  "latest",
				Usage:  "release version in the format of '20150810161818', or 'latest' by default",
			},
		},
	})

	stdcli.RegisterCommand(cli.Command{
		Name:        "uninstall",
		Description: "uninstall convox from an aws account",
		Usage:       "",
		Action:      cmdUninstall,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:   "region",
				Value:  "us-east-1",
				Usage:  "aws region to uninstall from",
				EnvVar: "AWS_REGION",
			},
			cli.StringFlag{
				Name:   "stack-name",
				EnvVar: "STACK_NAME",
				Value:  "convox",
				Usage:  "name of the convox stack",
			},
		},
	})
}