Skip to content

Commit

Permalink
Update Makefile, build in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
hjr265 committed Jun 17, 2021
1 parent 0dc3bcd commit 157c049
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

.PHONY: build test clean loadcatd

GO_BUILD := docker run --rm -ti -e GOOS -e GOARCH -v `pwd`:/loadcat -v /tmp/loadcat-go-build:/root/.cache/go-build -w /loadcat cardboard/golang:1.16 go build
ifeq ($(SKIP_DOCKER),true)
GO_BUILD := go build
endif

build: loadcatd

test:
Expand All @@ -11,4 +16,4 @@ clean:
go clean -i ./...

loadcatd:
GOOS=linux GOARCH=amd64 go build -mod=vendor -v -o loadcatd ./cmd/loadcatd
GOOS=linux GOARCH=amd64 $(GO_BUILD) -mod=vendor -v -o loadcatd ./cmd/loadcatd

0 comments on commit 157c049

Please sign in to comment.