diff --git a/cli/app.go b/cli/app.go index c5b40b74..766b7a68 100644 --- a/cli/app.go +++ b/cli/app.go @@ -20,14 +20,15 @@ import ( var appNewCommand = &cli.Command{ Name: "new", - Usage: "Create a new app", + Usage: "Create a new app of ", Description: ` This command takes a recipe and uses it to cook up a new app. This 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 " to do so. -You can see what apps can be created by running "abra recipe ls". +You can see what apps can be created (i.e. values for the argument) by +running "abra recipe ls". Passing the "--secrets" flag will automatically generate secrets for your app and store them encrypted at rest on the chosen target server. These generated @@ -42,6 +43,30 @@ locally in a pass store (see passwordstore.org for more). PassFlag, SecretsFlag, }, + ArgsUsage: "", + Action: func(c *cli.Context) error { + appType := c.Args().First() + if appType == "" { + cli.ShowSubcommandHelp(c) + return nil + } + + // TODO: + // ensure ABRA_DIR exists + // get the apps_json + // get the servers list + // select latest version of recipe from apps_json + // prompt to choose server if not provided + // prompt to choose domain name if not provided + // prompt to choose app name if not provided + // convert name and truncate or error out if needed + // cp over env.sample and do some sed/replacing + // generate secrets if asked to do so + // save them in a pass store if asked to do so + // Output some instructions on how to deploy this thing + + return nil + }, } var appDeployCommand = &cli.Command{ Name: "deploy",