forked from aquasecurity/harbor-scanner-trivy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (23 loc) · 893 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
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 ./...
.PHONY: test-integration
test-integration: build
GO111MODULE=on go test -count=1 -v -tags=integration ./test/integration/...
.PHONY: test-component
test-component: docker-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
.PHONY: docker-build
docker-build: build
docker build --no-cache -t $(IMAGE) .
lint:
./bin/golangci-lint --build-tags component,integration run -v
.PHONY: setup
setup:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0