71 lines
1.7 KiB
Makefile
Raw Normal View History

2019-02-11 09:40:43 +01:00
GO111MODULE = on
ENABLE_METRICS ?= true
BUILD_FLAGS ?= $(shell echo "-ldflags '\
-X github.com/status-im/status-console-client/vendor/github.com/ethereum/go-ethereum/metrics.EnabledStr=$(ENABLE_METRICS)'")
DOCKER_IMAGE_NAME ?= statusteam/status-client
DOCKER_CUSTOM_TAG ?= $(shell git rev-parse --short HEAD)
build: GOFLAGS ?= "-mod=vendor"
2019-01-08 21:02:11 +01:00
build:
GOFLAGS=$(GOFLAGS) go build $(BUILD_FLAGS) -o ./bin/status-term-client .
2019-01-08 21:02:11 +01:00
.PHONY: build
run: ARGS ?=
run: build
./bin/status-term-client $(ARGS) 2>/tmp/status-term-client.log
.PHONY: run
test:
2019-04-12 16:53:26 +02:00
go test ./...
.PHONY: test
2019-02-11 09:40:43 +01:00
2019-01-08 21:02:11 +01:00
test-race:
go test -race ./...
.PHONY: test-race
2019-01-08 21:02:11 +01:00
lint:
2019-02-11 09:40:43 +01:00
golangci-lint run -v
2019-01-08 21:02:11 +01:00
.PHONY: lint
2019-02-11 09:40:43 +01:00
lint-v110:
golangci-lint run -v --config .golangci-v110.yml
.PHONY: lint-v110
vendor:
go mod tidy
2019-02-11 09:40:43 +01:00
go mod vendor
modvendor -copy="**/*.c **/*.h" -v
.PHONY: vendor
install-linter:
2019-02-11 09:40:43 +01:00
# install linter
2019-06-14 22:25:02 +02:00
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.17.1
.PHONY: install-linter
install-dev:
2019-02-11 09:40:43 +01:00
# a tool to vendor non-go files
2019-05-29 22:44:00 +02:00
go get -u github.com/goware/modvendor
go get -u github.com/golang/mock/gomock
go install github.com/golang/mock/mockgen
go get -u github.com/jteeuwen/go-bindata/go-bindata@v3.0.7
2019-05-29 22:44:00 +02:00
go mod tidy || echo 'ignore mod tidy'
2019-01-08 21:02:11 +01:00
.PHONY: install-dev
mock:
mockgen \
-destination ./protocol/v1/mock/protocol_mock.go \
-package protocol_mock \
github.com/status-im/status-console-client/protocol/v1 Protocol
.PHONY: mock
gen-migrations:
pushd protocol/client/migrations/ && rm -f bindata.go && go-bindata -pkg migrations ./ && popd
.PHONY: gen-migrations
image:
docker build . -t $(DOCKER_IMAGE_NAME):latest -t $(DOCKER_IMAGE_NAME):$(DOCKER_CUSTOM_TAG)
.PHONY: image