Пример #1
0
func DeploymentsAutoComplete(c *cli.Context) error {
	client := config.ScalingoClient()
	currentApp := appdetect.CurrentApp(c)

	deployments, err := client.DeploymentList(currentApp)
	if err != nil {
		return errgo.Mask(err, errgo.Any)
	}

	for _, deployment := range deployments {
		fmt.Println(deployment.ID)
	}

	return nil
}
Пример #2
0
Файл: run.go Проект: yannski/cli
   If you need to inject additional environment variables, you can use the flag
   '-e'. You can use it multiple time to define multiple variables. These
   variables will override those defined in your application environment.

   Example
     scalingo run -e VARIABLE=VALUE -e VARIABLE2=OTHER_VALUE rails console

   Furthermore, you may want to upload a file, like a database dump or anything
   useful to you. The option '-f' has been built for this purpose, you can even
   upload multiple files if you wish. You will be able to find these files in the
   '/tmp/uploads' directory of the one-off container.

   Example
     scalingo run -f mysqldump.sql rails dbconsole < /tmp/uploads/mysqldump.sql`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			opts := apps.RunOpts{
				App:    currentApp,
				Cmd:    c.Args(),
				CmdEnv: c.StringSlice("e"),
				Files:  c.StringSlice("f"),
			}
			if len(c.Args()) == 0 {
				cli.ShowCommandHelp(c, "run")
			} else if err := apps.Run(opts); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "run")
		},