debian-forge-cli/Containerfile.test
2025-08-26 10:33:28 -07:00

49 lines
1.1 KiB
Text

# Debian Forge CLI Test Container
FROM golang:1.23-bullseye
# Install system dependencies
RUN apt-get update && apt-get install -y \
libgpgme-dev \
libbtrfs-dev \
pkg-config \
build-essential \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /workspace
# Copy source code
COPY . .
# Download dependencies
RUN go mod download
# Build the CLI
RUN go build -o debian-forge-cli ./cmd/image-builder
# Make it executable
RUN chmod +x debian-forge-cli
# Create test script
RUN echo '#!/bin/bash\n\
echo "Testing Debian Forge CLI..."\n\
echo "============================="\n\
echo ""\n\
echo "1. Testing CLI help:"\n\
./debian-forge-cli --help\n\
echo ""\n\
echo "2. Testing list images:"\n\
./debian-forge-cli list-images --help\n\
echo ""\n\
echo "3. Testing build command:"\n\
./debian-forge-cli build --help\n\
echo ""\n\
echo "4. CLI version info:"\n\
./debian-forge-cli --version || echo "No version command available"\n\
echo ""\n\
echo "All CLI tests completed!"' > test-cli.sh && chmod +x test-cli.sh
# Set entrypoint
ENTRYPOINT ["./test-cli.sh"]