justfile
This commit is contained in:
parent
cecdca9586
commit
fc48010c05
28 changed files with 3872 additions and 13 deletions
|
|
@ -5,19 +5,22 @@
|
|||
IMAGE_NAME := "debian-atomic-installer"
|
||||
IMAGE_TAG := "latest"
|
||||
|
||||
# Apt-cacher-ng configuration
|
||||
APT_CACHER_NG_PROXY := "http://192.168.1.101:3142"
|
||||
|
||||
# Default recipe
|
||||
default: build-installer
|
||||
|
||||
# Build the installer container image
|
||||
build-installer:
|
||||
@echo "Building Debian Atomic Desktop installer..."
|
||||
podman build -t {{IMAGE_NAME}}:{{IMAGE_TAG}} .
|
||||
cd .. && podman build --build-arg APT_CACHER_NG_PROXY={{APT_CACHER_NG_PROXY}} -t {{IMAGE_NAME}}:{{IMAGE_TAG}} -f 02-installer-bootc/Containerfile .
|
||||
@echo "Installer image built successfully!"
|
||||
|
||||
# Build with a specific tag
|
||||
build-installer-tag tag:
|
||||
@echo "Building installer with tag: {{tag}}"
|
||||
podman build -t {{IMAGE_NAME}}:{{tag}} .
|
||||
cd .. && podman build --build-arg APT_CACHER_NG_PROXY={{APT_CACHER_NG_PROXY}} -t {{IMAGE_NAME}}:{{tag}} -f 02-installer-bootc/Containerfile .
|
||||
@echo "Installer image built with tag {{tag}}!"
|
||||
|
||||
# Test the installer image interactively
|
||||
|
|
@ -37,8 +40,8 @@ test-installer-systemd:
|
|||
# Create a bootable ISO from the installer image
|
||||
create-iso:
|
||||
@echo "Creating bootable ISO from installer image..."
|
||||
@echo "This would use bootc to create an ISO from the container"
|
||||
@echo "bootc container build-iso {{IMAGE_NAME}}:{{IMAGE_TAG}} --output debian-atomic-installer.iso"
|
||||
@echo "Using bootable ISO creation approach..."
|
||||
./scripts/create-bootable-iso.sh
|
||||
|
||||
# Test the ISO in QEMU
|
||||
test-iso:
|
||||
|
|
@ -46,10 +49,15 @@ test-iso:
|
|||
qemu-system-x86_64 \
|
||||
-enable-kvm \
|
||||
-m 2G \
|
||||
-cdrom debian-atomic-installer.iso \
|
||||
-cdrom build/debian-atomic-installer.iso \
|
||||
-serial mon:stdio \
|
||||
-nographic
|
||||
|
||||
# Test the ISO using podman containers
|
||||
test-iso-podman:
|
||||
@echo "Testing ISO using podman containers..."
|
||||
./scripts/test-iso-podman.sh
|
||||
|
||||
# Build bootable ISO from installer container
|
||||
build-iso:
|
||||
@echo "Building bootable ISO from installer container..."
|
||||
|
|
@ -150,10 +158,70 @@ inspect-image:
|
|||
@echo "Inspecting installer image..."
|
||||
podman inspect {{IMAGE_NAME}}:{{IMAGE_TAG}}
|
||||
|
||||
# Install custom packages locally (for testing)
|
||||
install-custom-packages:
|
||||
@echo "Installing custom bootc and ostree packages locally..."
|
||||
./scripts/install-custom-packages.sh
|
||||
|
||||
# Build with custom packages
|
||||
build-installer-custom:
|
||||
@echo "Building installer with custom bootc/ostree packages..."
|
||||
cd .. && podman build --build-arg APT_CACHER_NG_PROXY={{APT_CACHER_NG_PROXY}} -t {{IMAGE_NAME}}:{{IMAGE_TAG}} -f 02-installer-bootc/Containerfile .
|
||||
@echo "Installer image built with custom packages!"
|
||||
|
||||
# Help
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@just --list
|
||||
|
||||
# Test apt-cacher-ng connectivity
|
||||
test-apt-cacher:
|
||||
@echo "Testing apt-cacher-ng connectivity..."
|
||||
@if timeout 5 bash -c '</dev/tcp/192.168.1.101/3142' 2>/dev/null; then \
|
||||
echo "✅ apt-cacher-ng is accessible at {{APT_CACHER_NG_PROXY}}"; \
|
||||
else \
|
||||
echo "❌ apt-cacher-ng is not accessible at {{APT_CACHER_NG_PROXY}}"; \
|
||||
echo "You may need to start apt-cacher-ng or check the IP address"; \
|
||||
fi
|
||||
|
||||
# Build without apt-cacher-ng (fallback)
|
||||
build-installer-no-cache:
|
||||
@echo "Building installer without apt-cacher-ng..."
|
||||
cd .. && podman build -t {{IMAGE_NAME}}:{{IMAGE_TAG}} -f 02-installer-bootc/Containerfile .
|
||||
@echo "Installer image built successfully!"
|
||||
|
||||
# Create test VM with KVM and VNC
|
||||
create-test-vm:
|
||||
@echo "Creating test VM with KVM and VNC access..."
|
||||
./scripts/create-test-vm.sh
|
||||
|
||||
# Start test VM
|
||||
start-test-vm:
|
||||
@echo "Starting test VM..."
|
||||
virsh start debian-atomic-test
|
||||
|
||||
# Stop test VM
|
||||
stop-test-vm:
|
||||
@echo "Stopping test VM..."
|
||||
virsh destroy debian-atomic-test
|
||||
|
||||
# Destroy test VM completely
|
||||
destroy-test-vm:
|
||||
@echo "Destroying test VM completely..."
|
||||
virsh destroy debian-atomic-test 2>/dev/null || true
|
||||
virsh undefine debian-atomic-test 2>/dev/null || true
|
||||
sudo rm -f /var/lib/libvirt/images/debian-atomic-test.qcow2
|
||||
|
||||
# Full test workflow (build installer, create ISO, create VM)
|
||||
test-full-workflow:
|
||||
@echo "Running full test workflow..."
|
||||
@echo "1. Building installer container..."
|
||||
just build-installer
|
||||
@echo "2. Creating ISO..."
|
||||
just create-iso
|
||||
@echo "3. Creating test VM..."
|
||||
just create-test-vm
|
||||
@echo "Full workflow completed!"
|
||||
|
||||
# List all recipes
|
||||
list: help
|
||||
Loading…
Add table
Add a link
Reference in a new issue