-
Notifications
You must be signed in to change notification settings - Fork 153
/
Makefile
50 lines (36 loc) · 1.28 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
.PHONY : install ensure build docker rmdocker test integration integrationlinux
install:
go get -u golang.org/x/tools/cmd/cover
go get -u github.com/mattn/goveralls
build:
CGO_ENABLED=0 go build
installLocal:
CGO_ENABLED=0 go install
docker:
@cd docker && \
docker build -t golang-cross-compile .
cross: docker
docker run -ti --rm -e CGO_ENABLED=0 -v $(CURDIR):/gopath/src/clair-scanner -w /gopath/src/clair-scanner golang-cross-compile gox -osarch="darwin/amd64 darwin/386 linux/amd64 linux/386 windows/amd64 windows/386" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
clean:
rm -rf dist
rmdocker:
-docker kill clair
-docker kill db
-docker rm clair
-docker rm db
test:
go test
pull:
docker pull alpine:3.5
docker pull debian:jessie
db:
docker run -p 5432:5432 -d --name db arminc/clair-db:latest
@sleep 5
clair:
docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:latest
@sleep 5
integration: pull db clair
go test -v -covermode=count -coverprofile=coverage.out -ip $(shell ipconfig getifaddr en0) -tags integration
integrationlinux: pull db clair
go test -v -covermode=count -coverprofile=coverage.out -ip $(shell ifconfig docker0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1) -tags integration
release: integrationlinux build cross