aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-18 13:25:00 -0600
committerCraig Jennings <c@cjennings.net>2026-01-18 13:25:00 -0600
commit3e3d24e12750a5a79925ae36b5e48598116d5636 (patch)
tree6bcfed700cbc9fff0e35c54f8b26d5defd205aee /Makefile
parent3ecf4e25cb52ca1ca57c386821f66e6a3b894848 (diff)
downloadarchangel-3e3d24e12750a5a79925ae36b5e48598116d5636.tar.gz
archangel-3e3d24e12750a5a79925ae36b5e48598116d5636.zip
Add CI/CD test infrastructure
- Add Makefile with targets: all, test, test-unit, test-install, build, release, clean, lint - Add test-install.sh for automated VM installation testing - Add test configs: single-disk, mirror, raidz1, no-ssh, custom-locale - Add test-logs/ to .gitignore - Uses sshpass for SSH authentication to live ISO - Copies latest install-archzfs to VM before testing (allows testing without rebuild) - Supports --list to show available configs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile79
1 files changed, 79 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4a0718a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,79 @@
+# Makefile for archzfs ISO build and testing
+#
+# Usage:
+# make - Run all tests and build
+# make test - Run all tests (unit + integration)
+# make test-unit - Run unit tests only (fast)
+# make test-install - Run install tests in VM (slow)
+# make build - Build the ISO
+# make release - Full test + build + deploy
+# make clean - Clean build artifacts
+# make lint - Run shellcheck on all scripts
+#
+# Test configurations are in scripts/test-configs/
+
+.PHONY: all test test-unit test-install build release clean lint help
+
+# Default target
+all: test build
+
+help:
+ @echo "archzfs Makefile targets:"
+ @echo ""
+ @echo " make - Run all tests and build ISO"
+ @echo " make test - Run all tests (unit + integration)"
+ @echo " make test-unit - Run unit tests only (fast)"
+ @echo " make test-install - Run VM install tests (slow)"
+ @echo " make build - Build the ISO (requires sudo)"
+ @echo " make release - Full test + build + deploy ISO"
+ @echo " make clean - Remove build artifacts"
+ @echo " make lint - Run shellcheck on all scripts"
+ @echo ""
+ @echo "Test configs are in scripts/test-configs/"
+
+# Unit tests (fast, no VM needed)
+test-unit:
+ @echo "==> Running unit tests..."
+ ./scripts/test-zfs-snap-prune.sh
+
+# Lint all bash scripts
+lint:
+ @echo "==> Running shellcheck..."
+ @shellcheck -x build.sh scripts/*.sh custom/install-archzfs custom/grub-zfs-snap custom/zfs-snap-prune || true
+ @echo "==> Shellcheck complete"
+
+# Build the ISO (requires sudo)
+build:
+ @echo "==> Building ISO..."
+ sudo ./build.sh
+
+# Integration tests (runs VMs, slow)
+test-install: build
+ @echo "==> Running install tests..."
+ ./scripts/test-install.sh
+
+# All tests
+test: lint test-unit
+
+# Full release: test everything, build, deploy
+release: test test-install
+ @echo "==> Deploying ISO..."
+ @# Move old ISOs to archive
+ @mkdir -p archive
+ @mv -f archzfs-*.iso archive/ 2>/dev/null || true
+ @# Copy new ISO to project root
+ @cp out/archzfs-*.iso .
+ @echo "==> Release complete:"
+ @ls -lh archzfs-*.iso
+
+# Clean build artifacts
+clean:
+ @echo "==> Cleaning..."
+ sudo rm -rf work out profile
+ rm -rf vm/*.qcow2
+ @echo "==> Clean complete"
+
+# Clean everything including releases
+distclean: clean
+ rm -rf archive
+ rm -f archzfs-*.iso