chore: add script for building CI image locally
This commit is contained in:
Executable
+44
@@ -0,0 +1,44 @@
|
|||||||
|
#!/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}"
|
||||||
Reference in New Issue
Block a user