diff --git a/.env.development b/.env.development index 5b2977837..63bf2a1f9 100644 --- a/.env.development +++ b/.env.development @@ -25,4 +25,4 @@ NEXT_PUBLIC_USE_MOCKS=true NEXT_PUBLIC_BASE_PATH=/talas5 # Oder leer lassen für direkten Zugriff -> NEXT_PUBLIC_BASE_PATH= # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.1.305 +NEXT_PUBLIC_APP_VERSION=1.1.306 diff --git a/.env.production b/.env.production index 60bd23f7e..6f830332a 100644 --- a/.env.production +++ b/.env.production @@ -26,4 +26,4 @@ NEXT_PUBLIC_BASE_PATH=/talas5 # Oder leer lassen für direkten Zugriff -> NEXT_PUBLIC_BASE_PATH= # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.1.305 \ No newline at end of file +NEXT_PUBLIC_APP_VERSION=1.1.306 \ No newline at end of file diff --git a/nodemap-1.1.305.zip b/nodemap-1.1.305.zip new file mode 100644 index 000000000..d653fb146 Binary files /dev/null and b/nodemap-1.1.305.zip differ diff --git a/package-lock.json b/package-lock.json index 482923b63..5d08177fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nodemap", - "version": "1.1.305", + "version": "1.1.306", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nodemap", - "version": "1.1.305", + "version": "1.1.306", "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", diff --git a/package.json b/package.json index b1e940d90..6e565c7fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodemap", - "version": "1.1.305", + "version": "1.1.306", "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", @@ -39,6 +39,8 @@ "scripts": { "dev": "node server.js", "build": "next build", + "build:deploy": "next build && npm run create-zip", + "create-zip": "powershell -ExecutionPolicy Bypass -File ./scripts/create-deployment-zip.ps1", "start": "cross-env NODE_ENV=production node server.js", "export": "next export", "test": "jest", diff --git a/scripts/create-deployment-zip.ps1 b/scripts/create-deployment-zip.ps1 new file mode 100644 index 000000000..00215f82a --- /dev/null +++ b/scripts/create-deployment-zip.ps1 @@ -0,0 +1,105 @@ +# PowerShell Script to create deployment ZIP after successful build +param( + [string]$ProjectRoot = $PSScriptRoot + "\.." +) + +# Read package.json to get name and version +$packageJsonPath = Join-Path $ProjectRoot "package.json" +$packageJson = Get-Content $packageJsonPath | ConvertFrom-Json +$projectName = $packageJson.name +$version = $packageJson.version + +# Create ZIP filename +$zipFileName = "${projectName}-${version}.zip" +$zipPath = Join-Path $ProjectRoot $zipFileName + +# Remove existing ZIP if it exists +if (Test-Path $zipPath) { + Remove-Item $zipPath -Force + Write-Host "[DELETE] Removed existing ZIP: $zipFileName" -ForegroundColor Yellow +} + +# Define files and directories to include +$itemsToInclude = @( + ".next", + "public", + ".env.production", + "server.js", + "nssm.exe", + "nssm.exe Installation.md", + "package.json", + "package-lock.json", + "Start-Dev.ps1", + "StartNodeApp.bat" +) + +# Check which items exist +$existingItems = @() +foreach ($item in $itemsToInclude) { + $itemPath = Join-Path $ProjectRoot $item + if (Test-Path $itemPath) { + $existingItems += $item + Write-Host "[FOUND] $item" -ForegroundColor Green + } else { + Write-Host "[MISSING] $item" -ForegroundColor Yellow + } +} + +if ($existingItems.Count -eq 0) { + Write-Host "[ERROR] No items found to include in ZIP!" -ForegroundColor Red + exit 1 +} + +# Create temporary directory for ZIP contents +$tempDir = Join-Path $ProjectRoot "temp-deployment" +if (Test-Path $tempDir) { + Remove-Item $tempDir -Recurse -Force +} +New-Item -ItemType Directory -Path $tempDir | Out-Null + +# Copy items to temporary directory +foreach ($item in $existingItems) { + $sourcePath = Join-Path $ProjectRoot $item + $destPath = Join-Path $tempDir $item + + if (Test-Path $sourcePath -PathType Container) { + # It's a directory + Copy-Item $sourcePath $destPath -Recurse -Force + Write-Host "[COPY DIR] $item" -ForegroundColor Cyan + } else { + # It's a file + Copy-Item $sourcePath $destPath -Force + Write-Host "[COPY FILE] $item" -ForegroundColor Cyan + } +} + +# Create ZIP file +try { + Write-Host "[CREATE] Creating ZIP: $zipFileName..." -ForegroundColor Blue + + # Use .NET compression to create ZIP + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::CreateFromDirectory($tempDir, $zipPath) + + # Get ZIP file size + $zipSize = (Get-Item $zipPath).Length + $zipSizeMB = [math]::Round($zipSize / 1MB, 2) + + Write-Host "[SUCCESS] Successfully created deployment ZIP!" -ForegroundColor Green + Write-Host "[FILE] $zipFileName" -ForegroundColor White + Write-Host "[SIZE] $zipSizeMB MB" -ForegroundColor White + Write-Host "[LOCATION] $zipPath" -ForegroundColor White + +} catch { + Write-Host "[ERROR] Failed to create ZIP: $($_.Exception.Message)" -ForegroundColor Red + exit 1 +} finally { + # Clean up temporary directory + if (Test-Path $tempDir) { + Remove-Item $tempDir -Recurse -Force + Write-Host "[CLEANUP] Cleaned up temporary files" -ForegroundColor Gray + } +} + +Write-Host "" +Write-Host "[COMPLETE] Deployment ZIP ready for production deployment!" -ForegroundColor Green