[ch3990] | Piyush | Lint the code
This commit is contained in:
56
main.go
56
main.go
@@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"github.com/urfave/cli/v2"
|
||||
"log"
|
||||
"io/ioutil"
|
||||
"encoding/json"
|
||||
"github.com/a8m/envsubst"
|
||||
"github.com/urfave/cli/v2"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -39,27 +39,27 @@ func parseManifest(manifestPath string) (*Manifest, error) {
|
||||
|
||||
func main() {
|
||||
app := &cli.App{
|
||||
Name: "infra-provisioner",
|
||||
Name: "infra-provisioner",
|
||||
Version: "0.0.1",
|
||||
|
||||
//Common flags for all subcommands
|
||||
Flags: []cli.Flag {
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "manifest",
|
||||
Usage: "Path of the manifest file",
|
||||
Aliases: []string{"m"},
|
||||
Name: "manifest",
|
||||
Usage: "Path of the manifest file",
|
||||
Aliases: []string{"m"},
|
||||
Required: true,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "template-only",
|
||||
Usage: "Provisions just the template for given resource",
|
||||
Name: "template-only",
|
||||
Usage: "Provisions just the template for given resource",
|
||||
Aliases: []string{"t"},
|
||||
},
|
||||
},
|
||||
|
||||
Commands: []*cli.Command{
|
||||
{
|
||||
Name: "database",
|
||||
Name: "database",
|
||||
Usage: "Provision database instance",
|
||||
Action: func(c *cli.Context) error {
|
||||
manifest, err := parseManifest(c.String("manifest"))
|
||||
@@ -76,22 +76,22 @@ func main() {
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "iam-roles",
|
||||
Usage: "Provision iam service roles",
|
||||
Action: func(c *cli.Context) error {
|
||||
manifest, err := parseManifest(c.String("manifest"))
|
||||
if err != nil {
|
||||
log.Fatalf("\nErr: %v", err)
|
||||
return err
|
||||
}
|
||||
err = provisionResource("roles", "aws-roles-tf", manifest, c.Bool("template-only"))
|
||||
if err != nil {
|
||||
log.Fatalf("\nErr: %v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
},
|
||||
Name: "iam-roles",
|
||||
Usage: "Provision iam service roles",
|
||||
Action: func(c *cli.Context) error {
|
||||
manifest, err := parseManifest(c.String("manifest"))
|
||||
if err != nil {
|
||||
log.Fatalf("\nErr: %v", err)
|
||||
return err
|
||||
}
|
||||
err = provisionResource("roles", "aws-roles-tf", manifest, c.Bool("template-only"))
|
||||
if err != nil {
|
||||
log.Fatalf("\nErr: %v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user