Files
euchre_camp/scripts/build-ci-image.sh
T

45 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Build and test the CI runner image locally
set -e
IMAGE_NAME="euchre-camp-ci"
TAG="${1:-latest}"
echo "Building CI runner image..."
echo "Image: ${IMAGE_NAME}:${TAG}"
echo ""
# Build the image
docker build \
-f Dockerfile.ci \
-t ${IMAGE_NAME}:${TAG} \
.
echo ""
echo "✅ Image built successfully!"
echo ""
# Test the image
echo "Testing CI image..."
docker run --rm ${IMAGE_NAME}:${TAG} sh -c "
echo 'Node.js version:' && node --version
echo 'npm version:' && npm --version
echo 'Git version:' && git --version
echo 'Prisma version:' && npx prisma --version
echo ''
echo 'Installed packages (top 10):'
npm list --depth=0 | head -10
"
echo ""
echo "✅ CI image is ready to use!"
echo ""
echo "To use in GitHub Actions/Gitea Actions:"
echo " container:"
echo " image: ${IMAGE_NAME}:${TAG}"
echo ""
echo "To push to registry:"
echo " docker tag ${IMAGE_NAME}:${TAG} registry.example.com/${IMAGE_NAME}:${TAG}"
echo " docker push registry.example.com/${IMAGE_NAME}:${TAG}"