-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (39 loc) · 853 Bytes
/
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
SHELL=/bin/bash -o pipefail
GO_COVER_ARGS := -coverpkg ./... -coverprofile coverage.txt -covermode atomic
$(eval RELEASE_TAG := $(shell cat version.json | jq ".version" --raw-output))
PHONY: .all
all: es-cli
PHONY: vendor
vendor:
go get github.com/izumin5210/gex/cmd/gex
go mod download
PHONY: generate
generate:
go generate ./...
PHONY: go-test
go-test: vendor
go test -v ${GO_COVER_ARGS} ./... | gex cgt
PHONY: e2e-test
e2e-test: build
./script/e2e-test
PHONY: clear
clear:
rm -rf bin/
rm -rf build/
rm -rf vendor/
PHONY: install
install: vendor
go install
## Use this in CI
PHONY: build
build: vendor
ifdef GOOS
go build -o build/es-cli-$(GOOS)-$(GOARCH) $ .
else
go build -o build/es-cli .
endif
PHONY: test
test: go-test e2e-test
PHONY: release
release: vendor build
gex ghr -t $(GITHUB_ACCESS_TOKEN) $(RELEASE_TAG) build/