Compare commits

..

No commits in common. "8e466e7d4f126156fc9b751eea97a300cd4e8980" and "6a71e9188f9a169128ec48e6135e7c7f1b7bd903" have entirely different histories.

143 changed files with 91 additions and 276 deletions

View File

@ -1,7 +1,7 @@
;iss ;iss
#define MyAppName "基础环境" #define MyAppName "基础环境"
#define MyAppVersion "1.0.1" #define MyAppVersion "1.0.0"
#define MyAppPublisher "X" #define MyAppPublisher "X"
#define MyAppURL "~" #define MyAppURL "~"
#define MyAppExeName "command" #define MyAppExeName "command"
@ -18,7 +18,7 @@
; 默认配置 ; 默认配置
[Setup] [Setup]
; 不得复用每个应用必须有唯一AppId ; 不得复用每个应用必须有唯一AppId
AppId={{517C2278-C7C9-43D0-8E94-BFD2039C1690} AppId={{517C2278-C7C9-43D0-8E94-BFD2039C7BB8}
; 默认安装路径 ; 默认安装路径
DefaultDirName={autopf}\{#MyAppFirstPath} DefaultDirName={autopf}\{#MyAppFirstPath}
; 是否加密 ; 是否加密
@ -88,12 +88,12 @@ Name: "custom"; Description: "自定义组件安装"; Flags: iscustom;
[Components] [Components]
;; ============================================== 自定义组件的 Types 可以不参与任何固定式 ============================================== ;; ============================================== 自定义组件的 Types 可以不参与任何固定式 ==============================================
Name: "MainApp"; Description: "{#MyAppName}主程序"; Types: full mini; Flags: checkablealone; Name: "MainApp"; Description: "{#MyAppName}主程序"; Types: full mini; Flags: checkablealone;
Name: "JDK"; Description: "JDK"; Types: full; Flags: checkablealone; Name: "JDK"; Description: "JDK程序"; Types: full; Flags: checkablealone;
Name: "Redis"; Description: "Redis"; Types: full; Flags: checkablealone; Name: "Redis"; Description: "Redis程序"; Types: full; Flags: checkablealone;
Name: "MinIO"; Description: "MinIO"; Types: full; Flags: checkablealone; Name: "MinIO"; Description: "MinIO程序"; Types: full; Flags: checkablealone;
Name: "RocketMQ"; Description: "RocketMQ"; Types: full; Flags: checkablealone; Name: "RocketMQ"; Description: "RocketMQ程序"; Types: full; Flags: checkablealone;
Name: "Nginx"; Description: "Nginx"; Types: full; Flags: checkablealone; Name: "Nginx"; Description: "Nginx程序"; Types: full; Flags: checkablealone;
Name: "MySQL"; Description: "MySQL"; Types: full; Flags: checkablealone; Name: "MySQL"; Description: "MySQL程序"; Types: full; Flags: checkablealone;
;; 引入文件列表 ;; 引入文件列表

View File

@ -1,7 +1,7 @@
;iss ;iss
#define MyAppName "基础环境" #define MyAppName "基础环境"
#define MyAppVersion "1.0.1" #define MyAppVersion "1.0.0"
#define MyAppPublisher "X" #define MyAppPublisher "X"
#define MyAppURL "~" #define MyAppURL "~"
#define MyAppExeName "command" #define MyAppExeName "command"

View File

@ -1,7 +1,7 @@
;iss ;iss
#define MyAppName "效能评估" #define MyAppName "效能评估"
#define MyAppVersion "1.0.1" #define MyAppVersion "1.0.0"
#define MyAppPublisher "X" #define MyAppPublisher "X"
#define MyAppURL "~" #define MyAppURL "~"
#define MyAppExeName "eval" #define MyAppExeName "eval"
@ -101,24 +101,24 @@ Name: Data; Description: {#MyAppName} Data; Types: full;
;; 安装包引入文件列表 ;; 安装包引入文件列表
[Files] [Files]
; 后端工程+启动器 ; 后端工程+启动器
;Source: "{#MyAppResources}\{#MyAppExeName}.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter ;Source: "Resources\{#MyAppExeName}.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter
;Source: "{#MyAppResources}\{#MyAppExeName}-console.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter ;Source: "Resources\{#MyAppExeName}-console.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter
;Source: "{#MyAppResources}\{#MyAppExeName}-x64.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter ;Source: "Resources\{#MyAppExeName}-x64.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter
;Source: "{#MyAppResources}\{#MyAppExeName}-x86.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter ;Source: "Resources\{#MyAppExeName}-x86.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter
;Source: "{#MyAppResources}\patch.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter ;Source: "Resources\patch.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter
Source: "{#MyAppResources}\{#MyAppExeName}.bat"; DestDir: "{app}\{#MyAppExeName}"; DestName: "{#MyAppExeName}.bat"; Flags: ignoreversion; Components: Starter Source: "Resources\{#MyAppExeName}.bat"; DestDir: "{app}\{#MyAppExeName}"; DestName: "{#MyAppExeName}.bat"; Flags: ignoreversion; Components: Starter
Source: "{#MyAppResources}\server\demo-0.0.1.jar"; DestDir: "{app}\{#MyAppExeName}\bin"; Flags: ignoreversion; Components: Server Source: "Resources\server\demo-0.0.1.jar"; DestDir: "{app}\{#MyAppExeName}\bin"; Flags: ignoreversion; Components: Server
Source: "{#MyAppResources}\lib\*"; DestDir: "{app}\eval\lib"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Server Source: "Resources\lib\*"; DestDir: "{app}\eval\lib"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Server
Source: "{#MyAppResources}\fonts\*"; DestDir: "{app}\eval\fonts"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Server Source: "Resources\fonts\*"; DestDir: "{app}\eval\fonts"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Server
; 更新数据库脚本 ; 更新数据库脚本
Source: "{#MyAppResources}\script\*"; DestDir: "{app}\{#MyAppExeName}\script"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Data Source: "Resources\script\*"; DestDir: "{app}\{#MyAppExeName}\script"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Data
; 前端工程 + Nginx ; 前端工程 + Nginx
Source: "{#MyAppResources}\web\*"; DestDir: "{app}\{#MyAppExeName}\web"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Starter; Source: "Resources\web\*"; DestDir: "{app}\{#MyAppExeName}\web"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Starter;
Source: "{#MyAppResources}\dist\*"; DestDir: "{app}\{#MyAppExeName}\web\dist"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: UI; Source: "Resources\dist\*"; DestDir: "{app}\{#MyAppExeName}\web\dist"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: UI;

View File

@ -1,7 +1,7 @@
;iss ;iss
#define MyAppName "模型管理" #define MyAppName "模型管理"
#define MyAppVersion "1.0.1" #define MyAppVersion "1.0.0"
#define MyAppPublisher "X" #define MyAppPublisher "X"
#define MyAppURL "~" #define MyAppURL "~"
#define MyAppExeName "model" #define MyAppExeName "model"

View File

@ -15,14 +15,14 @@ Import-Module ps2exe -ErrorAction Stop
$PS1_NAME = "startup" $PS1_NAME = "startup"
$APPLICATION_NAME = "model" $APPLICATION_NAME = "model"
$APPLICATION_VERSION = "1.0.0" $APPLICATION_VERSION = "1.0.0"
$COPY_RIGHT = "2025" $COPY_RIGHT = "© 2025"
# 基本启动,无 console可配置开机自启 # 基本启动,无 console可配置开机自启
Invoke-PS2EXE -InputFile "${PS1_NAME}.ps1" -OutputFile "${APPLICATION_NAME}.exe" -IconFile "icon.ico" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -requireAdmin -ErrorAction Stop Invoke-PS2EXE -InputFile "${PS1_NAME}.ps1" -OutputFile "${APPLICATION_NAME}.exe" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -requireAdmin -ErrorAction Stop
# 基本启动,提供 console用于 debug # 基本启动,提供 console用于 debug
Invoke-PS2EXE -InputFile "${PS1_NAME}-console.ps1" -OutputFile "${APPLICATION_NAME}-console.exe" -IconFile "icon.ico" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -requireAdmin -ErrorAction Stop Invoke-PS2EXE -InputFile "${PS1_NAME}-console.ps1" -OutputFile "${APPLICATION_NAME}-console.exe" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -requireAdmin -ErrorAction Stop
# 基本启动两种x # 基本启动两种x
Invoke-PS2EXE -InputFile "${PS1_NAME}.ps1" -OutputFile "${APPLICATION_NAME}-x86.exe" -IconFile "icon.ico" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -x86 -requireAdmin -ErrorAction Stop Invoke-PS2EXE -InputFile "${PS1_NAME}.ps1" -OutputFile "${APPLICATION_NAME}-x86.exe" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -x86 -requireAdmin -ErrorAction Stop
Invoke-PS2EXE -InputFile "${PS1_NAME}.ps1" -OutputFile "${APPLICATION_NAME}-x64.exe" -IconFile "icon.ico" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -x64 -requireAdmin -ErrorAction Stop Invoke-PS2EXE -InputFile "${PS1_NAME}.ps1" -OutputFile "${APPLICATION_NAME}-x64.exe" -version "${APPLICATION_VERSION}" -copyright "${COPY_RIGHT}" -x64 -requireAdmin -ErrorAction Stop
Write-Host "Complete." -ForegroundColor Green Write-Host "Complete." -ForegroundColor Green
Start-Sleep -Seconds 1 Start-Sleep -Seconds 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

View File

@ -24,7 +24,6 @@ $SERVER_NAME = $env:X_MANAGE_DB_SC
# Nginx executable name # Nginx executable name
$NGINX_EXE = "model-web.exe" $NGINX_EXE = "model-web.exe"
$logFile = "debug.log"
# Log recording function # Log recording function
function Write-Log { function Write-Log {
@ -33,7 +32,7 @@ function Write-Log {
) )
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logMessage = "[$timestamp] $message" $logMessage = "[$timestamp] $message"
# [debug] # [debug]
# Write-Output $logMessage | Out-File -FilePath $logFile -Append # Write-Output $logMessage | Out-File -FilePath $logFile -Append
Write-Host $logMessage Write-Host $logMessage
} }
@ -84,17 +83,17 @@ function Import-Script {
$rarName = $rarFile.BaseName $rarName = $rarFile.BaseName
$rarDirectoryName = (Get-Item $rarFile.FullName).DirectoryName $rarDirectoryName = (Get-Item $rarFile.FullName).DirectoryName
try { try {
Start-Process -FilePath "rar" -ArgumentList "x -pshzyh!234 `"$($rarFile.FullName)`" `"$rarDirectoryName`"" -NoNewWindow -Wait Start-Process -FilePath "rar" -ArgumentList "x -pshzyh!234 `"$($rarFile.FullName)`" `"$rarDirectoryName`"" -NoNewWindow -Wait
# Remove rar-file # Remove rar-file
if (Test-Path $rarFile.FullName) { if (Test-Path $rarFile.FullName) {
Remove-Item $rarFile.FullName -Force Remove-Item $rarFile.FullName -Force
# [debug] # [debug]
# Write-Log "File deleted." # Write-Log "File deleted."
} else { } else {
# [debug] # [debug]
# Write-Log "File does not exist." # Write-Log "File does not exist."
} }
} }
catch { catch {
Write-Log "Error unrar $($rarFile.Name):$_" Write-Log "Error unrar $($rarFile.Name):$_"
@ -143,24 +142,24 @@ function Import-Script {
# Write-Log "Successfully imported $($sqlFile.Name) into database $dbName" # Write-Log "Successfully imported $($sqlFile.Name) into database $dbName"
Write-Log "Successfully imported $($sqlFile.Name) into database $($folder.Name)" Write-Log "Successfully imported $($sqlFile.Name) into database $($folder.Name)"
$date = $(Get-Date -Format "yyyy-MM-dd") $date = $(Get-Date -Format "yyyy-MM-dd")
$random = randomText $random = randomText
$target = ".\patch\$($date)" $target = ".\patch\$($date)"
New-Item -Path "$target" -ItemType Directory -Force New-Item -Path "$target" -ItemType Directory -Force
# cmd /c rar a -pPassword -hp "target.rar" "file" # cmd /c rar a -pPassword -hp "target.rar" "file"
# Start-Process -FilePath "rar" -ArgumentList "a -pPassword -hp "target.rar" "file"" -NoNewWindow -Wait # Start-Process -FilePath "rar" -ArgumentList "a -pPassword -hp "target.rar" "file"" -NoNewWindow -Wait
# Start-Process -FilePath "rar" -ArgumentList 'a', '-pPassword', '-hpPassword', 'target.rar', 'file' -NoNewWindow -Wait # Start-Process -FilePath "rar" -ArgumentList 'a', '-pPassword', '-hpPassword', 'target.rar', 'file' -NoNewWindow -Wait
Start-Process -FilePath "rar" -ArgumentList "a -pPassword#$($date)! -hp $target\$($random).rar `"$($sqlFile.FullName)`"" -NoNewWindow -Wait Start-Process -FilePath "rar" -ArgumentList "a -pPassword#20250810! -hp $target\$($random).rar `"$($sqlFile.FullName)`"" -NoNewWindow -Wait
# Remove script-file # Remove script-file
if (Test-Path $sqlFile.FullName) { if (Test-Path $sqlFile.FullName) {
Remove-Item $sqlFile.FullName -Force Remove-Item $sqlFile.FullName -Force
# [debug] # [debug]
# Write-Log "File deleted." # Write-Log "File deleted."
} else { } else {
# [debug] # [debug]
# Write-Log "File does not exist." # Write-Log "File does not exist."
} }
} }
catch { catch {
Write-Log "Error importing $($sqlFile.Name):$_" Write-Log "Error importing $($sqlFile.Name):$_"
@ -203,26 +202,26 @@ function Append-Utf8NoBomContent {
} }
function Go-Home { function Go-Home {
if($outputWriteHost) { if($outputWriteHost) {
Write-Host "" Write-Host ""
Write-Host "Exit ..." Write-Host "Exit ..."
} }
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 任务执行完成" $logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 任务执行完成"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
exit 0 exit 0
} }
function Usage-MySQL { function Usage-MySQL {
if($outputWriteHost) { if($outputWriteHost) {
Write-Host "ERROR: Please configure value in the system environment variable." Write-Host "ERROR: Please configure value in the system environment variable."
Write-Host "env: - X_MANAGE_DB_EXE" Write-Host "env: - X_MANAGE_DB_EXE"
Write-Host " - X_MANAGE_DB_COF" Write-Host " - X_MANAGE_DB_COF"
Write-Host "skip database" Write-Host "skip database"
Write-Host "" Write-Host ""
} }
pause pause
Go-Home Go-Home
} }
function Usage-SpringBoot { function Usage-SpringBoot {
@ -471,88 +470,6 @@ End If
} }
function Start-MinIO {
# 进入 minio 目录下
Set-Location "$MAIN_PATH"
Set-Location ".."
$WORKSPACE_PATH = Get-Location
Set-Location "io"
if($outputWriteHost) {
Write-Host "Start Minio ..."
}
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 准备启动 Minio..."
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
# 停止现有的 minio 进程
Get-Process -Name "minio" -ErrorAction SilentlyContinue | Stop-Process -Force
# 配置默认启动参数
$MINIO_PATH = "minio.exe"
if (-not (Test-Path $MINIO_PATH)) {
if($outputWriteHost) {
Write-Host "Error: Cannot find minio.exe executable file."
}
pause
Go-Home
}
# 配置用户名和密码(可以改为从参数传入)
$MINIO_ROOT_USER = "minio_34KYwR" # 默认用户名
$MINIO_ROOT_PASSWORD = "minio_FEaTQx" # 默认密码
if($outputWriteHost) {
Write-Host "$MINIO_PATH"
}
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Minio executable file: $MINIO_PATH"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
# Minio 配置参数
$MINIO_DATA_DIR = "data" # 数据目录
$MINIO_PORT = 9000 # API 端口
$MINIO_CONSOLE_PORT = 9001 # 控制台端口
# 创建以管理员身份运行的 VBS脚本
$vbsContent = @"
Set UAC = CreateObject("Shell.Application")
Set WshShell = CreateObject("WScript.Shell")
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
Set tempFile = fso.OpenTextFile("%SystemRoot%\System32\config\systemprofile", 1)
If Err.Number = 0 Then
WshShell.Run "cmd /c set MINIO_ROOT_USER=$MINIO_ROOT_USER && set MINIO_ROOT_PASSWORD=$MINIO_ROOT_PASSWORD && $MINIO_PATH server $MINIO_DATA_DIR --console-address :$MINIO_CONSOLE_PORT", 0, False
Else
UAC.ShellExecute "cmd", "/c set MINIO_ROOT_USER=$MINIO_ROOT_USER && set MINIO_ROOT_PASSWORD=$MINIO_ROOT_PASSWORD && $MINIO_PATH server $MINIO_DATA_DIR --console-address :$MINIO_CONSOLE_PORT", "", "runas", 0
End If
"@
# 以 ANSI 写入文件 temp.vbs
$vbsContent | Out-File -FilePath "$WORKSPACE_PATH\io\temp.vbs" -Encoding ASCII
if($outputWriteHost) {
Write-Host "Temporary startup script has been created."
}
# 运行 vbs 脚本
Start-Process "cscript.exe" -ArgumentList "//nologo temp.vbs"
# 等待1秒后删除临时文件
Start-Sleep -Seconds 1
Remove-Item "temp.vbs" -Force
# 输出访问信息
if($outputWriteHost) {
Write-Host "Minio:"
Write-Host "WEB: http://localhost:$MINIO_CONSOLE_PORT"
Write-Host "API: http://localhost:$MINIO_PORT"
Write-Host "user: $MINIO_ROOT_USER"
Write-Host "pass: $MINIO_ROOT_PASSWORD"
}
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Minio started successfully! Console port: $MINIO-CONSOLE-PORT, API port: $MINIO-PORT, username: $MINIO-COOT_USER"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
}
function Start-SpringBoot { function Start-SpringBoot {
# 准备启动后台服务 # 准备启动后台服务
@ -567,12 +484,7 @@ function Start-SpringBoot {
# 指定环境变量 MODEL_MANAGE_DB_SERVER # 指定环境变量 MODEL_MANAGE_DB_SERVER
# 指定环境变量 MODEL_MANAGE_DB_PORT # 指定环境变量 MODEL_MANAGE_DB_PORT
# 追加自定义JVM参数 MODEL_VM_PARAMS # 追加自定义JVM参数 MODEL_VM_PARAMS
$arguments = "-Dspring.profiles.active=dev,mysql" + $arguments = "-Dspring.profiles.active=dev,mysql -Dmybatis-flex.datasource.ds1.password=Wfbke8!LeMY5Fwwe -Dproject.database-ip=$env:MODEL_MANAGE_DB_SERVER -Dproject.database-port=$env:MODEL_MANAGE_DB_PORT $env:MODEL_VM_PARAMS"
" -Dmybatis-flex.datasource.ds1.username=model" +
" -Dmybatis-flex.datasource.ds1.password=Wfbke8!LeMY5Fwwe" +
" -Dproject.database-ip=$env:MODEL_MANAGE_DB_SERVER" +
" -Dproject.database-port=$env:MODEL_MANAGE_DB_PORT" +
" $env:MODEL_VM_PARAMS "
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 启动JVM参数 $arguments" $logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 启动JVM参数 $arguments"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
@ -584,8 +496,7 @@ function Start-SpringBoot {
# 构建最终的调用命令 # 构建最终的调用命令
if($outputWriteHost) { if($outputWriteHost) {
# [debug] # Write-Host "$($env:JDK_21)\bin\java.exe" $argumentList -jar "$env:MODEL_MANAGE_BIN"
# Write-Host "$($env:JDK_21)\bin\java.exe" $argumentList -jar "$env:MODEL_MANAGE_BIN"
} }
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 启动完整命令: $($env:JDK_21)\bin\java.exe $argumentList -jar $env:MODEL_MANAGE_BIN" $logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 启动完整命令: $($env:JDK_21)\bin\java.exe $argumentList -jar $env:MODEL_MANAGE_BIN"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
@ -603,20 +514,17 @@ Start-Sleep -Seconds 2
# 导入数据 # 导入数据
Import-Script "127.0.0.1" "33306" "root" "Root@2025" Import-Script "127.0.0.1" "33306" "root" "Root@2025"
Start-Sleep -Seconds 1
# 检查 Web 运行环境 # 检查 Web 运行环境
Check-Web Check-Web
# 启动 Nginx 服务 # 启动 Nginx 服务
Start-Web Start-Web
Start-Sleep -Seconds 2 Start-Sleep -Seconds 1
# 启动 MinIO 服务
Start-MinIO
Start-Sleep -Seconds 2
# 检查 SpringBoot 运行环境 # 检查 SpringBoot 运行环境
Check-SpringBoot Check-SpringBoot
# 启动 SpringBoot 服务 # 启动 SpringBoot 服务
Start-SpringBoot Start-SpringBoot
Write-Host "已启动模型" Write-Host "已启动模型"
Start-Sleep -Seconds 6 Start-Sleep -Seconds 3

View File

@ -420,89 +420,6 @@ End If
} }
function Start-MinIO {
# 进入 minio 目录下
Set-Location "$MAIN_PATH"
Set-Location ".."
$WORKSPACE_PATH = Get-Location
Set-Location "io"
if($outputWriteHost) {
Write-Host "Start Minio ..."
}
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 准备启动 Minio..."
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
# 停止现有的 minio 进程
Get-Process -Name "minio" -ErrorAction SilentlyContinue | Stop-Process -Force
# 配置默认启动参数
$MINIO_PATH = "minio.exe"
if (-not (Test-Path $MINIO_PATH)) {
if($outputWriteHost) {
Write-Host "Error: Cannot find minio.exe executable file."
}
pause
Go-Home
}
# 配置用户名和密码(可以改为从参数传入)
$MINIO_ROOT_USER = "minio_34KYwR" # 默认用户名
$MINIO_ROOT_PASSWORD = "minio_FEaTQx" # 默认密码
if($outputWriteHost) {
Write-Host "$MINIO_PATH"
}
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Minio executable file: $MINIO_PATH"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
# Minio 配置参数
$MINIO_DATA_DIR = "data" # 数据目录
$MINIO_PORT = 9000 # API 端口
$MINIO_CONSOLE_PORT = 9001 # 控制台端口
# 创建以管理员身份运行的 VBS脚本
$vbsContent = @"
Set UAC = CreateObject("Shell.Application")
Set WshShell = CreateObject("WScript.Shell")
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
Set tempFile = fso.OpenTextFile("%SystemRoot%\System32\config\systemprofile", 1)
If Err.Number = 0 Then
WshShell.Run "cmd /c set MINIO_ROOT_USER=$MINIO_ROOT_USER && set MINIO_ROOT_PASSWORD=$MINIO_ROOT_PASSWORD && $MINIO_PATH server $MINIO_DATA_DIR --console-address :$MINIO_CONSOLE_PORT", 0, False
Else
UAC.ShellExecute "cmd", "/c set MINIO_ROOT_USER=$MINIO_ROOT_USER && set MINIO_ROOT_PASSWORD=$MINIO_ROOT_PASSWORD && $MINIO_PATH server $MINIO_DATA_DIR --console-address :$MINIO_CONSOLE_PORT", "", "runas", 0
End If
"@
# 以 ANSI 写入文件 temp.vbs
$vbsContent | Out-File -FilePath "$WORKSPACE_PATH\io\temp.vbs" -Encoding ASCII
if($outputWriteHost) {
Write-Host "Temporary startup script has been created."
}
# 运行 vbs 脚本
Start-Process "cscript.exe" -ArgumentList "//nologo temp.vbs"
# 等待1秒后删除临时文件
Start-Sleep -Seconds 1
Remove-Item "temp.vbs" -Force
# 输出访问信息
if($outputWriteHost) {
Write-Host "Minio:"
Write-Host "WEB: http://localhost:$MINIO_CONSOLE_PORT"
Write-Host "API: http://localhost:$MINIO_PORT"
Write-Host "user: $MINIO_ROOT_USER"
Write-Host "pass: $MINIO_ROOT_PASSWORD"
}
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Minio started successfully! Console port: $MINIO-CONSOLE-PORT, API port: $MINIO-PORT, username: $MINIO-COOT_USER"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
}
function Start-SpringBoot { function Start-SpringBoot {
# 准备启动后台服务 # 准备启动后台服务
@ -517,12 +434,7 @@ function Start-SpringBoot {
# 指定环境变量 MODEL_MANAGE_DB_SERVER # 指定环境变量 MODEL_MANAGE_DB_SERVER
# 指定环境变量 MODEL_MANAGE_DB_PORT # 指定环境变量 MODEL_MANAGE_DB_PORT
# 追加自定义JVM参数 MODEL_VM_PARAMS # 追加自定义JVM参数 MODEL_VM_PARAMS
$arguments = "-Dspring.profiles.active=dev,mysql" + $arguments = "-Dspring.profiles.active=dev,mysql -Dmybatis-flex.datasource.ds1.password=Wfbke8!LeMY5Fwwe -Dproject.database-ip=$env:MODEL_MANAGE_DB_SERVER -Dproject.database-port=$env:MODEL_MANAGE_DB_PORT $env:MODEL_VM_PARAMS"
" -Dmybatis-flex.datasource.ds1.username=model" +
" -Dmybatis-flex.datasource.ds1.password=Wfbke8!LeMY5Fwwe" +
" -Dproject.database-ip=$env:MODEL_MANAGE_DB_SERVER" +
" -Dproject.database-port=$env:MODEL_MANAGE_DB_PORT" +
" $env:MODEL_VM_PARAMS "
$logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 启动JVM参数 $arguments" $logMessage = "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - 启动JVM参数 $arguments"
Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage Append-Utf8NoBomContent -FilePath $outputLogFile -Content $logMessage
$argumentList = $arguments -split " -" $argumentList = $arguments -split " -"
@ -566,9 +478,6 @@ Check-Web
# 启动 Nginx 服务 # 启动 Nginx 服务
Start-Web Start-Web
# 启动 MinIO 服务
Start-MinIO
Start-Sleep -Seconds 1 Start-Sleep -Seconds 1
# 检查 SpringBoot 运行环境 # 检查 SpringBoot 运行环境
Check-SpringBoot Check-SpringBoot
@ -576,4 +485,4 @@ Check-SpringBoot
Start-SpringBoot Start-SpringBoot
Write-Host "已启动模型" Write-Host "已启动模型"
Start-Sleep -Seconds 5 Start-Sleep -Seconds 3

View File

@ -1 +1 @@
{"version":"1","format":"xl-single","id":"6133385a-4fa8-486e-a315-396fe6649c3e","xl":{"version":"3","this":"a8f97955-51e0-4948-9bdc-cde0897deb52","sets":[["a8f97955-51e0-4948-9bdc-cde0897deb52"]],"distributionAlgo":"SIPMOD+PARITY"}} {"version":"1","format":"xl-single","id":"336b01aa-5890-4b41-a360-4cc54cf00592","xl":{"version":"3","this":"20dd394e-1e16-4f61-81f7-e40bbe4768a0","sets":[["20dd394e-1e16-4f61-81f7-e40bbe4768a0"]],"distributionAlgo":"SIPMOD+PARITY"}}

View File

@ -14,8 +14,8 @@ if not exist "%MINIO_EXE%" (
) )
:: 设置MinIO凭据 :: 设置MinIO凭据
set MINIO_ROOT_USER=minio_FEaTQx :: set MINIO_ROOT_USER=minio_FEaTQx
set MINIO_ROOT_PASSWORD=minio_34KYwR :: set MINIO_ROOT_PASSWORD=minio_34KYwR
:: 检查数据目录是否存在,不存在则创建 :: 检查数据目录是否存在,不存在则创建
if not exist "%DATA_DIR%" ( if not exist "%DATA_DIR%" (

Some files were not shown because too many files have changed in this diff Show More