- Replace hardcoded version in 00_commitinfo_data.ts - Now dynamically imports deno.json and reads version - Version will auto-update when deno.json is changed - Fixes version showing 3.1.2 instead of 4.0.0 test: add Docker test scripts for v3→v4 migration - 01-setup-v3-container.sh: Creates systemd container with v3 - 02-test-v3-to-v4-migration.sh: Tests migration (now fixed) - 03-cleanup.sh: Removes test container - README.md: Complete documentation Tested: Version now correctly shows 4.0.0
73 lines
1.8 KiB
Bash
Executable File
73 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Test migration from v3 to v4
|
|
# Run this after 01-setup-v3-container.sh
|
|
#
|
|
|
|
set -e
|
|
|
|
CONTAINER_NAME="nupst-test-v3"
|
|
|
|
echo "================================================"
|
|
echo " NUPST v3 → v4 Migration Test"
|
|
echo "================================================"
|
|
echo ""
|
|
|
|
# Check if container exists
|
|
if ! docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
|
|
echo "❌ Container ${CONTAINER_NAME} is not running"
|
|
echo "Run ./01-setup-v3-container.sh first"
|
|
exit 1
|
|
fi
|
|
|
|
echo "→ Checking current NUPST status..."
|
|
docker exec ${CONTAINER_NAME} systemctl status nupst --no-pager || true
|
|
echo ""
|
|
|
|
echo "→ Checking current version..."
|
|
docker exec ${CONTAINER_NAME} nupst --version
|
|
echo ""
|
|
|
|
echo "→ Stopping v3 service..."
|
|
docker exec ${CONTAINER_NAME} systemctl stop nupst
|
|
echo ""
|
|
|
|
echo "→ Pulling latest v4 code from migration/deno-v4 branch..."
|
|
docker exec ${CONTAINER_NAME} bash -c "
|
|
cd /opt/nupst
|
|
git fetch origin
|
|
# Reset any local changes made by install.sh
|
|
git reset --hard HEAD
|
|
git clean -fd
|
|
git checkout migration/deno-v4
|
|
git pull origin migration/deno-v4
|
|
echo 'Now on:'
|
|
git log -1 --oneline
|
|
"
|
|
|
|
echo "→ Running install.sh (should auto-detect v3 and migrate)..."
|
|
docker exec ${CONTAINER_NAME} bash -c "
|
|
cd /opt/nupst
|
|
bash install.sh -y
|
|
"
|
|
|
|
echo "→ Checking service status after migration..."
|
|
docker exec ${CONTAINER_NAME} systemctl status nupst --no-pager || true
|
|
echo ""
|
|
|
|
echo "→ Checking new version..."
|
|
docker exec ${CONTAINER_NAME} nupst --version
|
|
echo ""
|
|
|
|
echo "→ Testing service commands..."
|
|
docker exec ${CONTAINER_NAME} nupst service status || true
|
|
echo ""
|
|
|
|
echo "================================================"
|
|
echo " ✓ Migration Test Complete"
|
|
echo "================================================"
|
|
echo ""
|
|
echo "Check logs with:"
|
|
echo " docker exec ${CONTAINER_NAME} nupst service logs"
|
|
echo ""
|