update build pipeline

This commit is contained in:
2026-06-12 11:41:37 +02:00
parent c18f03255b
commit 03fb2a62cd

View File

@@ -11,18 +11,24 @@ $SRC_PATH = (Get-Location).Path
function create_folder { function create_folder {
param ( param (
[string]$base_path, [string]$base_path,
[string]$folder_name [string]$folder_name,
[switch]$recreate
) )
$target_path = Join-Path -Path $base_path -ChildPath $folder_name $target_path = Join-Path -Path $base_path -ChildPath $folder_name
if (-not (Test-Path -Path $target_path)){ $target_path_exists = Test-Path -Path $target_path
if (-not $target_path_exists){
Write-Output "[PWSH] Folder >$folder_name< not existing. Create..." Write-Output "[PWSH] Folder >$folder_name< not existing. Create..."
New-Item -Path $target_path -ItemType Directory New-Item -Path $target_path -ItemType Directory
} }
elseif ($target_path_exists -and $recreate){
Write-Output "[PWSH] Folder >$folder_name< exists, but should be recreated..."
Remove-Item -Path $target_path -Recurse -Force
New-Item -Path $target_path -ItemType Directory
}
else { else {
Write-Output "Folder >$folder_name< already exists." Write-Output "Folder >$folder_name< already exists."
} }
} }
Write-Output "Build Pipeline for d-opt Wattana (wattanalyse) project" Write-Output "Build Pipeline for d-opt Wattana (wattanalyse) project"
@@ -38,7 +44,7 @@ Write-Output "Deleted outstanding artifacts successfully"
Write-Output "Create folders..." Write-Output "Create folders..."
create_folder -base_path $ENV_PATH -folder_name 'data' create_folder -base_path $ENV_PATH -folder_name 'data' -recreate
create_folder -base_path $ENV_PATH -folder_name 'data/logs' create_folder -base_path $ENV_PATH -folder_name 'data/logs'
create_folder -base_path $ENV_PATH -folder_name 'config' create_folder -base_path $ENV_PATH -folder_name 'config'
@@ -62,22 +68,22 @@ if ($? -eq $false){
} }
Write-Output "Built package successfully" Write-Output "Built package successfully"
# TODO documentation # docs
# Write-Output "Generate docs..." Write-Output "Generate docs..."
# .\scripts\cvt_docs.ps1 .\scripts\cvt_docs.ps1
# if ($? -eq $false){ if ($? -eq $false){
# Write-Output "[PWSH] Exiting script because there errors while generating the doc files" Write-Output "[PWSH] Exiting script because there errors while generating the doc files"
# Exit Exit
# } }
# Write-Output "Generated doc files successfully" Write-Output "Generated doc files successfully"
# Write-Output "Copying doc files..." Write-Output "Copying doc files..."
# $docs_src_path = Join-Path -Path $SRC_PATH -ChildPath 'docs\*.pdf' $docs_src_path = Join-Path -Path $SRC_PATH -ChildPath 'docs\*.pdf'
# Copy-Item -Path $docs_src_path -Destination $ENV_PATH -Force Copy-Item -Path $docs_src_path -Destination $ENV_PATH -Force
# if ($? -eq $false){ if ($? -eq $false){
# Write-Output "[PWSH] Exiting script because there were errors while copying the doc files" Write-Output "[PWSH] Exiting script because there were errors while copying the doc files"
# Exit Exit
# } }
# Write-Output "Copied doc files successfully" Write-Output "Copied doc files successfully"
Write-Output "Go into env directory..." Write-Output "Go into env directory..."
@@ -90,6 +96,7 @@ if ($? -eq $false){
} }
Write-Output "Successfully installed package" Write-Output "Successfully installed package"
# TODO check removal
# copy database file # copy database file
# Write-Output "Copying database files..." # Write-Output "Copying database files..."
# $copy_file = Join-Path -Path $SRC_PATH -ChildPath 'data/db/wce_grunderfassung.db' # $copy_file = Join-Path -Path $SRC_PATH -ChildPath 'data/db/wce_grunderfassung.db'
@@ -129,16 +136,16 @@ if ($? -eq $false){
} }
Write-Output "Copied config file successfully" Write-Output "Copied config file successfully"
# TODO check needed?
# copy startup script files # copy startup script files
# Write-Output "Copying startup scripts..." Write-Output "Copying startup scripts..."
# $copy_file = Join-Path -Path $SRC_PATH -ChildPath 'scripts/start.bat' $copy_file = Join-Path -Path $SRC_PATH -ChildPath 'deployment/startup*'
# Copy-Item -Path $copy_file -Destination $ENV_PATH -Force Copy-Item -Path $copy_file -Destination $ENV_PATH -Force
# if ($? -eq $false){ if ($? -eq $false){
# Write-Output "[PWSH] Exiting script because there were errors while copying startup scripts" Write-Output "[PWSH] Exiting script because there were errors while copying startup scripts"
# Exit Exit
# } }
# Write-Output "Copied startup scripts successfully" Write-Output "Copied startup scripts successfully"
# env preparation # env preparation