94 lines
2.8 KiB
Makefile
94 lines
2.8 KiB
Makefile
#!/usr/bin/env just --justfile
|
|
|
|
# Simple CLI - particle-os build automation
|
|
# Based on Aurora's Justfile pattern
|
|
|
|
# Default recipe to display help
|
|
default:
|
|
@just --list
|
|
|
|
# Build the container image
|
|
build:
|
|
#!/usr/bin/env bash
|
|
echo "Building Simple CLI container image..."
|
|
podman build -f Containerfile -t localhost/simple-cli:latest .
|
|
echo "Build complete: localhost/simple-cli:latest"
|
|
|
|
# Build and push to registry
|
|
build-push registry="localhost":
|
|
#!/usr/bin/env bash
|
|
echo "Building and pushing to {{registry}}..."
|
|
podman build -f Containerfile -t {{registry}}/simple-cli:latest .
|
|
podman push {{registry}}/simple-cli:latest
|
|
echo "Pushed to {{registry}}/simple-cli:latest"
|
|
|
|
# Generate bootable image using bootc-image-builder
|
|
generate-bootable:
|
|
#!/usr/bin/env bash
|
|
echo "Generating bootable image..."
|
|
mkdir -p output
|
|
podman run --rm --privileged \
|
|
-v $PWD/output:/output \
|
|
-v /var/lib/containers/storage:/var/lib/containers/storage \
|
|
quay.io/centos-bootc/bootc-image-builder:latest \
|
|
--type iso,raw \
|
|
--output /output \
|
|
localhost/simple-cli:latest
|
|
echo "Bootable image generated in output/"
|
|
|
|
# Test the container
|
|
test:
|
|
#!/usr/bin/env bash
|
|
echo "Testing Simple CLI container..."
|
|
podman run --rm localhost/simple-cli:latest \
|
|
bash -c "echo 'System info:' && uname -a && echo 'Packages:' && dpkg -l | wc -l"
|
|
echo "Test complete"
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
#!/usr/bin/env bash
|
|
echo "Cleaning build artifacts..."
|
|
rm -rf output/
|
|
podman image prune -f
|
|
podman system prune -f
|
|
echo "Cleanup complete"
|
|
|
|
# Install ujust recipes for end users
|
|
install-ujust:
|
|
#!/usr/bin/env bash
|
|
sudo mkdir -p /usr/share/particle-os/just
|
|
sudo cp -r usr/share/particle-os/just/* /usr/share/particle-os/just/
|
|
echo "ujust recipes installed system-wide"
|
|
|
|
# Validate the recipe
|
|
validate:
|
|
#!/usr/bin/env bash
|
|
echo "Validating recipe.yml..."
|
|
if command -v bluebuild >/dev/null 2>&1; then
|
|
bluebuild validate recipe.yml
|
|
else
|
|
echo "bluebuild not installed, skipping validation"
|
|
fi
|
|
|
|
# Full build pipeline
|
|
pipeline: build test generate-bootable
|
|
@echo "Full build pipeline completed"
|
|
|
|
# Development environment setup
|
|
setup-dev:
|
|
#!/usr/bin/env bash
|
|
echo "Setting up development environment..."
|
|
sudo apt update
|
|
sudo apt install -y podman just
|
|
echo "Development environment ready"
|
|
|
|
# Show system information
|
|
info:
|
|
#!/usr/bin/env bash
|
|
echo "=== Simple CLI System Information ==="
|
|
echo "Container image: localhost/simple-cli:latest"
|
|
echo "Base: Debian Trixie"
|
|
echo "Architecture: particle-os with OSTree"
|
|
echo "Bootloader: bootupd"
|
|
echo "Kernel: linux-image-amd64"
|
|
echo "================================"
|