forked from aquasecurity/trivy-plugin-aqua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (40 loc) · 1.02 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
SHELL=/usr/bin/env bash
.PHONY: test
test:
go test -v ./...
.PHONY: integration-test
integration-test:
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.27.0
mkdir -p /home/runner/.trivy/plugins/aqua/
go build -o /home/runner/.trivy/plugins/aqua/aqua cmd/aqua/main.go
cp plugin.yaml /home/runner/.trivy/plugins/aqua/
trivy config .
trivy fs --debug --security-checks config,vuln,secret .
docker pull alpine
trivy --debug image alpine
.PHONY: update-plugin
update-plugin:
@./scripts/update_plugin.sh
.PHONY: proto
proto:
pushd pkg/proto && protoc --twirp_out=. --go_out=. ./buildsecurity.proto
.PHONY: build-image
build-image:
docker run \
--rm \
-e GOARCH=amd64 \
-e GOOS=linux \
-w /build \
-v `pwd`:/build \
golang:1.18 \
go build -o bin/aqua cmd/aqua/main.go|| exit 1
.PHONY: test-image
test-image:
docker run \
--rm \
-e GOARCH=amd64 \
-e GOOS=linux \
-w /build \
-v `pwd`:/build \
golang:1.18 \
go test -v ./...|| exit 1