-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmakefile
50 lines (40 loc) · 1.13 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
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M), x86_64)
ARCH := x86_64
else ifeq ($(UNAME_M), aarch64)
ARCH := arm64
else ifeq ($(UNAME_M), arm64)
ARCH := arm64
else
ARCH := $(UNAME_M)
endif
VERSION := $(shell grep -Eo '(v[0-9]+[\.][0-9]+[\.][0-9]+([-a-zA-Z0-9]*)?)' version.go)
.PHONY: build
build:
go build -o bin/deadcheck github.com/adamdecaf/deadcheck
docker:
docker build --pull -t adamdecaf/deadcheck:$(VERSION).$(ARCH) -f Dockerfile .
docker-push:
docker push adamdecaf/deadcheck:$(VERSION).$(ARCH)
docker-manifest:
docker manifest create \
adamdecaf/deadcheck:${VERSION} \
adamdecaf/deadcheck:${VERSION}.x86_64
docker manifest push adamdecaf/deadcheck:${VERSION}
.PHONY: check
check:
ifeq ($(OS),Windows_NT)
go test ./...
else
@wget -O lint-project.sh https://raw.githubusercontent.com/moov-io/infra/master/go/lint-project.sh
@chmod +x ./lint-project.sh
COVER_THRESHOLD=0.0 ./lint-project.sh
endif
.PHONY: clean
clean:
@rm -rf ./bin/ ./tmp/ coverage.txt misspell* staticcheck lint-project.sh
.PHONY: cover-test cover-web
cover-test:
go test -coverprofile=cover.out ./...
cover-web:
go tool cover -html=cover.out