-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
40 lines (30 loc) · 905 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
now := $(shell date)
PREFIX ?= zeusro
APP_NAME ?= common-bandwidth-auto-switch:latest
IMAGE ?= $(PREFIX)/$(APP_NAME)
MIRROR_IMAGE ?= registry.cn-shenzhen.aliyuncs.com/amiba/common-bandwidth-auto-switch:latest
ARCH ?=amd64
auto_commit:
git add .
git commit -am "$(now)"
git push
buildAndRun:
GOARCH=$(ARCH) CGO_ENABLED=0 go build
./common-bandwidth-auto-switch
mirror: pull
docker build -t $(MIRROR_IMAGE) -f deploy/docker/Dockerfile .
pull:
git reset --hard HEAD
git pull
release-mirror: mirror
docker push $(MIRROR_IMAGE)
rebuild: pull
docker build -t $(IMAGE) -f deploy/docker/Dockerfile .
test:
mkdir -p artifacts/report/coverage
go test -v -cover -coverprofile c.out.tmp ./...
cat c.out.tmp | grep -v "_mock.go" > c.out
go tool cover -html=c.out -o artifacts/report/coverage/index.html
up:
docker-compose build --force-rm --no-cache
docker-compose up