Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
142 lines (120 loc) · 4.53 KB
/
Copy pathMakefile
File metadata and controls
142 lines (120 loc) · 4.53 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# =====================================================================
# FILE: Makefile
# =====================================================================
CAULKING_VERSION := $(shell cat VERSION)
MIN_GITLEAKS_VERSION := 8.21.0
.DEFAULT_GOAL := help
.PHONY: help install uninstall verify audit clean ensure-tools test lint status \
docker-test docker-full docker-shell docker-debian docker-alpine \
docker-ci docker-fresh docker-upgrade docker-all
help:
@echo "Caulking ($(CAULKING_VERSION))"
@echo ""
@echo "Usage:"
@echo " make <target>"
@echo ""
@echo "Targets:"
@echo " help Show this help"
@echo " ensure-tools Ensure required tools are installed (gitleaks required; prek optional)"
@echo " install Install global hooks + gitleaks config (XDG layout)"
@echo " status Quick health check (hooks installed? gitleaks working?)"
@echo " verify Verify install + run functional tests"
@echo " audit Alias for verify (intentionally boring)"
@echo " uninstall Remove installed hooks and restore prior core.hooksPath (if recorded)"
@echo " lint Run repo lint/format hooks over all files (prek/pre-commit)"
@echo " test Run repo tests (fast bash tests)"
@echo " clean Print manual reset instructions (does not delete ~/.config)"
@echo ""
@echo "Docker (local Linux testing):"
@echo " docker-test Run bash tests in Ubuntu container (fast)"
@echo " docker-full Run full install + verify + test (Ubuntu)"
@echo " docker-shell Interactive shell in Ubuntu container"
@echo ""
@echo "Docker (multi-distro and CI simulation):"
@echo " docker-debian Test on Debian 12"
@echo " docker-alpine Test on Alpine Linux (musl libc)"
@echo " docker-ci Simulate GitHub Actions CI environment"
@echo " docker-fresh Test fresh install (no gitleaks pre-installed)"
@echo " docker-upgrade Test upgrade from previous version"
@echo " docker-all Run ALL distro tests (comprehensive)"
@echo ""
@echo "Notes:"
@echo " - Hooks install to: $${XDG_CONFIG_HOME:-$$HOME/.config}/git/hooks"
@echo " - gitleaks config: $${XDG_CONFIG_HOME:-$$HOME/.config}/gitleaks/config.toml"
@echo ""
@echo "macOS Testing:"
@echo " - Docker cannot run macOS containers (Apple licensing)"
@echo " - Use native 'make test' for macOS testing"
@echo " - CI uses GitHub Actions macos-latest runner"
@echo ""
test:
@./tests/run.sh
lint:
@./scripts/lint.sh
ensure-tools:
@MIN_GITLEAKS_VERSION="$(MIN_GITLEAKS_VERSION)" ./scripts/ensure-tools.sh
install: ensure-tools
@echo "== Installing (XDG layout) =="
@./install.sh
@echo ""
@echo "Next: make verify"
uninstall:
@echo "== Uninstalling (XDG layout) =="
@./uninstall.sh
verify:
@./verify.sh
audit: ensure-tools
@./verify.sh
status:
@./scripts/status.sh
clean:
@echo "NOTE: clean no longer deletes ~/.config by default."
@echo "If you need to reset install state:"
@echo " rm -rf '$${XDG_CONFIG_HOME:-$$HOME/.config}/git/hooks' '$${XDG_CONFIG_HOME:-$$HOME/.config}/gitleaks' '$${XDG_CONFIG_HOME:-$$HOME/.config}/caulking'"
@echo " git config --global --unset core.hooksPath || true"
@echo " git config --global --unset hooks.gitleaks || true"
# -----------------------------------------------------------------------------
# Docker targets for local Linux testing
# -----------------------------------------------------------------------------
docker-test:
@docker compose run --rm test
docker-full:
@docker compose run --rm full
docker-shell:
@docker compose run --rm shell
# -----------------------------------------------------------------------------
# Multi-distro and CI simulation
# -----------------------------------------------------------------------------
docker-debian:
@docker compose run --rm debian
docker-alpine:
@docker compose run --rm alpine
docker-ci:
@docker compose run --rm ci
docker-fresh:
@docker compose run --rm fresh-install
docker-upgrade:
@docker compose run --rm upgrade
# Run all distro tests (comprehensive pre-release check)
docker-all:
@echo "=== Running all Docker tests ==="
@echo ""
@echo "--- Ubuntu (default) ---"
@docker compose run --rm full
@echo ""
@echo "--- Debian 12 ---"
@docker compose run --rm debian
@echo ""
@echo "--- Alpine Linux ---"
@docker compose run --rm alpine
@echo ""
@echo "--- CI Simulation ---"
@docker compose run --rm ci
@echo ""
@echo "--- Fresh Install (error handling) ---"
@docker compose run --rm fresh-install
@echo ""
@echo "--- Upgrade Test ---"
@docker compose run --rm upgrade
@echo ""
@echo "=== All Docker tests PASSED ==="