forked from aquasecurity/harbor-scanner-trivy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (20 loc) · 813 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
SOURCES := $(shell find . -name '*.go')
BINARY := scanner-trivy
IMAGE_TAG := dev
IMAGE := aquasec/harbor-scanner-trivy:$(IMAGE_TAG)
build: $(BINARY)
test: build
GO111MODULE=on go test -v -short -race -coverprofile=coverage.txt -covermode=atomic ./...
test-integration: build
GO111MODULE=on go test -count=1 -v -tags=integration ./test/integration/...
test-component: build
GO111MODULE=on go test -count=1 -v -tags=component ./test/component/...
$(BINARY): $(SOURCES)
GOOS=linux GO111MODULE=on CGO_ENABLED=0 go build -o $(BINARY) cmd/scanner-trivy/main.go
container: build
docker build --no-cache -t $(IMAGE) .
lint:
./bin/golangci-lint --build-tags component,integration run -v
setup:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0
PHONY: setup