boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
674 stars 46 forks source link

Terraspace hooks doesn't work #304

Closed arongate closed 1 year ago

arongate commented 1 year ago

Checklist

My Environment

Software Version
Operating System Ubuntu 22.04.2 LTS
Terraform v1.4.6
Terraspace 2.2.6
Ruby 3.0.3p157

Expected Behaviour

Run terraform.rb script with Terraspace hook bound on build command.

Current Behavior

Defined terraspace hooks on build command but they are not executed.

Step-by-step reproduction instructions

terraspace new project test cd test terraspace new stack stack1 terraspace new hook --type project

in config/terraform/backend.tf put the following content:

terraform {
  backend "local" {
    path = "terraform.tfstate"
  }
}

in config/hooks/terraform.rb add the following content:

before("build",
  execute: "echo hi",
)

after("build",
  execute: "echo bye"
)

Then run:

terraform build stack1

Code Sample

Solution Suggestion