37 lines
849 B
Makefile
37 lines
849 B
Makefile
|
ENV ?= venv
|
||
|
ENV_BIN ?= $(ENV)/bin
|
||
|
|
||
|
$(ENV):
|
||
|
python3 -m venv $(ENV)
|
||
|
pip install --upgrade pip
|
||
|
pip install pre-commit detect-secrets requests
|
||
|
|
||
|
# Installs pre-commit hooks
|
||
|
.PHONY: install-hooks
|
||
|
install-hooks: $(ENV)
|
||
|
$(ENV_BIN)/pre-commit install --install-hooks
|
||
|
|
||
|
# Checks files for encryption
|
||
|
.PHONY: check
|
||
|
check: $(ENV) deps
|
||
|
$(ENV_BIN)/pre-commit run --all-files
|
||
|
|
||
|
# Clears all roles and virtualenv
|
||
|
.PHONY: clean
|
||
|
clean:
|
||
|
rm -fr $(ENV)
|
||
|
|
||
|
# Creates a new secrets baseline
|
||
|
.secrets-baseline: $(ENV)
|
||
|
$(ENV_BIN)/detect-secrets scan > .secrets-baseline
|
||
|
|
||
|
# Audits secrets against baseline
|
||
|
.PHONY: secrets-audit
|
||
|
secrets-audit: $(ENV) .secrets-baseline
|
||
|
$(ENV_BIN)/detect-secrets audit .secrets-baseline
|
||
|
|
||
|
# Updates secrets baseline
|
||
|
.PHONY: secrets-update
|
||
|
secrets-update: $(ENV) .secrets-baseline
|
||
|
$(ENV_BIN)/detect-secrets scan --baseline .secrets-baseline
|