-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
39 lines (31 loc) · 1.31 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
APP_VERSION = $(shell git describe --abbrev=0 --tags)
GIT_COMMIT = $(shell git rev-parse --short HEAD)
BUILD_DATE = $(shell date -u "+%Y%m%d-%H%M")
VERSION_PKG = github.com/InjectiveLabs/peggo/orchestrator/version
IMAGE_NAME := gcr.io/injective-core/peggo
DOCKER ?= false
all:
image:
docker build --build-arg GIT_COMMIT=$(GIT_COMMIT) -t $(IMAGE_NAME):local -f Dockerfile .
docker tag $(IMAGE_NAME):local $(IMAGE_NAME):$(GIT_COMMIT)
docker tag $(IMAGE_NAME):local $(IMAGE_NAME):latest
push:
docker push $(IMAGE_NAME):$(GIT_COMMIT)
docker push $(IMAGE_NAME):latest
install: export GOPROXY=direct
install: export VERSION_FLAGS="-X $(VERSION_PKG).GitCommit=$(GIT_COMMIT) -X $(VERSION_PKG).BuildDate=$(BUILD_DATE)"
install:
$(DOCKER) && go install -tags muslc -ldflags $(VERSION_FLAGS) ./cmd/... || go install -ldflags $(VERSION_FLAGS) ./cmd/...
.PHONY: install image push test gen
test:
# go clean -testcache
go test ./test/...
gen: solidity-wrappers
SOLIDITY_DIR = solidity
solidity-wrappers: $(SOLIDITY_DIR)/contracts/*.sol
cd $(SOLIDITY_DIR)/contracts/ ; \
for file in $(^F) ; do \
mkdir -p ../wrappers/$${file} ; \
echo abigen --type=peggy --pkg wrappers --out=../wrappers/$${file}/wrapper.go --sol $${file} ; \
abigen --type=peggy --pkg wrappers --out=../wrappers/$${file}/wrapper.go --sol $${file} ; \
done