Skip to content

Commit

Permalink
feat: add support for v7 app creations
Browse files Browse the repository at this point in the history
v7 is also the default version now for newly created apps.
  • Loading branch information
siddharthlatest committed Dec 7, 2019
1 parent 2a84313 commit 83e8866
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cmd/abc/appbase_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ func runApp(args []string) error {
// runCreate runs `create` command
func runCreate(args []string) error {
flagset := baseFlagSet("create")
basicUsage := "abc create [--es2|--es6] [--category=category] [--cluster|-c] [--interactive|-i] [--loc] [--vmsize] [--plan] [--ssh] [--provider] [--nodes] [--version] [--volume] AppName|ClusterName"
basicUsage := "abc create [--es7|--es6|--es5] [--category=category] [--cluster|-c] [--interactive|-i] [--loc] [--vmsize] [--plan] [--ssh] [--provider] [--nodes] [--version] [--volume] AppName|ClusterName"
flagset.Usage = usageFor(flagset, basicUsage)
// https://gobyexample.com/command-line-flags
isEs7 := flagset.Bool("es7", true, "is app es7")
isEs6 := flagset.Bool("es6", false, "is app es6")
isEs2 := flagset.Bool("es2", true, "is app es2")
isEs5 := flagset.Bool("es5", false, "is app es5")
category := flagset.String("category", "generic", "category for app")

// Cluster specific flags
Expand Down Expand Up @@ -105,11 +106,13 @@ func runCreate(args []string) error {
}
} else if *isEs6 {
return app.RunAppCreate(args[0], "6", *category)
} else if *isEs2 {
return app.RunAppCreate(args[0], "2", *category)
} else if *isEs5 {
return app.RunAppCreate(args[0], "5", *category)
} else if *isEs7 {
return app.RunAppCreate(args[0], "7", *category)
} else {
fmt.Println("App needs to be ES2 or ES6")
return nil
fmt.Println("Creating an ElasticSearch v7 app")
return app.RunAppCreate(args[0], "7", *category)
}
}
showShortHelp(basicUsage)
Expand Down

0 comments on commit 83e8866

Please sign in to comment.