tududi/scripts/test-docker-build.sh
Chris 03f38f05dc
Setup intelligence (#84)
* Add next suggestions and remove console logs

* Add pomodoro timer

* Add pomodoro switch in settings

* Fix pomodoro setting

* Add timezones to settings

* Fix an issue with password reset

* Cleanup

* Sort tags alphabetically

* Clean up today's view

* Add an indicator for repeatedly added to today

* Refactor tags

* Add due date today item

* Move recurrence to the subtitle area

* Fix today layout

* Add a badge to Inbox items

* Move inbox badge to sidebar

* Add quotes and progress bar

* Add translations for quotes

* Fix test issues

* Add helper script for docker local

* Set up overdue tasks

* Add  linux/arm/v7 build to deploy script

* Add  linux/arm/v7 build to deploy script pt2

* Fix an issue with helmet and SSL

* Add volume db persistence

* Fix cog icon issues
2025-06-27 14:02:18 +03:00

54 lines
No EOL
1.3 KiB
Bash
Executable file

#!/bin/bash
# Simple Docker build test script with version tagging
set -e
VERSION=${1:-"latest"}
IMAGE_NAME="tududi-test:$VERSION"
CONTAINER_NAME="tududi-test-$VERSION"
TEST_PORT="3003"
echo "🐳 Testing Docker build for version: $VERSION"
# Cleanup existing
docker stop "$CONTAINER_NAME" 2>/dev/null || true
docker rm "$CONTAINER_NAME" 2>/dev/null || true
# Build image with version tag
echo "📦 Building image: $IMAGE_NAME"
docker build -t "$IMAGE_NAME" .
# Test container
echo "🚀 Starting container..."
docker run -d \
--name "$CONTAINER_NAME" \
-p "$TEST_PORT:3002" \
-e TUDUDI_USER_EMAIL=test@example.com \
-e TUDUDI_USER_PASSWORD=testpass123 \
-e NODE_ENV=production \
"$IMAGE_NAME"
# Wait and test health
echo "⏳ Waiting for startup..."
sleep 15
if curl -f "http://localhost:$TEST_PORT/api/health" > /dev/null 2>&1; then
echo "✅ Health check passed for $VERSION!"
echo "🌐 App running at http://localhost:$TEST_PORT"
read -p "Keep running? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
docker stop "$CONTAINER_NAME"
docker rm "$CONTAINER_NAME"
echo "🧹 Cleaned up"
else
echo "🏃 Container $CONTAINER_NAME still running"
fi
else
echo "❌ Health check failed for $VERSION"
docker logs "$CONTAINER_NAME"
docker stop "$CONTAINER_NAME"
docker rm "$CONTAINER_NAME"
exit 1
fi