-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.go
30 lines (26 loc) · 1.02 KB
/
provision.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package cli
import (
"github.com/cecotw/strut-cli/internal/app/product"
"github.com/cecotw/strut-cli/internal/pkg/provider"
"github.com/fatih/color"
"github.com/urfave/cli"
)
var provisionCmd = cli.Command{
Name: "provision",
Category: "Cloud",
Usage: "Provisions the defined infrastructure for the applications to the specified provider. Defaults to all applications deployed to all providers. Provision commands run concurrently. Specify a priority integer on dependencies to batch. The lowest number indicates highest priority. Resources with undefined priorities will run last in the final batch. Note - items with the same priority number will still be concurrent.",
ArgsUsage: "[applications] [providers]",
Action: provision,
}
func provision(c *cli.Context) error {
color.HiBlack("Provisioning...")
exists, ft := checkForProductFile()
if !exists {
color.Red(missingFileText)
return nil
}
pm := product.NewProductModel(ft)
product := pm.LoadProduct()
provider.Provision(product.ProvisionMap)
return nil
}