From 635af4bcae919532900fdc4036661e473cb7ebe5 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 28 Oct 2023 06:26:57 -0400 Subject: [PATCH] Fix terraform version reporting --- projects/terraform.io/package.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/terraform.io/package.yml b/projects/terraform.io/package.yml index c1aac8a0..fe292680 100644 --- a/projects/terraform.io/package.yml +++ b/projects/terraform.io/package.yml @@ -19,7 +19,11 @@ build: go.dev: ^1.18 env: GO111MODULE: on - LDFLAGS: [-s, -w, '-X=main.Version={{version}}'] + LDFLAGS: + - -s + - -w + - -X=github.com/hashicorp/terraform/version.Version={{version}} + - -X=github.com/hashicorp/terraform/version.dev=no linux: # or segmentation fault # fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575 @@ -28,6 +32,9 @@ build: test: script: + - terraform --version | grep '^Terraform v{{version}}$' + # ^^ test version is set correctly and not suffixed with `-dev` + - terraform init - terraform apply --auto-approve - out=$(terraform output fixture)