forked from ava-labs/avalanche-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (48 loc) · 1.5 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
59
60
61
62
63
64
65
#VERSIONS
LOCALSTACK_VERSION=3.0.2
#END OF VERSIONS
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
SHELL = /usr/bin/env bash -o pipefail
#.SHELLFLAGS = -ec
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
#Detect OS
UNAME := $(shell uname -s | tr A-Z a-z)
ARCH :=$(shell uname -m | tr A-Z a-z)
DOCKER:= $(shell command -v docker 2> /dev/null)
COLIMA:= $(shell command -v colima 2> /dev/null)
all: build
##@ Development
fmt: ## Run gofumpt against code.
gofumpt -l -w .
vet: ## Run go vet against code.
go vet ./...
test: fmt vet envtest ## Run tests.
go test -v ./... -coverprofile cover.out
lint: ## Run golangci-lint against code.
golangci-lint run --path-prefix=.
build: fmt vet ## Build avalanche CLI binary.
scripts/build.sh
fast-build:
scripts/build.sh
run: build ## Run avalanche CLI
./bin/avalanche help
colima: ## check colima
ifndef COLIMA
brew install colima
brew install docker docker-compose
brew install chipmk/tap/docker-mac-net-connect
brew services start chipmk/tap/docker-mac-net-connect
endif
docker: colima ## check docker
ifndef DOCKER
$(error "No docker in $(PATH), pls follow https://docs.docker.com/get-docker/ to install")
endif
docker-build: docker ## Build docker image
docker build . -t avalanche-cli
docker-e2e-build: docker build ## Build docker image for e2e
docker build -f Dockerfile.release ./bin -t avalanche-cli