-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (44 loc) · 1.06 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
VERSION := 0.0.1
DOCKER_REG = bamdockerhub
DOCKER_IMAGE = auth
DOCKER_IMAGE_TAG = $(VERSION)
USER = $(shell whoami)
FILES=./pkg/contracts/*
docker-build:
docker build -t $(DOCKER_REG)/$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG) .
docker-push:
docker push $(DOCKER_REG)/$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG)
docker-build-dev:
docker build -t $(DOCKER_REG)/$(DOCKER_IMAGE):$(USER) .
docker-push-dev:
docker push $(DOCKER_REG)/$(DOCKER_IMAGE):$(USER)
install:
go install -v
serve:
cd cmd/serve; go run main.go
build:
go build ./...
deps:
go get ./...
test:
go test ./... -cover
transpile_contracts:
for file in $(FILES); do \
FILENAME=$$(echo $$file | cut -d '/' -f4 | cut -d '.' -f1); \
FILEPATH=$$(echo $$file | cut -d '.' -f2); \
abi-extractor $$file; \
mkdir ./$$FILEPATH ; \
abigen --abi=.$$FILEPATH.abi --pkg=$$FILENAME --out=.$$FILEPATH/$$FILENAME.go; \
done
lint:
gofmt -s -w .
gofmt -r '(a) -> a' -l *.go .
gofmt -r '(a) -> a' -w *.go .
gofmt -r 'α[β:len(α)] -> α[β:]' -w $GOROOT/src .
.PHONY: \
install \
build \
serve \
deps \
lint \
test \