mirror of
https://github.com/ivabus/pantry
synced 2024-11-25 18:05:07 +03:00
parent
76b7f1270a
commit
436c90c51a
1 changed files with 10 additions and 14 deletions
|
@ -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}}
|
||||
|
|
Loading…
Reference in a new issue