-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename 'make release' into 'make binaries'
- Loading branch information
Showing
5 changed files
with
37 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/binaries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/binaries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
define DOCKERFILE_BINARIES | ||
FROM amd64/$(BASE_IMAGE) | ||
RUN apk add --no-cache zip make git tar | ||
WORKDIR /s | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY . ./ | ||
RUN make binaries-nodocker | ||
endef | ||
export DOCKERFILE_BINARIES | ||
|
||
binaries: | ||
echo "$$DOCKERFILE_BINARIES" | docker build . -f - -t temp \ | ||
&& docker run --rm -v $(PWD):/out \ | ||
temp sh -c "rm -rf /out/binaries && cp -r /s/binaries /out/" | ||
|
||
binaries-nodocker: | ||
$(eval export CGO_ENABLED=0) | ||
$(eval VERSION := $(shell git describe --tags)) | ||
$(eval GOBUILD := go build -ldflags '-X main.version=$(VERSION)') | ||
rm -rf tmp && mkdir tmp | ||
rm -rf binaries && mkdir binaries | ||
|
||
GOOS=linux GOARCH=amd64 $(GOBUILD) -o tmp/landiscover | ||
tar -C tmp -czf $(PWD)/binaries/landiscover_$(VERSION)_linux_amd64.tar.gz --owner=0 --group=0 landiscover | ||
|
||
GOOS=linux GOARCH=arm GOARM=6 $(GOBUILD) -o tmp/landiscover | ||
tar -C tmp -czf $(PWD)/binaries/landiscover_$(VERSION)_linux_arm6.tar.gz --owner=0 --group=0 landiscover | ||
|
||
GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -o tmp/landiscover | ||
tar -C tmp -czf $(PWD)/binaries/landiscover_$(VERSION)_linux_arm7.tar.gz --owner=0 --group=0 landiscover | ||
|
||
GOOS=linux GOARCH=arm64 $(GOBUILD) -o tmp/landiscover | ||
tar -C tmp -czf $(PWD)/binaries/landiscover_$(VERSION)_linux_arm64v8.tar.gz --owner=0 --group=0 landiscover |
This file was deleted.
Oops, something went wrong.