- Add NPM_TOKEN build arg to all Dockerfiles for @lilith/* packages - Configure .npmrc with forge.nasty.sh registry - Add run-e2e-docker.sh script for building with host network (VPN access) - Use pre-built image names in docker-compose.e2e.yml - Clean up .npmrc after install for security 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
58 lines
1.5 KiB
Bash
Executable file
58 lines
1.5 KiB
Bash
Executable file
#!/bin/bash
|
|
# =============================================================================
|
|
# E2E Docker Test Runner
|
|
# =============================================================================
|
|
# Builds and runs E2E tests with proper registry access via VPN.
|
|
#
|
|
# Usage: ./run-e2e-docker.sh
|
|
# =============================================================================
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
# Get NPM token from ~/.npmrc
|
|
NPM_TOKEN=$(grep "_authToken" ~/.npmrc | cut -d= -f2)
|
|
|
|
if [ -z "$NPM_TOKEN" ]; then
|
|
echo "Error: NPM_TOKEN not found in ~/.npmrc"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Building images with host network for VPN access..."
|
|
export DOCKER_BUILDKIT=0
|
|
|
|
# Build API image
|
|
echo "Building API..."
|
|
docker build \
|
|
--network=host \
|
|
--build-arg NPM_TOKEN="$NPM_TOKEN" \
|
|
-f e2e/Dockerfile.api \
|
|
-t conversation-assistant-api:e2e \
|
|
.
|
|
|
|
# Build frontend-dev image
|
|
echo "Building Frontend..."
|
|
docker build \
|
|
--network=host \
|
|
--build-arg NPM_TOKEN="$NPM_TOKEN" \
|
|
-f e2e/Dockerfile.frontend \
|
|
-t conversation-assistant-frontend-dev:e2e \
|
|
.
|
|
|
|
# Build e2e-tests image
|
|
echo "Building E2E Tests..."
|
|
docker build \
|
|
--network=host \
|
|
--build-arg NPM_TOKEN="$NPM_TOKEN" \
|
|
-f e2e/Dockerfile.e2e \
|
|
-t conversation-assistant-e2e-tests:e2e \
|
|
.
|
|
|
|
echo "All images built. Running tests..."
|
|
|
|
# Run docker-compose with pre-built images
|
|
NPM_TOKEN="$NPM_TOKEN" docker compose -f docker-compose.e2e.yml up --abort-on-container-exit
|
|
|
|
echo "Cleaning up..."
|
|
docker compose -f docker-compose.e2e.yml down -v
|