4 Commits

Author SHA1 Message Date
Torsten Schulz (local)
fddde56076 Update package version to 1.1.6 and enhance deploy script with dependency checks
Some checks failed
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m29s
Code Analysis and Production Deploy / analyze (pull_request) Successful in 3m7s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
Require Package Version Change / check (pull_request) Failing after 11s
- Bumped the package version to 1.1.6 in package.json.
- Added `install_dependencies_if_needed` function in deploy-test.sh to conditionally install dependencies based on the state of package-lock.json.
- Improved logging of build output to a file for better error tracking during deployment.
- Updated Nuxt cache handling to retain .nuxt directory for faster builds unless explicitly cleaned.
2026-05-06 16:03:16 +02:00
Torsten Schulz (local)
c385df4a0c Add dependency installation check and logging to deploy script
All checks were successful
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m54s
- Introduced `install_dependencies_if_needed` function to conditionally install dependencies based on the presence and changes in `package-lock.json`.
- Updated the deployment process to log build output to a file for better error tracking.
- Modified Nuxt configuration to disable source maps in production and prevent reporting of compressed sizes in Vite builds.
2026-05-06 15:58:02 +02:00
Torsten Schulz (local)
e44d3c5c74 Update package version to 1.1.5 in package.json
All checks were successful
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m5s
Code Analysis and Production Deploy / analyze (pull_request) Successful in 3m35s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
Require Package Version Change / check (pull_request) Successful in 11s
2026-05-05 15:14:38 +02:00
Torsten Schulz (local)
c409fa6d4b Update candidate paths for CSV file retrieval in mannschaften.get.js
Some checks failed
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been cancelled
- Adjusted the logic to prioritize the new CMS write target for public data.
- Updated comments to clarify the order of candidate paths for file retrieval.
2026-05-05 15:13:22 +02:00
5 changed files with 120 additions and 30 deletions

View File

@@ -64,6 +64,37 @@ install_dependencies() {
fi fi
} }
install_dependencies_if_needed() {
local cache_dir=".deploy-cache"
local lock_hash_file="$cache_dir/package-lock.sha256"
local current_lock_hash=""
local previous_lock_hash=""
if [ ! -f "package-lock.json" ]; then
echo " package-lock.json fehlt, führe npm install aus..."
install_dependencies
return 0
fi
mkdir -p "$cache_dir"
current_lock_hash="$(sha256sum package-lock.json | awk '{print $1}')"
if [ -f "$lock_hash_file" ]; then
previous_lock_hash="$(cat "$lock_hash_file" 2>/dev/null || true)"
fi
if [ ! -d "node_modules" ]; then
echo " node_modules fehlt, installiere Dependencies..."
install_dependencies
elif [ "$current_lock_hash" != "$previous_lock_hash" ]; then
echo " package-lock.json geändert, führe npm ci aus..."
install_dependencies
else
echo " package-lock.json unverändert, überspringe npm ci"
fi
printf '%s\n' "$current_lock_hash" > "$lock_hash_file"
}
use_project_node() { use_project_node() {
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
if [ -s "$NVM_DIR/nvm.sh" ]; then if [ -s "$NVM_DIR/nvm.sh" ]; then
@@ -239,7 +270,7 @@ echo ""
echo "3. Installing dependencies..." echo "3. Installing dependencies..."
use_project_node use_project_node
ensure_node_version ensure_node_version
install_dependencies install_dependencies_if_needed
# 4. Remove old build (but keep data!) # 4. Remove old build (but keep data!)
echo "" echo ""
@@ -262,11 +293,16 @@ if [ -d ".output" ]; then
echo " ✓ .output gelöscht" echo " ✓ .output gelöscht"
fi fi
# Auch .nuxt Cache löschen für sauberen Build # .nuxt standardmäßig behalten (beschleunigt Folge-Builds deutlich).
if [ -d ".nuxt" ]; then # Für erzwungenen Clean-Build: CLEAN_NUXT_CACHE=1 ./deploy-production.sh
echo " Removing .nuxt cache..." if [ "${CLEAN_NUXT_CACHE:-0}" = "1" ]; then
if [ -d ".nuxt" ]; then
echo " CLEAN_NUXT_CACHE=1 gesetzt: entferne .nuxt cache..."
rm -rf .nuxt rm -rf .nuxt
echo " ✓ .nuxt gelöscht" echo " ✓ .nuxt gelöscht"
fi
else
echo " Behalte .nuxt cache für schnelleren Build (CLEAN_NUXT_CACHE=1 für Clean-Build)"
fi fi
# Prüfe, ob node_modules vorhanden ist (für npm run build) # Prüfe, ob node_modules vorhanden ist (für npm run build)
@@ -289,17 +325,20 @@ if [ ! -f "node_modules/.package-lock.json" ] && [ ! -f "package-lock.json" ]; t
install_dependencies install_dependencies
fi fi
# Build mit expliziter Fehlerbehandlung und Output-Capture # Build mit expliziter Fehlerbehandlung und gleichzeitiger Log-Datei
BUILD_OUTPUT=$(npm run build 2>&1) BUILD_LOG_FILE=".deploy-cache/build-$(date +%Y%m%d-%H%M%S).log"
BUILD_EXIT_CODE=$? mkdir -p ".deploy-cache"
if npm run build 2>&1 | tee "$BUILD_LOG_FILE"; then
# Zeige Build-Output BUILD_EXIT_CODE=0
echo "$BUILD_OUTPUT" else
BUILD_EXIT_CODE=$?
fi
if [ "$BUILD_EXIT_CODE" -ne 0 ]; then if [ "$BUILD_EXIT_CODE" -ne 0 ]; then
echo "" echo ""
echo "ERROR: Build fehlgeschlagen mit Exit-Code $BUILD_EXIT_CODE" echo "ERROR: Build fehlgeschlagen mit Exit-Code $BUILD_EXIT_CODE"
echo "Bitte prüfen Sie die Build-Ausgabe oben auf Fehler." echo "Bitte prüfen Sie die Build-Ausgabe oben auf Fehler."
echo "Build-Log: $BUILD_LOG_FILE"
exit 1 exit 1
fi fi
@@ -308,10 +347,11 @@ echo " Synchronizing public documents into build output..."
sync_public_documents_to_build sync_public_documents_to_build
# Prüfe auf Warnungen im Build-Output, die auf Probleme hinweisen # Prüfe auf Warnungen im Build-Output, die auf Probleme hinweisen
if echo "$BUILD_OUTPUT" | grep -qi "error\|failed\|missing"; then if rg -i "error|failed|missing" "$BUILD_LOG_FILE" >/dev/null 2>&1; then
echo "" echo ""
echo "WARNING: Build-Output enthält möglicherweise Fehler oder Warnungen." echo "WARNING: Build-Output enthält möglicherweise Fehler oder Warnungen."
echo "Bitte prüfen Sie die Ausgabe oben." echo "Bitte prüfen Sie die Ausgabe oben."
echo "Build-Log: $BUILD_LOG_FILE"
fi fi
# Prüfe, ob der Build erfolgreich war - mehrere Checks # Prüfe, ob der Build erfolgreich war - mehrere Checks

View File

@@ -77,6 +77,37 @@ install_dependencies() {
fi fi
} }
install_dependencies_if_needed() {
local cache_dir=".deploy-cache"
local lock_hash_file="$cache_dir/package-lock.sha256"
local current_lock_hash=""
local previous_lock_hash=""
if [ ! -f "package-lock.json" ]; then
echo " package-lock.json fehlt, führe npm install aus..."
install_dependencies
return 0
fi
mkdir -p "$cache_dir"
current_lock_hash="$(sha256sum package-lock.json | awk '{print $1}')"
if [ -f "$lock_hash_file" ]; then
previous_lock_hash="$(cat "$lock_hash_file" 2>/dev/null || true)"
fi
if [ ! -d "node_modules" ]; then
echo " node_modules fehlt, installiere Dependencies..."
install_dependencies
elif [ "$current_lock_hash" != "$previous_lock_hash" ]; then
echo " package-lock.json geändert, führe npm ci aus..."
install_dependencies
else
echo " package-lock.json unverändert, überspringe npm ci"
fi
printf '%s\n' "$current_lock_hash" > "$lock_hash_file"
}
use_project_node() { use_project_node() {
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
if [ -s "$NVM_DIR/nvm.sh" ]; then if [ -s "$NVM_DIR/nvm.sh" ]; then
@@ -245,7 +276,7 @@ echo ""
echo "3. Installing dependencies..." echo "3. Installing dependencies..."
use_project_node use_project_node
ensure_node_version ensure_node_version
install_dependencies install_dependencies_if_needed
# 4. Remove old build (but keep data!) # 4. Remove old build (but keep data!)
echo "" echo ""
@@ -268,11 +299,16 @@ if [ -d ".output" ]; then
echo " ✓ .output gelöscht" echo " ✓ .output gelöscht"
fi fi
# Auch .nuxt Cache löschen für sauberen Build # .nuxt standardmäßig behalten (beschleunigt Folge-Builds deutlich).
if [ -d ".nuxt" ]; then # Für erzwungenen Clean-Build: CLEAN_NUXT_CACHE=1 ./deploy-test.sh
echo " Removing .nuxt cache..." if [ "${CLEAN_NUXT_CACHE:-0}" = "1" ]; then
if [ -d ".nuxt" ]; then
echo " CLEAN_NUXT_CACHE=1 gesetzt: entferne .nuxt cache..."
rm -rf .nuxt rm -rf .nuxt
echo " ✓ .nuxt gelöscht" echo " ✓ .nuxt gelöscht"
fi
else
echo " Behalte .nuxt cache für schnelleren Build (CLEAN_NUXT_CACHE=1 für Clean-Build)"
fi fi
# Prüfe, ob node_modules vorhanden ist (für npm run build) # Prüfe, ob node_modules vorhanden ist (für npm run build)
@@ -295,17 +331,20 @@ if [ ! -f "node_modules/.package-lock.json" ] && [ ! -f "package-lock.json" ]; t
install_dependencies install_dependencies
fi fi
# Build mit expliziter Fehlerbehandlung und Output-Capture # Build mit expliziter Fehlerbehandlung und gleichzeitiger Log-Datei
BUILD_OUTPUT=$(npm run build 2>&1) BUILD_LOG_FILE=".deploy-cache/build-$(date +%Y%m%d-%H%M%S).log"
BUILD_EXIT_CODE=$? mkdir -p ".deploy-cache"
if npm run build 2>&1 | tee "$BUILD_LOG_FILE"; then
# Zeige Build-Output BUILD_EXIT_CODE=0
echo "$BUILD_OUTPUT" else
BUILD_EXIT_CODE=$?
fi
if [ "$BUILD_EXIT_CODE" -ne 0 ]; then if [ "$BUILD_EXIT_CODE" -ne 0 ]; then
echo "" echo ""
echo "ERROR: Build fehlgeschlagen mit Exit-Code $BUILD_EXIT_CODE" echo "ERROR: Build fehlgeschlagen mit Exit-Code $BUILD_EXIT_CODE"
echo "Bitte prüfen Sie die Build-Ausgabe oben auf Fehler." echo "Bitte prüfen Sie die Build-Ausgabe oben auf Fehler."
echo "Build-Log: $BUILD_LOG_FILE"
exit 1 exit 1
fi fi
@@ -314,10 +353,11 @@ echo " Synchronizing public documents into build output..."
sync_public_documents_to_build sync_public_documents_to_build
# Prüfe auf Warnungen im Build-Output, die auf Probleme hinweisen # Prüfe auf Warnungen im Build-Output, die auf Probleme hinweisen
if echo "$BUILD_OUTPUT" | grep -qi "error\|failed\|missing"; then if rg -i "error|failed|missing" "$BUILD_LOG_FILE" >/dev/null 2>&1; then
echo "" echo ""
echo "WARNING: Build-Output enthält möglicherweise Fehler oder Warnungen." echo "WARNING: Build-Output enthält möglicherweise Fehler oder Warnungen."
echo "Bitte prüfen Sie die Ausgabe oben." echo "Bitte prüfen Sie die Ausgabe oben."
echo "Build-Log: $BUILD_LOG_FILE"
fi fi
# Prüfe, ob der Build erfolgreich war - mehrere Checks # Prüfe, ob der Build erfolgreich war - mehrere Checks

View File

@@ -1,12 +1,19 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: { enabled: true }, devtools: { enabled: process.env.NODE_ENV !== 'production' },
modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt'], modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt'],
nitro: { nitro: {
preset: 'node-server', preset: 'node-server',
dev: process.env.NODE_ENV !== 'production' dev: process.env.NODE_ENV !== 'production',
sourceMap: false
},
vite: {
build: {
reportCompressedSize: false
}
}, },
// Erzwinge Dev-Port und Host zuverlässig für `npm run dev` // Erzwinge Dev-Port und Host zuverlässig für `npm run dev`

View File

@@ -1,6 +1,6 @@
{ {
"name": "harheimertc-website", "name": "harheimertc-website",
"version": "1.1.4", "version": "1.1.6",
"description": "Moderne Webseite für den Harheimer Tischtennis Club", "description": "Moderne Webseite für den Harheimer Tischtennis Club",
"private": true, "private": true,
"type": "module", "type": "module",

View File

@@ -15,8 +15,11 @@ export default defineEventHandler(async (event) => {
const cwd = process.cwd() const cwd = process.cwd()
const filename = 'mannschaften.csv' const filename = 'mannschaften.csv'
// Prefer server/data, then .output/public/data, then public/data // Prefer CMS write target first (server/data/public-data),
// then legacy locations.
const candidates = [ const candidates = [
path.join(cwd, 'server/data/public-data', filename),
path.join(cwd, '../server/data/public-data', filename),
path.join(cwd, '.output/server/data', filename), path.join(cwd, '.output/server/data', filename),
path.join(cwd, 'server/data', filename), path.join(cwd, 'server/data', filename),
path.join(cwd, '.output/public/data', filename), path.join(cwd, '.output/public/data', filename),