|
@ -77,7 +77,7 @@ func (p Plugin) Exec() error { |
|
|
commands = append(commands, initCommand(p.Config.InitOptions)) |
|
|
commands = append(commands, initCommand(p.Config.InitOptions)) |
|
|
|
|
|
|
|
|
commands = append(commands, getModules()) |
|
|
commands = append(commands, getModules()) |
|
|
commands = append(commands, validateCommand()) |
|
|
commands = append(commands, validateCommand(p.Config)) |
|
|
commands = append(commands, planCommand(p.Config)) |
|
|
commands = append(commands, planCommand(p.Config)) |
|
|
if !p.Config.Plan { |
|
|
if !p.Config.Plan { |
|
|
commands = append(commands, terraformCommand(p.Config)) |
|
|
commands = append(commands, terraformCommand(p.Config)) |
|
@ -173,10 +173,14 @@ func getModules() *exec.Cmd { |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func validateCommand() *exec.Cmd { |
|
|
func validateCommand(config Config) *exec.Cmd { |
|
|
args := []string{ |
|
|
args := []string{ |
|
|
"validate", |
|
|
"validate", |
|
|
} |
|
|
} |
|
|
|
|
|
for k, v := range config.Vars { |
|
|
|
|
|
args = append(args, "-var") |
|
|
|
|
|
args = append(args, fmt.Sprintf("%s=%s", k, v)) |
|
|
|
|
|
} |
|
|
return exec.Command( |
|
|
return exec.Command( |
|
|
"terraform", |
|
|
"terraform", |
|
|
args..., |
|
|
args..., |
|
|