forked from toolshed/abra
		
	refactor!: app name -> domain
This commit is contained in:
		@ -8,7 +8,7 @@ var AppCommand = cli.Command{
 | 
			
		||||
	Name:        "app",
 | 
			
		||||
	Aliases:     []string{"a"},
 | 
			
		||||
	Usage:       "Manage apps",
 | 
			
		||||
	ArgsUsage:   "<app>",
 | 
			
		||||
	ArgsUsage:   "<domain>",
 | 
			
		||||
	Description: "This command provides functionality for managing the life cycle of your apps",
 | 
			
		||||
	Subcommands: []cli.Command{
 | 
			
		||||
		appNewCommand,
 | 
			
		||||
 | 
			
		||||
@ -16,7 +16,7 @@ var appCheckCommand = cli.Command{
 | 
			
		||||
	Name:      "check",
 | 
			
		||||
	Aliases:   []string{"c"},
 | 
			
		||||
	Usage:     "Check if app is configured correctly",
 | 
			
		||||
	ArgsUsage: "<service>",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
 | 
			
		||||
@ -14,9 +14,10 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var appConfigCommand = cli.Command{
 | 
			
		||||
	Name:    "config",
 | 
			
		||||
	Aliases: []string{"c"},
 | 
			
		||||
	Usage:   "Edit app config",
 | 
			
		||||
	Name:      "config",
 | 
			
		||||
	Aliases:   []string{"c"},
 | 
			
		||||
	Usage:     "Edit app config",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@ import (
 | 
			
		||||
var appCpCommand = cli.Command{
 | 
			
		||||
	Name:      "cp",
 | 
			
		||||
	Aliases:   []string{"c"},
 | 
			
		||||
	ArgsUsage: "<src> <dst>",
 | 
			
		||||
	ArgsUsage: "<domain> <src> <dst>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
@ -34,11 +34,11 @@ This command supports copying files to and from any app service file system.
 | 
			
		||||
 | 
			
		||||
If you want to copy a myfile.txt to the root of the app service:
 | 
			
		||||
 | 
			
		||||
    abra app cp <app> myfile.txt app:/
 | 
			
		||||
    abra app cp <domain> myfile.txt app:/
 | 
			
		||||
 | 
			
		||||
And if you want to copy that file back to your current working directory locally:
 | 
			
		||||
 | 
			
		||||
		abra app cp <app> app:/myfile.txt .
 | 
			
		||||
		abra app cp <domain> app:/myfile.txt .
 | 
			
		||||
 | 
			
		||||
`,
 | 
			
		||||
	Action: func(c *cli.Context) error {
 | 
			
		||||
 | 
			
		||||
@ -7,9 +7,10 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var appDeployCommand = cli.Command{
 | 
			
		||||
	Name:    "deploy",
 | 
			
		||||
	Aliases: []string{"d"},
 | 
			
		||||
	Usage:   "Deploy an app",
 | 
			
		||||
	Name:      "deploy",
 | 
			
		||||
	Aliases:   []string{"d"},
 | 
			
		||||
	Usage:     "Deploy an app",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
@ -21,7 +22,7 @@ var appDeployCommand = cli.Command{
 | 
			
		||||
	Before: internal.SubCommandBefore,
 | 
			
		||||
	Description: `
 | 
			
		||||
This command deploys an app. It does not support incrementing the version of a
 | 
			
		||||
deployed app, for this you need to look at the "abra app upgrade <app>"
 | 
			
		||||
deployed app, for this you need to look at the "abra app upgrade <domain>"
 | 
			
		||||
command.
 | 
			
		||||
 | 
			
		||||
You may pass "--force" to re-deploy the same version again. This can be useful
 | 
			
		||||
 | 
			
		||||
@ -20,8 +20,9 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var appErrorsCommand = cli.Command{
 | 
			
		||||
	Name:  "errors",
 | 
			
		||||
	Usage: "List errors for a deployed app",
 | 
			
		||||
	Name:      "errors",
 | 
			
		||||
	Usage:     "List errors for a deployed app",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Description: `
 | 
			
		||||
This command lists errors for a deployed app.
 | 
			
		||||
 | 
			
		||||
@ -40,7 +41,7 @@ Got any more ideas? Please let us know:
 | 
			
		||||
 | 
			
		||||
    https://git.coopcloud.tech/coop-cloud/organising/issues/new/choose
 | 
			
		||||
 | 
			
		||||
This command is best accompanied by "abra app logs <app>" which may reveal
 | 
			
		||||
This command is best accompanied by "abra app logs <domain>" which may reveal
 | 
			
		||||
further information which can help you debug the cause of an app failure via
 | 
			
		||||
the logs.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -216,7 +216,7 @@ can take some time.
 | 
			
		||||
 | 
			
		||||
			serverStat := allStats[app.Server]
 | 
			
		||||
 | 
			
		||||
			tableCol := []string{"recipe", "domain", "app name"}
 | 
			
		||||
			tableCol := []string{"recipe", "domain"}
 | 
			
		||||
			if status {
 | 
			
		||||
				tableCol = append(tableCol, []string{"status", "version", "upgrade"}...)
 | 
			
		||||
			}
 | 
			
		||||
@ -224,7 +224,7 @@ can take some time.
 | 
			
		||||
			table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
			for _, appStat := range serverStat.apps {
 | 
			
		||||
				tableRow := []string{appStat.recipe, appStat.domain, appStat.appName}
 | 
			
		||||
				tableRow := []string{appStat.recipe, appStat.domain}
 | 
			
		||||
				if status {
 | 
			
		||||
					tableRow = append(tableRow, []string{appStat.status, appStat.version, appStat.upgrade}...)
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
@ -67,7 +67,7 @@ func stackLogs(c *cli.Context, stackName string, client *dockerClient.Client) {
 | 
			
		||||
var appLogsCommand = cli.Command{
 | 
			
		||||
	Name:      "logs",
 | 
			
		||||
	Aliases:   []string{"l"},
 | 
			
		||||
	ArgsUsage: "[<service>]",
 | 
			
		||||
	ArgsUsage: "<domain> [<service>]",
 | 
			
		||||
	Usage:     "Tail app logs",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.StdErrOnlyFlag,
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@ This command takes a recipe and uses it to create a new app. This new app
 | 
			
		||||
configuration is stored in your ~/.abra directory under the appropriate server.
 | 
			
		||||
 | 
			
		||||
This command does not deploy your app for you. You will need to run "abra app
 | 
			
		||||
deploy <app>" to do so.
 | 
			
		||||
deploy <domain>" to do so.
 | 
			
		||||
 | 
			
		||||
You can see what recipes are available (i.e. values for the <recipe> argument)
 | 
			
		||||
by running "abra recipe ls".
 | 
			
		||||
@ -36,12 +36,11 @@ var appNewCommand = cli.Command{
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
		internal.NewAppServerFlag,
 | 
			
		||||
		internal.DomainFlag,
 | 
			
		||||
		internal.NewAppNameFlag,
 | 
			
		||||
		internal.PassFlag,
 | 
			
		||||
		internal.SecretsFlag,
 | 
			
		||||
	},
 | 
			
		||||
	Before:       internal.SubCommandBefore,
 | 
			
		||||
	ArgsUsage:    "<recipe>",
 | 
			
		||||
	ArgsUsage:    "[<recipe>]",
 | 
			
		||||
	Action:       internal.NewAction,
 | 
			
		||||
	BashComplete: autocomplete.RecipeNameComplete,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -25,6 +25,7 @@ var appPsCommand = cli.Command{
 | 
			
		||||
	Name:        "ps",
 | 
			
		||||
	Aliases:     []string{"p"},
 | 
			
		||||
	Usage:       "Check app status",
 | 
			
		||||
	ArgsUsage:   "<domain>",
 | 
			
		||||
	Description: "This command shows a more detailed status output of a specific deployed app.",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.WatchFlag,
 | 
			
		||||
 | 
			
		||||
@ -26,9 +26,10 @@ var VolumesFlag = &cli.BoolFlag{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var appRemoveCommand = cli.Command{
 | 
			
		||||
	Name:    "remove",
 | 
			
		||||
	Aliases: []string{"rm"},
 | 
			
		||||
	Usage:   "Remove an already undeployed app",
 | 
			
		||||
	Name:      "remove",
 | 
			
		||||
	Aliases:   []string{"rm"},
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Usage:     "Remove an already undeployed app",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		VolumesFlag,
 | 
			
		||||
		internal.ForceFlag,
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,7 @@ var appRestartCommand = cli.Command{
 | 
			
		||||
	Name:      "restart",
 | 
			
		||||
	Aliases:   []string{"re"},
 | 
			
		||||
	Usage:     "Restart an app",
 | 
			
		||||
	ArgsUsage: "<service>",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@ var appRollbackCommand = cli.Command{
 | 
			
		||||
	Name:      "rollback",
 | 
			
		||||
	Aliases:   []string{"rl"},
 | 
			
		||||
	Usage:     "Roll an app back to a previous version",
 | 
			
		||||
	ArgsUsage: "<app>",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
 | 
			
		||||
@ -40,7 +40,7 @@ var appRunCommand = cli.Command{
 | 
			
		||||
		userFlag,
 | 
			
		||||
	},
 | 
			
		||||
	Before:       internal.SubCommandBefore,
 | 
			
		||||
	ArgsUsage:    "<service> <args>...",
 | 
			
		||||
	ArgsUsage:    "<domain> <service> <args>...",
 | 
			
		||||
	Usage:        "Run a command in a service container",
 | 
			
		||||
	BashComplete: autocomplete.AppNameComplete,
 | 
			
		||||
	Action: func(c *cli.Context) error {
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,7 @@ var appSecretGenerateCommand = cli.Command{
 | 
			
		||||
	Name:      "generate",
 | 
			
		||||
	Aliases:   []string{"g"},
 | 
			
		||||
	Usage:     "Generate secrets",
 | 
			
		||||
	ArgsUsage: "<secret> <version>",
 | 
			
		||||
	ArgsUsage: "<domain> <secret> <version>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
@ -109,7 +109,7 @@ var appSecretInsertCommand = cli.Command{
 | 
			
		||||
		internal.PassFlag,
 | 
			
		||||
	},
 | 
			
		||||
	Before:       internal.SubCommandBefore,
 | 
			
		||||
	ArgsUsage:    "<app> <secret-name> <version> <data>",
 | 
			
		||||
	ArgsUsage:    "<domain> <secret-name> <version> <data>",
 | 
			
		||||
	BashComplete: autocomplete.AppNameComplete,
 | 
			
		||||
	Description: `
 | 
			
		||||
This command inserts a secret into an app environment.
 | 
			
		||||
@ -159,7 +159,7 @@ var appSecretRmCommand = cli.Command{
 | 
			
		||||
		allSecretsFlag, internal.PassFlag,
 | 
			
		||||
	},
 | 
			
		||||
	Before:       internal.SubCommandBefore,
 | 
			
		||||
	ArgsUsage:    "<app> <secret-name>",
 | 
			
		||||
	ArgsUsage:    "<domain> <secret-name>",
 | 
			
		||||
	BashComplete: autocomplete.AppNameComplete,
 | 
			
		||||
	Description: `
 | 
			
		||||
This command removes a secret from an app environment.
 | 
			
		||||
@ -295,7 +295,7 @@ var appSecretCommand = cli.Command{
 | 
			
		||||
	Name:      "secret",
 | 
			
		||||
	Aliases:   []string{"s"},
 | 
			
		||||
	Usage:     "Manage app secrets",
 | 
			
		||||
	ArgsUsage: "<command>",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Subcommands: []cli.Command{
 | 
			
		||||
		appSecretGenerateCommand,
 | 
			
		||||
		appSecretInsertCommand,
 | 
			
		||||
 | 
			
		||||
@ -12,8 +12,9 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var appUndeployCommand = cli.Command{
 | 
			
		||||
	Name:    "undeploy",
 | 
			
		||||
	Aliases: []string{"un"},
 | 
			
		||||
	Name:      "undeploy",
 | 
			
		||||
	Aliases:   []string{"un"},
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
 | 
			
		||||
@ -21,7 +21,7 @@ var appUpgradeCommand = cli.Command{
 | 
			
		||||
	Name:      "upgrade",
 | 
			
		||||
	Aliases:   []string{"up"},
 | 
			
		||||
	Usage:     "Upgrade an app",
 | 
			
		||||
	ArgsUsage: "<app>",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
@ -35,7 +35,7 @@ This command supports upgrading an app. You can use it to choose and roll out a
 | 
			
		||||
new upgrade to an existing app.
 | 
			
		||||
 | 
			
		||||
This command specifically supports incrementing the version of running apps, as
 | 
			
		||||
opposed to "abra app deploy <app>" which will not change the version of a
 | 
			
		||||
opposed to "abra app deploy <domain>" which will not change the version of a
 | 
			
		||||
deployed app.
 | 
			
		||||
 | 
			
		||||
You may pass "--force/-f" to upgrade to the same version again. This can be
 | 
			
		||||
 | 
			
		||||
@ -31,8 +31,9 @@ func getImagePath(image string) (string, error) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var appVersionCommand = cli.Command{
 | 
			
		||||
	Name:    "version",
 | 
			
		||||
	Aliases: []string{"v"},
 | 
			
		||||
	Name:      "version",
 | 
			
		||||
	Aliases:   []string{"v"},
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
 | 
			
		||||
@ -13,8 +13,9 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var appVolumeListCommand = cli.Command{
 | 
			
		||||
	Name:    "list",
 | 
			
		||||
	Aliases: []string{"ls"},
 | 
			
		||||
	Name:      "list",
 | 
			
		||||
	Aliases:   []string{"ls"},
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
		internal.NoInputFlag,
 | 
			
		||||
@ -58,7 +59,7 @@ var appVolumeRemoveCommand = cli.Command{
 | 
			
		||||
	Description: `
 | 
			
		||||
This command supports removing volumes associated with an app. The app in
 | 
			
		||||
question must be undeployed before you try to remove volumes. See "abra app
 | 
			
		||||
undeploy <app>" for more.
 | 
			
		||||
undeploy <domain>" for more.
 | 
			
		||||
 | 
			
		||||
The command is interactive and will show a multiple select input which allows
 | 
			
		||||
you to make a seclection. Use the "?" key to see more help on navigating this
 | 
			
		||||
@ -66,7 +67,7 @@ interface.
 | 
			
		||||
 | 
			
		||||
Passing "--force" will select all volumes for removal. Be careful.
 | 
			
		||||
`,
 | 
			
		||||
	ArgsUsage: "<app>",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Aliases:   []string{"rm"},
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		internal.DebugFlag,
 | 
			
		||||
@ -115,7 +116,7 @@ var appVolumeCommand = cli.Command{
 | 
			
		||||
	Name:      "volume",
 | 
			
		||||
	Aliases:   []string{"vl"},
 | 
			
		||||
	Usage:     "Manage app volumes",
 | 
			
		||||
	ArgsUsage: "<command>",
 | 
			
		||||
	ArgsUsage: "<domain>",
 | 
			
		||||
	Subcommands: []cli.Command{
 | 
			
		||||
		appVolumeListCommand,
 | 
			
		||||
		appVolumeRemoveCommand,
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user