-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
60 lines (41 loc) · 1.67 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
export VERSION ?= $(shell git show -q --format=%h)
export IMAGE ?= kodefluence/altair
test:
go test -race -cover -coverprofile=cover.out $$(go list ./... | grep -Ev "altair$$|core|mock|interfaces|testhelper")
mock_metric:
mockgen -source core/metric.go -destination mock/mock_metric.go -package mock
mock_plugin:
mockgen -source core/plugin.go -destination mock/mock_plugin.go -package mock
mock_loader:
mockgen -source core/cfg.go -destination mock/mock_cfg.go -package mock
mock_routing:
mockgen -source core/routing.go -destination mock/mock_routing.go -package mock
mock_all: mock_service mock_formatter mock_model mock_validator mock_plugin mock_routing
build_linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s" -o ./build_output/linux/altair
upx -9 -k ./build_output/linux/altair
build_darwin:
GOOS=darwin GOARCH=386 CGO_ENABLED=0 go build -ldflags="-s" -o ./build_output/darwin/altair
upx -9 -k ./build_output/darwin/altair
build_windows:
GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags="-s" -o ./build_output/windows/altair
upx -9 -k ./build_output/windows/altair
build: build_linux build_darwin build_windows
build_docker: build_docker_latest
docker build -t $(IMAGE):$(VERSION) -f ./Dockerfile .
build_docker_latest:
docker build -t $(IMAGE):latest -f ./Dockerfile .
push_docker: push_docker_latest
docker push $(IMAGE):$(VERSION)
tag_docker_latest:
docker tag $(IMAGE):latest $(IMAGE):latest
push_docker_latest:
docker push $(IMAGE):latest
docker-compose-up:
docker-compose --env-file .env up -d
docker-compose-start:
docker-compose --env-file .env start
docker-compose-stop:
docker-compose stop
docker-compose-down:
docker-compose down