fix(packer)

closes #5049
This commit is contained in:
Jacob Heider 2024-01-30 14:12:56 -05:00
parent 76b7f1270a
commit 436c90c51a
No known key found for this signature in database
GPG key ID: 51E3FD0EE62677B6

View file

@ -3,31 +3,27 @@ distributable:
strip-components: 1 strip-components: 1
versions: versions:
github: hashicorp/packer/tags github: hashicorp/packer/tags
strip: /^v/ strip: /^v/
provides: provides:
- bin/packer - bin/packer
build: build:
script: | script:
go mod download - go mod download
go build -v -ldflags="$LDFLAGS" -o my_packer - go build -v -ldflags="$GO_LDFLAGS" -o "{{ prefix }}"/bin/packer
mkdir -p "{{ prefix }}"/bin
# move and rename back to packer
mv my_packer "{{ prefix }}"/bin/packer
dependencies: dependencies:
go.dev: ^1.18 go.dev: ^1.18
env: env:
GO111MODULE: on GO111MODULE: on
LDFLAGS: GO_LDFLAGS: [-s, -w, '-X=main.Version={{version}}']
[-s, -w, "-X=main.Version={{version}}"]
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
LDFLAGS: GO_LDFLAGS:
- -buildmode=pie - -buildmode=pie
test: test:
script: | - packer --version
test "$(packer --version)" = {{version}} - packer --version | grep {{version}}