-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
executable file
·39 lines (27 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/make -f
COMMIT := $(shell git rev-parse HEAD)
build:
go build -o indexer main.go
build-image:
docker build --build-arg INDEXER_COMMIT_HASH=$(COMMIT) -t likechain/tx-indexer .
build-and-push:
docker buildx build --build-arg INDEXER_COMMIT_HASH=$(COMMIT) -t likechain/tx-indexer:latest --platform linux/amd64 .
docker tag likechain/tx-indexer:latest us.gcr.io/likecoin-foundation/likechain-tx-indexer:latest
docker -- push us.gcr.io/likecoin-foundation/likechain-tx-indexer:latest
build-and-push-develop:
docker buildx build --build-arg INDEXER_COMMIT_HASH=$(COMMIT) -t likechain/tx-indexer:latest --platform linux/amd64 .
docker tag likechain/tx-indexer:latest us.gcr.io/likecoin-develop/likechain-tx-indexer:latest
docker -- push us.gcr.io/likecoin-develop/likechain-tx-indexer:latest
install-tools-golangci-lint:
go install github.com/golangci/golangci-lint/cmd/[email protected]
install-tools-goimports:
go install golang.org/x/tools/cmd/goimports@latest
install-tools: install-tools-golangci-lint install-tools-goimports
lint:
golangci-lint run
format:
find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" | xargs goimports -w
test:
go test --count=1 ./...
.PHONY: build build-image build-and-push install-tools-golangci-lint install-tools-goimports install-tools lint format test