forked from aquasecurity/tfsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (60 loc) · 1.78 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
IMAGE := tfsec/tfsec
SHELL := /bin/bash
MKDOCS_IMAGE := aquasec/mkdocs-material:tracee
MKDOCS_PORT := 8000
.PHONY: image
image:
docker build --build-arg tfsec_version=$(TRAVIS_TAG) -t $(IMAGE) .
.PHONY: test
test:
which gotestsum || (pushd /tmp && go install gotest.tools/gotestsum@latest && popd)
gotestsum -- -bench=^$$ -race ./...
.PHONY: build
build:
./scripts/build.sh
.PHONY: generate-docs
generate-docs:
@go run ./cmd/tfsec-docs
.PHONY: publish-docs
publish-docs: generate-docs
@python3 ./scripts/build_checks_nav.py
.PHONY: tagger
tagger:
@git checkout master
@git fetch --tags
@echo "the most recent tag was `git describe --tags --abbrev=0`"
@echo ""
read -p "Tag number: " TAG; \
git tag -a "$${TAG}" -m "$${TAG}"; \
git push origin "$${TAG}"
.PHONY: typos
typos:
which codespell || pip install codespell
codespell -S .terraform,.git,go.sum --ignore-words .codespellignore -f
.PHONY: quality
quality:
which golangci-lint || go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint run
.PHONY: fix-typos
fix-typos:
which codespell || pip install codespell
codespell -S .terraform,go.sum --ignore-words .codespellignore -f -w -i1
.PHONY: clone-image-github
clone-image-github:
./scripts/clone-images.sh ghcr.io/aquasecurity
.PHONY: clone-image-tfsec
clone-image-tfsec:
./scripts/clone-images.sh tfsec
.PHONY: sanity
sanity:
go run ./cmd/tfsec -s -p --force-all-dirs ./_examples > /dev/null
.PHONY: pr-ready
pr-ready: quality sanity typos
.PHONY: bench
bench:
go test -run ^$$ -bench . ./...
# Runs MkDocs dev server to preview the docs page before it is published.
.PHONY: mkdocs-serve
mkdocs-serve:
docker build -t $(MKDOCS_IMAGE) -f docs/Dockerfile docs
docker run --name mkdocs-serve --rm -v $(PWD):/docs -p $(MKDOCS_PORT):8000 $(MKDOCS_IMAGE)