0
0
mirror of https://github.com/thegeeklab/wp-opentofu.git synced 2024-11-24 13:20:39 +00:00

Merge pull request #34 from edwinavalos/add-validate

Implement validate command
This commit is contained in:
Jacob McCann 2017-01-30 10:15:46 -06:00 committed by GitHub
commit 2d3b9fd201

View File

@ -58,6 +58,7 @@ func (p Plugin) Exec() error {
commands = append(commands, remoteConfigCommand(remote)) commands = append(commands, remoteConfigCommand(remote))
} }
commands = append(commands, getModules()) commands = append(commands, getModules())
commands = append(commands, validateCommand())
commands = append(commands, planCommand(p.Config.Vars, p.Config.Secrets, p.Config.Parallelism, p.Config.Targets)) commands = append(commands, planCommand(p.Config.Vars, p.Config.Secrets, p.Config.Parallelism, p.Config.Targets))
if !p.Config.Plan { if !p.Config.Plan {
commands = append(commands, applyCommand(p.Config.Parallelism, p.Config.Targets)) commands = append(commands, applyCommand(p.Config.Parallelism, p.Config.Targets))
@ -135,6 +136,16 @@ func getModules() *exec.Cmd {
) )
} }
func validateCommand() *exec.Cmd {
args := []string{
"validate",
}
return exec.Command(
"terraform",
args...,
)
}
func planCommand(variables map[string]string, secrets map[string]string, parallelism int, targets []string) *exec.Cmd { func planCommand(variables map[string]string, secrets map[string]string, parallelism int, targets []string) *exec.Cmd {
args := []string{ args := []string{
"plan", "plan",