github.com/hi-fi/sss/print@v0.0.0-20230212204231-b8661fcee5d7/Makefile (about) 1 OPERATOR_NAME := sss-print 2 ifeq ($(USE_JSON_OUTPUT), 1) 3 GOTEST_REPORT_FORMAT := -json 4 endif 5 6 ifndef $(GOPATH) 7 GOPATH=$(shell go env GOPATH) 8 export GOPATH 9 endif 10 11 .PHONY: clean test gofmt ensure run build build-image build-linux-amd64 12 13 clean: 14 git clean -Xdf 15 16 test: ${GOPATH}/bin/golint 17 go test . -v -coverprofile=gotest-coverage.out $(GOTEST_REPORT_FORMAT) > gotest-report.out && cat gotest-report.out || (cat gotest-report.out; exit 1) 18 ${GOPATH}/bin/golint -set_exit_status . > golint-report.out && cat golint-report.out || (cat golint-report.out; exit 1) 19 go vet . 20 ../.hack/gofmt.sh 21 git diff --exit-code go.mod go.sum 22 23 gofmt: 24 ./.hack/gofmt.sh 25 26 ensure: 27 go mod tidy 28 29 run: ${GOPATH}/bin/gin 30 ${GOPATH}/bin/gin -i -p 5000 main.go 31 32 debug: ${GOPATH}/bin/dlv 33 ${GOPATH}/bin/dlv attach `pgrep -f /go/bin/gin` --headless --listen=:2345 --api-version=2 34 35 build-linux-amd64: 36 rm -rf bin/linux 37 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v -i -o bin/linux/application . 38 cp -r fonts bin/linux/fonts 39 40 build: 41 rm -f bin/$(OPERATOR_NAME) 42 go build -v -i -o bin/$(OPERATOR_NAME) . 43 44 build-image: build-linux-amd64 45 docker build -t $(IMAGE):latest . 46 47 ${GOPATH}/bin/gin: 48 go install github.com/codegangsta/gin@latest 49 50 ${GOPATH}/bin/golint: 51 go install golang.org/x/lint/golint@latest