Fix terraform version reporting

This commit is contained in:
Max Howell 2023-10-28 06:26:57 -04:00
parent 2bbb1b578f
commit 635af4bcae
No known key found for this signature in database
GPG key ID: 741BB84EF5BB9EEC

View file

@ -19,7 +19,11 @@ build:
go.dev: ^1.18 go.dev: ^1.18
env: env:
GO111MODULE: on 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: linux:
# or segmentation fault # or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575 # fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
@ -28,6 +32,9 @@ build:
test: test:
script: script:
- terraform --version | grep '^Terraform v{{version}}$'
# ^^ test version is set correctly and not suffixed with `-dev`
- terraform init - terraform init
- terraform apply --auto-approve - terraform apply --auto-approve
- out=$(terraform output fixture) - out=$(terraform output fixture)