-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
52 lines (40 loc) · 1.65 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
ACTIVATE_VENV = . venv/bin/activate &&
YARDSTICK = $(ACTIVATE_VENV) yardstick -v
# formatting variables
BOLD := $(shell tput -T linux bold)
PURPLE := $(shell tput -T linux setaf 5)
GREEN := $(shell tput -T linux setaf 2)
CYAN := $(shell tput -T linux setaf 6)
RED := $(shell tput -T linux setaf 1)
RESET := $(shell tput -T linux sgr0)
TITLE := $(BOLD)$(PURPLE)
SUCCESS := $(BOLD)$(GREEN)
all: static-analysis build-sboms
.PHONY: static-analysis
static-analysis: venv ## Run all static analysis checks
$(ACTIVATE_VENV) .github/scripts/static-analysis.py
.PHONY: download-sboms
download-sboms: venv ## Download all SBOMS from the OCI registry
$(ACTIVATE_VENV) ./sboms.py download
.PHONY: build-sboms
build-sboms: venv ## Download all existing SBOMs from the OCI registry and build any missing SBOMs
$(ACTIVATE_VENV) ./sboms.py download
$(ACTIVATE_VENV) ./sboms.py update
.PHONY: update-and-publish-sboms
update-and-publish-sboms: venv ## Build SBOMs and upload to the OCI registry
$(ACTIVATE_VENV) ./sboms.py download
$(ACTIVATE_VENV) ./sboms.py update
$(ACTIVATE_VENV) ./sboms.py upload
venv: venv/touchfile ## Create a python virtual environment
venv/touchfile: requirements.txt
test -d venv || python3 -m venv venv
$(ACTIVATE_VENV) pip install -Ur requirements.txt
touch venv/touchfile
.PHONY: clear-results
clear-results: venv ## Clear all existing yardstick results
$(YARDSTICK) result clear
.PHONY: clean
clean: clear-results ## Clear all existing yardstick results and delete python environment
rm -rf venv
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(BOLD)$(CYAN)%-25s$(RESET)%s\n", $$1, $$2}'