244 lines
9.8 KiB
Makefile
244 lines
9.8 KiB
Makefile
# Debian Atomic Justfile
|
|
# 1:1 parallel to Fedora Atomic for Debian
|
|
# Based on workstation-ostree-config patterns
|
|
|
|
# Default recipe - show available commands
|
|
default:
|
|
@echo "Debian Atomic Build System"
|
|
@echo "=========================="
|
|
@echo ""
|
|
@echo "Available recipes:"
|
|
@echo " compose-base - Compose base OSTree image (Debian 13 Trixie)"
|
|
@echo " compose-base-forky - Compose base OSTree image (Debian 14 Forky)"
|
|
@echo " compose-variants - Compose all variants (Debian 13 Trixie)"
|
|
@echo " compose-variants-forky - Compose all variants (Debian 14 Forky)"
|
|
@echo " compose-testing - Build testing variant (bootc, apt-ostree, bootupd)"
|
|
@echo " compose-workstation - Build workstation variant (GNOME)"
|
|
@echo " compose-server - Build server variant (CLI)"
|
|
@echo " compose-debian-bootc-base - Build Debian bootc base image"
|
|
@echo " build-iso - Build bootable ISO images"
|
|
@echo " sync-comps - Sync with Debian package groups"
|
|
@echo " test-variant - Test a specific variant"
|
|
@echo " clean - Clean build artifacts"
|
|
@echo " deploy - Deploy to container registry"
|
|
@echo ""
|
|
@echo "Examples:"
|
|
@echo " just compose-base"
|
|
@echo " just compose-testing"
|
|
@echo " just compose-variants"
|
|
@echo " just test-variant variant=testing"
|
|
|
|
# Variables
|
|
variant := "base"
|
|
output_dir := "/tmp/debian-atomic"
|
|
registry := "git.raines.xyz/robojerk"
|
|
compose_type := "image" # image (OCI container approach)
|
|
|
|
# Compose base OSTree image (Debian 13 Trixie Stable)
|
|
compose-base:
|
|
@echo "Composing Debian Atomic Base (Trixie Stable)..."
|
|
@mkdir -p {{output_dir}}/base
|
|
cd variants/base && \
|
|
podman build -t debian-atomic-base:latest . && \
|
|
echo "Base image (Trixie) composed successfully"
|
|
|
|
# Compose base OSTree image (Debian 14 Forky Testing)
|
|
compose-base-forky:
|
|
@echo "Composing Debian Atomic Base (Forky Testing)..."
|
|
@mkdir -p {{output_dir}}/base-forky
|
|
cd variants/base-forky && \
|
|
podman build -t debian-atomic-base-forky:latest . && \
|
|
echo "Base image (Forky) composed successfully"
|
|
|
|
# Compose all variants
|
|
compose-variants: compose-base
|
|
@echo "Composing all Debian Atomic variants..."
|
|
@mkdir -p {{output_dir}}/variants
|
|
for variant_dir in variants/*/; do \
|
|
if [ -f "$$variant_dir/Containerfile" ]; then \
|
|
variant_name=$$(basename "$$variant_dir"); \
|
|
echo "Composing $$variant_name..."; \
|
|
cd "$$variant_dir" && \
|
|
podman build -t debian-atomic-$$variant_name:latest . && \
|
|
cd ../..; \
|
|
fi; \
|
|
done
|
|
@echo "All variants composed successfully"
|
|
|
|
# Compose workstation variant (GNOME desktop)
|
|
compose-workstation: compose-base
|
|
@echo "Composing Debian Atomic Workstation variant..."
|
|
@mkdir -p {{output_dir}}/workstation
|
|
cd variants/workstation && \
|
|
podman build -t debian-atomic-workstation:latest . && \
|
|
echo "Workstation variant composed successfully"
|
|
|
|
# Compose server variant (CLI server)
|
|
compose-server: compose-base
|
|
@echo "Composing Debian Atomic Server variant..."
|
|
@mkdir -p {{output_dir}}/server
|
|
cd variants/server && \
|
|
podman build -t debian-atomic-server:latest . && \
|
|
echo "Server variant composed successfully"
|
|
|
|
# Build testing variant with Debian Atomic components
|
|
compose-testing: compose-debian-bootc-base
|
|
@echo "Composing Debian Atomic Testing variant..."
|
|
@mkdir -p {{output_dir}}/testing
|
|
cd variants/testing && \
|
|
podman build -t debian-atomic-testing:latest . && \
|
|
echo "Testing variant composed successfully"
|
|
|
|
# Build Debian bootc base image
|
|
compose-debian-bootc-base:
|
|
@echo "Building Debian bootc base image..."
|
|
cd variants/debian-bootc-base && \
|
|
podman build -t debian-atomic-debian-bootc-base:latest . && \
|
|
echo "Debian bootc base image built successfully"
|
|
|
|
# Build bootable ISO images
|
|
build-iso variant output_path:
|
|
@echo "Building bootable ISO for {{variant}} variant..."
|
|
@mkdir -p {{output_path}}
|
|
@echo "Note: Use bootc-image-builder for image conversion"
|
|
@echo "Command: sudo podman run --rm -it --privileged --security-opt label=type:unconfined_t -v {{output_path}}:/output -v /var/lib/containers/storage:/var/lib/containers/storage quay.io/centos-bootc/bootc-image-builder:latest --type qcow2 debian-atomic-{{variant}}:latest"
|
|
|
|
# Sync with Debian package groups (Fedora comps-sync equivalent)
|
|
sync-comps:
|
|
@echo "Syncing with Debian package groups..."
|
|
python3 scripts/comps-sync.py treefiles/tasks.yaml
|
|
@echo "Package groups synced successfully"
|
|
|
|
# Test a specific variant
|
|
test-variant variant:
|
|
@echo "Testing {{variant}} variant..."
|
|
@mkdir -p {{output_dir}}/test
|
|
if [ -d "variants/{{variant}}" ]; then \
|
|
cd variants/{{variant}} && \
|
|
podman build -t debian-atomic-{{variant}}:test . && \
|
|
echo "{{variant}} variant test build successful" && \
|
|
cd ../..; \
|
|
else \
|
|
echo "Variant {{variant}} not found"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
# Test all variants
|
|
test-all-variants: compose-variants
|
|
@echo "Testing all variants..."
|
|
for variant_dir in variants/*/; do \
|
|
if [ -f "$$variant_dir/Containerfile" ]; then \
|
|
variant_name=$$(basename "$$variant_dir"); \
|
|
echo "Testing $$variant_name..."; \
|
|
just test-variant variant=$$variant_name; \
|
|
fi; \
|
|
done
|
|
@echo "All variants tested successfully"
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
@echo "Cleaning build artifacts..."
|
|
@podman rmi -f debian-atomic-base:latest 2>/dev/null || true
|
|
@podman rmi -f debian-atomic-base-forky:latest 2>/dev/null || true
|
|
@podman rmi -f debian-atomic-workstation:latest 2>/dev/null || true
|
|
@podman rmi -f debian-atomic-server:latest 2>/dev/null || true
|
|
@podman rmi -f debian-atomic-testing:latest 2>/dev/null || true
|
|
@podman rmi -f debian-atomic-debian-bootc-base:latest 2>/dev/null || true
|
|
@rm -rf {{output_dir}}
|
|
@echo "Cleanup completed"
|
|
|
|
# Deploy to container registry
|
|
deploy registry_url:
|
|
@echo "Deploying to registry {{registry_url}}..."
|
|
podman tag debian-atomic-base:latest {{registry_url}}/base:latest
|
|
podman push {{registry_url}}/base:latest
|
|
|
|
for variant_dir in variants/*/; do \
|
|
if [ -d "$$variant_dir" ]; then \
|
|
variant_name=$$(basename "$$variant_dir"); \
|
|
echo "Deploying $$variant_name..."; \
|
|
podman tag debian-atomic-$$variant_name:latest {{registry_url}}/$$variant_name:latest; \
|
|
podman push {{registry_url}}/$$variant_name:latest; \
|
|
fi; \
|
|
done
|
|
@echo "Deployment completed"
|
|
|
|
# Deploy specific variant
|
|
deploy-variant variant registry_url:
|
|
@echo "Deploying {{variant}} variant to {{registry_url}}..."
|
|
if [ -d "variants/{{variant}}" ]; then \
|
|
podman tag debian-atomic-{{variant}}:latest {{registry_url}}/{{variant}}:latest; \
|
|
podman push {{registry_url}}/{{variant}}:latest; \
|
|
echo "{{variant}} variant deployed successfully"; \
|
|
else \
|
|
echo "Variant {{variant}} not found"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
# Build and deploy in one command
|
|
build-deploy variant registry_url:
|
|
@echo "Building and deploying {{variant}} variant..."
|
|
just compose-{{variant}}
|
|
just deploy-variant variant={{variant}} registry={{registry_url}}
|
|
|
|
# Validate variant configuration
|
|
validate variant:
|
|
@echo "Validating {{variant}} variant configuration..."
|
|
if [ -d "variants/{{variant}}" ]; then \
|
|
if [ -f "variants/{{variant}}/Containerfile" ]; then \
|
|
echo "✓ Containerfile found"; \
|
|
else \
|
|
echo "✗ Containerfile missing"; \
|
|
exit 1; \
|
|
fi; \
|
|
echo "{{variant}} variant validation completed"; \
|
|
else \
|
|
echo "Variant {{variant}} not found"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
# Validate all variants
|
|
validate-all:
|
|
@echo "Validating all variants..."
|
|
for variant_dir in variants/*/; do \
|
|
if [ -d "$$variant_dir" ]; then \
|
|
variant_name=$$(basename "$$variant_dir"); \
|
|
echo "Validating $$variant_name..."; \
|
|
just validate variant=$$variant_name; \
|
|
fi; \
|
|
done
|
|
@echo "All variants validated successfully"
|
|
|
|
# Show variant status
|
|
status:
|
|
@echo "Debian Atomic Variant Status"
|
|
@echo "============================"
|
|
@echo "Base images:"
|
|
@bash -c 'if podman images | grep -q "debian-atomic-base"; then echo " base: ✓ Built"; else echo " base: ✗ Not built"; fi'
|
|
@bash -c 'if podman images | grep -q "debian-atomic-base-forky"; then echo " base-forky: ✓ Built"; else echo " base-forky: ✗ Not built"; fi'
|
|
@bash -c 'if podman images | grep -q "debian-atomic-debian-bootc-base"; then echo " debian-bootc-base: ✓ Built"; else echo " debian-bootc-base: ✗ Not built"; fi'
|
|
@echo ""
|
|
@echo "Variants:"
|
|
@bash -c 'for variant in base workstation server testing debian-bootc-base; do if podman images | grep -q "debian-atomic-$variant"; then echo " $variant: ✓ Built"; else echo " $variant: ✗ Not built"; fi; done'
|
|
|
|
# Help recipe
|
|
help:
|
|
@echo "Debian Atomic Build System Help"
|
|
@echo "==============================="
|
|
@echo ""
|
|
@echo "This justfile provides Fedora Atomic 1:1 parallel build recipes for Debian Atomic."
|
|
@echo ""
|
|
@echo "Key Concepts:"
|
|
@echo " - compose-base: Build base Debian images"
|
|
@echo " - compose-variants: Build all variants"
|
|
@echo " - compose-debian-bootc-base: Build bootc-compatible base image"
|
|
@echo " - sync-comps: Sync with Debian package groups"
|
|
@echo " - build-iso: Create bootable disk images using bootc-image-builder"
|
|
@echo ""
|
|
@echo "Workflow:"
|
|
@echo " 1. just compose-base # Build base image"
|
|
@echo " 2. just compose-debian-bootc-base # Build bootc base"
|
|
@echo " 3. just compose-variants # Build all variants"
|
|
@echo " 4. just deploy git.raines.xyz/robojerk # Deploy to registry"
|
|
@echo ""
|
|
@echo "For more information, see the Debian Atomic documentation."
|