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

@ -10,24 +10,20 @@ provides:
- bin/packer
build:
script: |
go mod download
go build -v -ldflags="$LDFLAGS" -o my_packer
mkdir -p "{{ prefix }}"/bin
# move and rename back to packer
mv my_packer "{{ prefix }}"/bin/packer
script:
- go mod download
- go build -v -ldflags="$GO_LDFLAGS" -o "{{ prefix }}"/bin/packer
dependencies:
go.dev: ^1.18
env:
GO111MODULE: on
LDFLAGS:
[-s, -w, "-X=main.Version={{version}}"]
GO_LDFLAGS: [-s, -w, '-X=main.Version={{version}}']
linux:
# or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
LDFLAGS:
GO_LDFLAGS:
- -buildmode=pie
test:
script: |
test "$(packer --version)" = {{version}}
- packer --version
- packer --version | grep {{version}}