Release script

This commit is contained in:
Andre Beging
2024-12-04 09:38:33 +01:00
parent 27e92ac552
commit a76a57062e
6 changed files with 67 additions and 1 deletions

3
.gitignore vendored
View File

@@ -36,4 +36,5 @@ Desktop.ini
/Server/Customers.json /Server/Customers.json
/Server/Settings.json /Server/Settings.json
/Server/invoices/ /Server/invoices/
/Server/publish/ /Server/publish/
/Server/release/

13
.idea/easycode.ignore generated Normal file
View File

@@ -0,0 +1,13 @@
node_modules/
dist/
vendor/
cache/
.*/
*.min.*
*.test.*
*.spec.*
*.bundle.*
*.bundle-min.*
*.*.js
*.*.ts
*.log

View File

@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Release - Create and Pack" type="PowerShellRunType" factoryName="PowerShell" scriptUrl="C:\Quelltexte\Privat\TinyInvoice\Script\CreateReleaseArchive.ps1" executablePath="$PROJECT_DIR$/../../../Windows/System32/WindowsPowerShell/v1.0/powershell.exe">
<envs />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Release" run_configuration_type="DotNetFolderPublish" />
</method>
</configuration>
</component>

View File

@@ -0,0 +1,3 @@
@echo off
cd Program
start Server.exe

View File

@@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
IDList=
URL=http://localhost:5000/

View File

@@ -0,0 +1,36 @@
# Setze das Arbeitsverzeichnis auf den Skript-Ordner
Set-Location -Path (Split-Path -Parent $MyInvocation.MyCommand.Definition)
# Relative Pfade definieren
$sourceConfigPath = "..\DefaultConfig"
$releasePath = "..\Server\release"
$serverExePath = "..\Server\release\Program\Server.exe"
# Ziel-ZIP-Datei basierend auf der Version der Server.exe
if (-Not (Test-Path -Path $serverExePath)) {
Write-Error "Die Datei $serverExePath wurde nicht gefunden."
exit 1
}
# Version der Server.exe auslesen
$fileVersionInfo = (Get-Item $serverExePath).VersionInfo
$zipFileName = "Release_$($fileVersionInfo.FileVersion).zip"
$zipFilePath = Join-Path $releasePath $zipFileName
# Sicherstellen, dass das Release-Verzeichnis existiert
if (-Not (Test-Path -Path $releasePath)) {
New-Item -ItemType Directory -Path $releasePath | Out-Null
}
# Dateien aus DefaultConfig ins Release-Verzeichnis kopieren
Copy-Item -Path $sourceConfigPath\* -Destination $releasePath -Recurse -Force
# Vorhandene ZIP-Datei mit demselben Namen löschen (falls vorhanden)
if (Test-Path -Path $zipFilePath) {
Remove-Item -Path $zipFilePath -Force
}
# Alle Dateien im Release-Verzeichnis zippen
Compress-Archive -Path "$releasePath\*" -DestinationPath $zipFilePath
Write-Host "ZIP-Archiv wurde erstellt: $zipFilePath"