-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (49 loc) · 1.55 KB
/
Makefile
File metadata and controls
59 lines (49 loc) · 1.55 KB
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
56
57
58
59
VERSION ?=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always --tags)
VERSION_SYMBOL := github.com/venslabs/vens/cmd/vens/version.Version
export CGO_ENABLED ?= 0
GO ?= go
GO_LDFLAGS ?= -s -w -X $(VERSION_SYMBOL)=$(VERSION)
GO_BUILD ?= $(GO) build -trimpath -ldflags="$(GO_LDFLAGS)"
.PHONY: all
all: binaries
.PHONY: binaries
binaries: _output/bin/vens
.PHONY: test
test:
$(GO) test -v ./...
.PHONY: _output/bin/vens
_output/bin/vens:
$(GO_BUILD) -o $@ ./cmd/vens
.PHONY: artifacts
artifacts:
@mkdir -p _output
@for os in linux darwin; do \
for arch in amd64 arm64; do \
ext=""; [ "$$os" = "windows" ] && ext=".exe"; \
echo "Building vens-$$os-$$arch$$ext"; \
GOOS=$$os GOARCH=$$arch $(GO_BUILD) -o _output/vens$$ext ./cmd/vens; \
tar -czf _output/vens-$(VERSION)-$$os-$$arch.tar.gz -C _output vens$$ext; \
rm _output/vens$$ext; \
done; \
done
.PHONY: quickstart-run
quickstart-run:
# Before executing this target, make sure to set the --llm flag and export the required environment variables (e.g., API_KEY)
@mkdir -p _output
go run ./cmd/vens generate \
--config-file examples/quickstart/config.yaml \
--llm openai \
examples/quickstart/reports/python-slim.trivy.json \
_output/vex_quickstart.json
.PHONY: quickstart-enrich
quickstart-enrich:
@mkdir -p _output
go run ./cmd/vens enrich \
--vex _output/vex_quickstart.json \
--output _output/enriched_trivy.json \
examples/quickstart/trivy.json
.PHONY: install-plugin
install-plugin:
$(GO_BUILD) -o vens ./cmd/vens
-trivy plugin uninstall vens
trivy plugin install .