mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-22 00:30:40 +00:00
revert godotenv.Load to main.go
This commit is contained in:
parent
22f9a710f1
commit
efe3702937
6
main.go
6
main.go
@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@ -125,6 +126,10 @@ func run(c *cli.Context) error {
|
||||
"Revision": revision,
|
||||
}).Info("Drone Terraform Plugin Version")
|
||||
|
||||
if c.String("env_file") != "" {
|
||||
_ = godotenv.Load(c.String("env_file"))
|
||||
}
|
||||
|
||||
var vars map[string]string
|
||||
if c.String("vars") != "" {
|
||||
if err := json.Unmarshal([]byte(c.String("vars")), &vars); err != nil {
|
||||
@ -157,7 +162,6 @@ func run(c *cli.Context) error {
|
||||
Parallelism: c.Int("parallelism"),
|
||||
Targets: c.StringSlice("targets"),
|
||||
VarFiles: c.StringSlice("var_files"),
|
||||
EnvFile: c.String("env_file"),
|
||||
TerraformDataDir: c.String("tf_data_dir"),
|
||||
},
|
||||
Netrc: Netrc{
|
||||
|
@ -16,7 +16,6 @@ import (
|
||||
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/sts"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
type (
|
||||
@ -34,7 +33,6 @@ type (
|
||||
Parallelism int
|
||||
Targets []string
|
||||
VarFiles []string
|
||||
EnvFile string
|
||||
TerraformDataDir string
|
||||
}
|
||||
|
||||
@ -79,10 +77,6 @@ func (p Plugin) Exec() error {
|
||||
}
|
||||
}
|
||||
|
||||
if p.Config.EnvFile != "" {
|
||||
_ = godotenv.Load(p.Config.EnvFile)
|
||||
}
|
||||
|
||||
if p.Config.RoleARN != "" {
|
||||
assumeRole(p.Config.RoleARN)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user