-
Notifications
You must be signed in to change notification settings - Fork 153
/
Copy pathMakefile
55 lines (42 loc) · 1.23 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
.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
cross:
@archs="linux/386 linux/amd64 linux/arm linux/arm64 darwin/amd64 darwin/arm64"; \
for arch in $$archs; do \
GOOS=$$(echo $$arch | cut -d'/' -f1); \
GOARCH=$$(echo $$arch | cut -d'/' -f2); \
echo "Building for $$GOOS/$$GOARCH"; \
CMD="GOOS=$$GOOS GOARCH=$$GOARCH go build -o clair-scanner_$${GOOS}_$${GOARCH}"; \
eval $$CMD; \
done
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.20
docker pull debian:bookworm
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
integration:
go test -v -covermode=count -coverprofile=coverage.out -ip 127.0.0.1 -tags integration
#integrationlinux: pull db clair
integration:
go test -v -covermode=count -coverprofile=coverage.out -ip 127.0.0.1 -tags integration
release: integrationlinux build cross