-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (46 loc) · 940 Bytes
/
Makefile
File metadata and controls
64 lines (46 loc) · 940 Bytes
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
60
61
62
63
64
IMAGE:=tcli
TRIVY_IMAGE:=ghcr.io/aquasecurity/trivy
BIN=bin/tcli.exe
ifndef OS
OS=linux
BIN=bin/tcli
endif
ifndef ARCH
ARCH=amd64
endif
all:
TCLI_CONFIG_ROOT=tools \
go run cmd/main.go $(MODULE) $(TAG)
build:
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) \
go build -o $(BIN) \
-ldflags "-s -w" cmd/main.go
vendor:
go mod vendor
vet:
go vet ./...
imports:
goimports -w .
tidy:
go mod tidy
sanity: lint trivy
lint:
./tools/run_linter.sh
docker:
docker build -t $(IMAGE) -f tools/Dockerfile .
docker_run:
docker run --rm $(IMAGE)
trivy: docker
docker run --rm \
-v/var/run/docker.sock:/var/run/docker.sock \
-v"$$HOME/Library/Caches:/root/.cache" \
$(TRIVY_IMAGE) \
image -q --severity HIGH,CRITICAL,MEDIUM,LOW --exit-code 1 $(IMAGE)
clean:
go clean
ci_clean: clean
docker logout
install: build
./tools/install.sh
.PHONY: all build vet imports tidy sanity lint gosec docker trivy clean install
.SILENT: