-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (50 loc) · 2.22 KB
/
Makefile
File metadata and controls
65 lines (50 loc) · 2.22 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
.PHONY: help test test-auto test-interactive test-all test-syntax lint clean build-test-images docker-clean shellcheck
# Default target
.DEFAULT_GOAL := help
# Ubuntu versions to test
UBUNTU_VERSIONS := 24.04 25.10
help: ## Show this help message
@echo "Linux Bootstrap Testing Makefile"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Available targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
test: test-auto ## Run automated tests (default: Ubuntu 24.04)
test-auto: ## Run automated tests on Ubuntu 24.04
@./test/run-tests.sh auto
test-interactive: ## Start interactive Docker container for manual testing
@./test/run-tests.sh interactive
test-all: ## Run tests on all Ubuntu versions (24.04, 25.10)
@./test/run-tests.sh all
test-syntax: ## Run syntax checks on all bash scripts
@./test/run-tests.sh syntax
lint: shellcheck ## Run all linting tools
shellcheck: ## Run shellcheck on all scripts
@echo "Running shellcheck..."
@if command -v shellcheck >/dev/null 2>&1; then \
shellcheck -x --severity=error bootstrap; \
shellcheck -x --severity=error ubuntu/bootstrap; \
find ubuntu/ -type f -name 'install-*' -exec shellcheck -x --severity=error {} \+; \
find generic/ -type f -exec shellcheck -x --severity=error {} \+; \
else \
echo "shellcheck not installed. Install with: sudo apt-get install shellcheck"; \
exit 1; \
fi
build-test-images: ## Build Docker test images for all Ubuntu versions
@echo "Building test images for Ubuntu versions: $(UBUNTU_VERSIONS)"
@for version in $(UBUNTU_VERSIONS); do \
echo "Building Ubuntu $$version..."; \
docker build \
--build-arg UBUNTU_VERSION=$$version \
-f test/docker/Dockerfile.ubuntu-noninteractive \
-t ubuntu-bootstrap-test:$$version \
.; \
done
clean: docker-clean ## Clean up all test artifacts
docker-clean: ## Remove all test Docker images
@echo "Cleaning up Docker test images..."
@docker images | grep ubuntu-bootstrap-test | awk '{print $$3}' | xargs -r docker rmi || true
@echo "Cleanup complete"
ci: test-syntax test-all ## Run full CI test suite (syntax + all versions)
quick: test-syntax test-auto ## Quick check: syntax + single version test