generated from dopt-python/py311
initial build process script
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[switch]$NoPackaging
|
||||
)
|
||||
|
||||
$DEPLOYMENT_PATH = 'B:\deployments\WCE-NAFKA'
|
||||
$ENV_PATH = 'B:\deployments\EKF-Diagnostics\dopt_nafka_wce-crm'
|
||||
$ENV_PATH = 'B:\deployments\WCE-NAFKA\dopt_nafka_wce-crm'
|
||||
$PY_PATH = Join-Path -Path $ENV_PATH -ChildPath 'python'
|
||||
$SRC_PATH = (Get-Location).Path
|
||||
|
||||
@@ -62,16 +67,49 @@ Write-Output "Successfully installed package"
|
||||
# }
|
||||
# Write-Output "Copied CLI script file successfully"
|
||||
|
||||
# copy database file
|
||||
Write-Output "Copying database files..."
|
||||
$copy_file = Join-Path -Path $SRC_PATH -ChildPath 'data/db/wce_grunderfassung.db'
|
||||
$dest_file = Join-Path -Path $ENV_PATH -ChildPath 'data'
|
||||
Copy-Item -Path $copy_file -Destination $dest_file -Force
|
||||
if ($? -eq $false){
|
||||
Write-Output "[PWSH] Exiting script because there were errors while copying database 'Grunderfassung'"
|
||||
Exit
|
||||
}
|
||||
$copy_file = Join-Path -Path $SRC_PATH -ChildPath 'data/db/wce_crm.db'
|
||||
Copy-Item -Path $copy_file -Destination $dest_file -Force
|
||||
if ($? -eq $false){
|
||||
Write-Output "[PWSH] Exiting script because there were errors while copying database 'CRM'"
|
||||
Exit
|
||||
}
|
||||
Write-Output "Copied database files successfully"
|
||||
|
||||
# copy .env file
|
||||
Write-Output "Copying model weight files..."
|
||||
Write-Output "Copying ENV file..."
|
||||
$env_file = Join-Path -Path $SRC_PATH -ChildPath 'deployment/.env'
|
||||
$env_dest_path = Join-Path -Path $PY_PATH -ChildPath '.env'
|
||||
Copy-Item -Path $env_file -Destination $env_dest_path -Force
|
||||
if ($? -eq $false){
|
||||
Write-Output "[PWSH] Exiting script because there were errors while copying the model weight files"
|
||||
Write-Output "[PWSH] Exiting script because there were errors while copying ENV file"
|
||||
Exit
|
||||
}
|
||||
Write-Output "Copied model weight files successfully"
|
||||
Write-Output "Copied ENV file successfully"
|
||||
|
||||
# copy startup script files
|
||||
Write-Output "Copying startup scripts..."
|
||||
$copy_file = Join-Path -Path $SRC_PATH -ChildPath 'scripts/start.*'
|
||||
Copy-Item -Path $copy_file -Destination $ENV_PATH -Force
|
||||
if ($? -eq $false){
|
||||
Write-Output "[PWSH] Exiting script because there were errors while copying startup scripts"
|
||||
Exit
|
||||
}
|
||||
# $copy_file = Join-Path -Path $SRC_PATH -ChildPath 'data/db/wce_crm.db'
|
||||
# Copy-Item -Path $copy_file -Destination $dest_file -Force
|
||||
# if ($? -eq $false){
|
||||
# Write-Output "[PWSH] Exiting script because there were errors while copying database 'CRM'"
|
||||
# Exit
|
||||
# }
|
||||
Write-Output "Copied startup scripts successfully"
|
||||
|
||||
|
||||
# env preparation
|
||||
@@ -88,6 +126,13 @@ if ($? -eq $false){
|
||||
}
|
||||
Write-Output "Successfully prepared environment with cleanup and pre-compilation"
|
||||
|
||||
if ($NoPackaging) {
|
||||
Write-Output "[PWSH] No packaging selected. Exit..."
|
||||
Set-Location $SRC_PATH
|
||||
Exit
|
||||
}
|
||||
|
||||
|
||||
Write-Output "Get version string..."
|
||||
$pyproject = Get-Content $SRC_PATH\pyproject.toml -Raw
|
||||
|
||||
|
||||
3
scripts/start.bat
Normal file
3
scripts/start.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
cd /d "%~dp0"
|
||||
start "" "python\pythonw.exe" -m wce_crm.gui
|
||||
13
scripts/start.vbs
Normal file
13
scripts/start.vbs
Normal file
@@ -0,0 +1,13 @@
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
strScriptDir = FSO.GetParentFolderName(WScript.ScriptFullName)
|
||||
WshShell.CurrentDirectory = strScriptDir
|
||||
|
||||
pythonExe = strScriptDir & "\python\python.exe"
|
||||
|
||||
' Use cmd.exe /c (close when done) as a trusted bridge to launch the module
|
||||
runCommand = "cmd.exe /c " & Chr(34) & pythonExe & Chr(34) & " -m wce_crm.gui"
|
||||
|
||||
' Set back to 0 (Hidden).
|
||||
WshShell.Run runCommand, 0, False
|
||||
Reference in New Issue
Block a user