(improvement)(project)Introduce aibi-env.sh script to simplify user settings.

(improvement)(project)Introduce aibi-env.sh script to simplify user settings.

(improvement)(project)Introduce aibi-env.sh script to simplify user settings.
This commit is contained in:
jerryjzhang
2025-02-17 13:07:43 +08:00
parent 348d6df6a2
commit f31db98aba
12 changed files with 90 additions and 31 deletions

View File

@@ -4,6 +4,7 @@ chcp 65001
set "sbinDir=%~dp0"
call %sbinDir%/supersonic-common.bat %*
call %sbinDir%/supersonic-env.bat %*
set "command=%~1"
set "service=%~2"
@@ -14,7 +15,7 @@ if "%service%"=="" (
)
if "%profile%"=="" (
set "profile=local"
set "profile=%S2_DB_TYPE%"
)
set "model_name=%service%"
@@ -54,7 +55,8 @@ if "%command%"=="restart" (
set "webDir=%baseDir%\webapp"
set "logDir=%baseDir%\logs"
set "classpath=%baseDir%;%webDir%;%libDir%\*;%confDir%"
set "java-command=-Dfile.encoding=UTF-8 -Duser.language=Zh -Duser.region=CN -Duser.timezone=GMT+08 -Dspring.profiles.active=%profile% -Xms1024m -Xmx1024m -cp %CLASSPATH% %MAIN_CLASS%"
set "java-command=-Dfile.encoding=UTF-8 -Duser.language=Zh -Duser.region=CN -Duser.timezone=GMT+08 -Dspring.profiles.active=%profile% -Xms1024m
-Xmx1024m -cp %CLASSPATH% %MAIN_CLASS%"
if not exist %logDir% mkdir %logDir%
start /B java %java-command% >nul 2>&1
timeout /t 10 >nul

View File

@@ -2,6 +2,7 @@
sbinDir=$(cd "$(dirname "$0")"; pwd)
source $sbinDir/supersonic-common.sh
source $sbinDir/supersonic-env.sh
command=$1
service=$2
@@ -12,7 +13,7 @@ if [ -z "$service" ]; then
fi
if [ -z "$profile" ]; then
profile="local"
profile=${S2_DB_TYPE}
fi
model_name=$service

View File

@@ -0,0 +1,8 @@
:: Set below DB configs to connect to your own database
:: Supported DB_TYPE: h2, mysql, postgres
set "S2_DB_TYPE=h2"
set "S2_DB_HOST="
set "S2_DB_PORT="
set "S2_DB_USER="
set "S2_DB_PASSWORD="
set "S2_DB_DATABASE="

10
assembly/bin/supersonic-env.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#### Set below DB configs to connect to your own database
# Supported DB_TYPE: h2, mysql, postgres
export S2_DB_TYPE=h2
export S2_DB_HOST=
export S2_DB_PORT=
export S2_DB_USER=
export S2_DB_PASSWORD=
export S2_DB_DATABASE=