forked from toolshed/abra
		
	
		
			
				
	
	
		
			59 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package app
 | |
| 
 | |
| import (
 | |
| 	"fmt"
 | |
| 
 | |
| 	"coopcloud.tech/abra/cli/internal"
 | |
| 	"coopcloud.tech/abra/pkg/catalogue"
 | |
| 	"github.com/sirupsen/logrus"
 | |
| 	"github.com/urfave/cli/v2"
 | |
| )
 | |
| 
 | |
| var appNewDescription = `
 | |
| 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.
 | |
| 
 | |
| You can see what recipes are available (i.e. values for the <recipe> argument)
 | |
| by running "abra recipe ls".
 | |
| 
 | |
| Passing the "--secrets/-S" flag will automatically generate secrets for your
 | |
| app and store them encrypted at rest on the chosen target server. These
 | |
| generated secrets are only visible at generation time, so please take care to
 | |
| store them somewhere safe.
 | |
| 
 | |
| You can use the "--pass/-P" to store these generated passwords locally in a
 | |
| pass store (see passwordstore.org for more). The pass command must be available
 | |
| on your $PATH.
 | |
| `
 | |
| 
 | |
| var appNewCommand = &cli.Command{
 | |
| 	Name:        "new",
 | |
| 	Usage:       "Create a new app",
 | |
| 	Aliases:     []string{"n"},
 | |
| 	Description: appNewDescription,
 | |
| 	Flags: []cli.Flag{
 | |
| 		internal.NewAppServerFlag,
 | |
| 		internal.DomainFlag,
 | |
| 		internal.NewAppNameFlag,
 | |
| 		internal.PassFlag,
 | |
| 		internal.SecretsFlag,
 | |
| 	},
 | |
| 	ArgsUsage: "<recipe>",
 | |
| 	Action:    internal.NewAction,
 | |
| 	BashComplete: func(c *cli.Context) {
 | |
| 		catl, err := catalogue.ReadRecipeCatalogue()
 | |
| 		if err != nil {
 | |
| 			logrus.Warn(err)
 | |
| 		}
 | |
| 		if c.NArg() > 0 {
 | |
| 			return
 | |
| 		}
 | |
| 		for name := range catl {
 | |
| 			fmt.Println(name)
 | |
| 		}
 | |
| 	},
 | |
| }
 |