-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
75 lines (56 loc) · 1.49 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
66
67
68
69
70
71
72
73
74
75
all: clean install test
.PHONY: all
clean:
@rm -rf ec_* ec-proxy_* bin/ec/ec bin/ec/ec-proxy bin/ec-proxy/ec-proxy build
.PHONY: clean
install:
@echo "[+] installing dependencies"
@go get -t ./...
.PHONY: install
test: install
@echo "[+] testing"
go test -v ./...
.PHONY: test
integration:
$(eval tmp := $(TMPDIR)"eclectica")
@echo "[+] integration testing"
@rm -rf $(tmp)
@mkdir -p $(tmp)
@go build -v ./bin/ec-proxy
@mv ec-proxy $(tmp)
@env EC_PROXY_PLACE=$(tmp) EC_WITHOUT_SPINNER=true go test -v ./bin/ec -timeout 50m
@rm -rf $(tmp)
.PHONY: integration
integration-ci:
$(eval tmp := $(TMPDIR)"eclectica")
@echo "[+] integration testing"
@rm -rf $(tmp)
@mkdir -p $(tmp)
@go build -v ./bin/ec-proxy
@mv ec-proxy $(tmp)
@env EC_PROXY_PLACE=$(tmp) EC_WITHOUT_SPINNER=true go test -v ./bin/ec -timeout 50m
@echo $(tmp)
@rm -rf $(tmp)
@echo $(?)
.PHONY: integration-ci
build:
@echo "[+] building"
@go get github.com/mitchellh/gox
@rm -rf ec_* ec-proxy_*
@gox -osarch="darwin/arm64 darwin/amd64 linux/arm64 linux/amd64" -output "build/{{.Dir}}_{{.OS}}_{{.Arch}}" ./...
.PHONY: build
tag:
$(eval version := $(shell go run bin/ec/main.go version))
@echo "[+] tagging"
@git tag v$(version) -a -m "Release v$(version)"
.PHONY: tag
release:
@echo "[+] releasing"
$(eval version := $(shell go run bin/ec/main.go version))
@$(MAKE) clean
@$(MAKE) build
@$(MAKE) tag
@git push origin master --tags
@gh release create v$(version) ./build/*
@echo "[+] complete"
.PHONY: release