forked from aquasecurity/trivy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 918 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
32
33
34
35
36
37
38
39
40
41
42
VERSION := $(shell git describe --tags)
LDFLAGS=-ldflags "-s -w -X=main.version=$(VERSION)"
GOPATH=$(shell go env GOPATH)
GOBIN=$(GOPATH)/bin
u := $(if $(update),-u)
.PHONY: deps
deps:
go get ${u} -d
go mod tidy
$(GOBIN)/golangci-lint:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.21.0
.PHONY: test
test:
go test -v -short ./...
integration/testdata/fixtures/*.tar.gz:
git clone https://github.com/aquasecurity/trivy-test-images.git integration/testdata/fixtures
.PHONY: test-integration
test-integration: integration/testdata/fixtures/*.tar.gz
go test -v -tags=integration ./integration/...
.PHONY: lint
lint: $(GOBIN)/golangci-lint
$(GOBIN)/golangci-lint run
.PHONY: build
build:
go build $(LDFLAGS) ./cmd/trivy
.PHONY: install
install:
go install $(LDFLAGS) ./cmd/trivy
.PHONY: clean
clean:
rm -rf integration/testdata/fixtures/