Add test run and cleanup scripts
This commit is contained in:
20
cleanup.sh
Executable file
20
cleanup.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Cleanup script for HarborForge Test
|
||||
# Removes containers and networks, but keeps images
|
||||
|
||||
set -e
|
||||
|
||||
COMPOSE_FILE="docker-compose-frontend.yml"
|
||||
|
||||
echo "🧹 Cleaning up HarborForge Test containers..."
|
||||
|
||||
# Stop and remove containers, networks (keep images and volumes)
|
||||
docker compose -f "$COMPOSE_FILE" down
|
||||
|
||||
echo "✅ Cleanup complete!"
|
||||
echo ""
|
||||
echo "To also remove volumes (completely clean slate):"
|
||||
echo " docker compose -f $COMPOSE_FILE down -v"
|
||||
echo ""
|
||||
echo "To remove images (free disk space):"
|
||||
echo " docker compose -f $COMPOSE_FILE down --rmi local"
|
||||
26
run-test.sh
Executable file
26
run-test.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# Run test and cleanup afterwards
|
||||
set -e
|
||||
|
||||
COMPOSE_FILE="docker-compose-frontend.yml"
|
||||
|
||||
echo "🚀 Running HarborForge Test..."
|
||||
|
||||
# Clean any previous containers first
|
||||
docker compose -f "$COMPOSE_FILE" down 2>/dev/null || true
|
||||
|
||||
# Run test
|
||||
docker compose -f "$COMPOSE_FILE" run --rm test
|
||||
TEST_EXIT_CODE=$?
|
||||
|
||||
echo ""
|
||||
echo "🧹 Cleaning up containers (keeping images)..."
|
||||
docker compose -f "$COMPOSE_FILE" down
|
||||
|
||||
if [ $TEST_EXIT_CODE -eq 0 ]; then
|
||||
echo "✅ Test passed!"
|
||||
else
|
||||
echo "❌ Test failed with exit code: $TEST_EXIT_CODE"
|
||||
fi
|
||||
|
||||
exit $TEST_EXIT_CODE
|
||||
Reference in New Issue
Block a user