mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
Merge remote-tracking branch 'origin/3.6.1-code-conventions' into 3.6.1-code-conventions
This commit is contained in:
commit
46201b77c3
@ -23,8 +23,8 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
apiCmd := cmd.NewApiCmd(cmd.ApiServer)
|
apiCmd := cmd.NewApiCmd(cmd.ApiServer)
|
||||||
apiCmd.AddPortFlag()
|
//apiCmd.AddPortFlag()
|
||||||
apiCmd.AddPrometheusPortFlag()
|
//apiCmd.AddPrometheusPortFlag()
|
||||||
if err := apiCmd.Execute(); err != nil {
|
if err := apiCmd.Execute(); err != nil {
|
||||||
program.ExitWithError(err)
|
program.ExitWithError(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
storageLocation: ./_output/logs/
|
storageLocation: ../../../../logs/
|
||||||
rotationTime: 24
|
rotationTime: 24
|
||||||
remainRotationCount: 2
|
remainRotationCount: 2
|
||||||
remainLogLevel: 6
|
remainLogLevel: 6
|
||||||
|
|||||||
@ -29,7 +29,7 @@ services:
|
|||||||
- openim
|
- openim
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7.0.0
|
image: "${REDIS_IMAGE}"
|
||||||
container_name: redis
|
container_name: redis
|
||||||
ports:
|
ports:
|
||||||
- "16379:6379"
|
- "16379:6379"
|
||||||
@ -46,7 +46,7 @@ services:
|
|||||||
- openim
|
- openim
|
||||||
|
|
||||||
zookeeper:
|
zookeeper:
|
||||||
image: bitnami/zookeeper:3.8
|
image: "${ZOOKEEPER_IMAGE}"
|
||||||
container_name: zookeeper
|
container_name: zookeeper
|
||||||
ports:
|
ports:
|
||||||
- "12181:2181"
|
- "12181:2181"
|
||||||
@ -58,7 +58,7 @@ services:
|
|||||||
- openim
|
- openim
|
||||||
|
|
||||||
kafka:
|
kafka:
|
||||||
image: 'bitnami/kafka:3.5.1'
|
image: "${KAFKA_IMAGE}"
|
||||||
container_name: kafka
|
container_name: kafka
|
||||||
restart: always
|
restart: always
|
||||||
user: root
|
user: root
|
||||||
@ -83,7 +83,7 @@ services:
|
|||||||
|
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
image: minio/minio:RELEASE.2024-01-11T07-46-16Z
|
image: "${MINIO_IMAGE}"
|
||||||
ports:
|
ports:
|
||||||
- "10005:9000"
|
- "10005:9000"
|
||||||
- "19090:9090"
|
- "19090:9090"
|
||||||
|
|||||||
@ -24,6 +24,7 @@ start_binaries() {
|
|||||||
# Loop to start binary the specified number of times
|
# Loop to start binary the specified number of times
|
||||||
for ((i=0; i<count; i++)); do
|
for ((i=0; i<count; i++)); do
|
||||||
echo "Starting $bin_full_path -i $i -c $OPENIM_OUTPUT_CONFIG"
|
echo "Starting $bin_full_path -i $i -c $OPENIM_OUTPUT_CONFIG"
|
||||||
|
cd OPENIM_OUTPUT_HOSTBIN
|
||||||
cmd=("$bin_full_path" -i "$i" -c "$OPENIM_OUTPUT_CONFIG")
|
cmd=("$bin_full_path" -i "$i" -c "$OPENIM_OUTPUT_CONFIG")
|
||||||
nohup "${cmd[@]}" >> "${OPENIM_INIT_LOG_FILE}" 2> >(tee -a "$OPENIM_INIT_ERR_LOG_FILE" | while read line; do echo -e "\e[31m${line}\e[0m"; done >&2) &
|
nohup "${cmd[@]}" >> "${OPENIM_INIT_LOG_FILE}" 2> >(tee -a "$OPENIM_INIT_ERR_LOG_FILE" | while read line; do echo -e "\e[31m${line}\e[0m"; done >&2) &
|
||||||
done
|
done
|
||||||
@ -37,6 +38,7 @@ start_tools() {
|
|||||||
local bin_full_path=$(get_tool_full_path "$binary")
|
local bin_full_path=$(get_tool_full_path "$binary")
|
||||||
cmd=("$bin_full_path" -c "$OPENIM_OUTPUT_CONFIG")
|
cmd=("$bin_full_path" -c "$OPENIM_OUTPUT_CONFIG")
|
||||||
echo "Starting ${cmd[@]}"
|
echo "Starting ${cmd[@]}"
|
||||||
|
cd OPENIM_OUTPUT_HOSTBIN_TOOLS
|
||||||
"${cmd[@]}"
|
"${cmd[@]}"
|
||||||
ret_val=$?
|
ret_val=$?
|
||||||
if [ $ret_val -eq 0 ]; then
|
if [ $ret_val -eq 0 ]; then
|
||||||
|
|||||||
37
scripts-new/compile.bat
Normal file
37
scripts-new/compile.bat
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
@echo off
|
||||||
|
SETLOCAL EnableDelayedExpansion
|
||||||
|
|
||||||
|
SET "ROOT_DIR=%~dp0..\"
|
||||||
|
SET "OUTPUT_DIR=%ROOT_DIR%_output\bin\platforms\windows\amd64\"
|
||||||
|
|
||||||
|
IF NOT EXIST "%OUTPUT_DIR%" (
|
||||||
|
mkdir "%OUTPUT_DIR%"
|
||||||
|
)
|
||||||
|
|
||||||
|
call :findMainGo "%ROOT_DIR%cmd"
|
||||||
|
|
||||||
|
echo Compilation complete.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:findMainGo
|
||||||
|
FOR /R %1 %%d IN (.) DO (
|
||||||
|
IF EXIST "%%d\main.go" (
|
||||||
|
SET "DIR_PATH=%%d"
|
||||||
|
SET "DIR_NAME=%%~nxd"
|
||||||
|
|
||||||
|
echo Found main.go in %%d
|
||||||
|
echo Compiling %%d...
|
||||||
|
|
||||||
|
|
||||||
|
pushd "%%d"
|
||||||
|
SET "GOOS=windows"
|
||||||
|
SET "GOARCH=amd64"
|
||||||
|
go build -o "!OUTPUT_DIR!!DIR_NAME!.exe" main.go
|
||||||
|
if ERRORLEVEL 1 (
|
||||||
|
echo Failed to compile %%d
|
||||||
|
goto :eof
|
||||||
|
)
|
||||||
|
popd
|
||||||
|
)
|
||||||
|
)
|
||||||
|
goto :eof
|
||||||
16
scripts-new/start.bat
Normal file
16
scripts-new/start.bat
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
@echo off
|
||||||
|
SETLOCAL EnableDelayedExpansion
|
||||||
|
|
||||||
|
SET "BIN_DIR=%~dp0..\_output\bin\platforms\windows\amd64"
|
||||||
|
|
||||||
|
SET "CONFIG_DIR=%~dp0..\config"
|
||||||
|
|
||||||
|
cd "%BIN_DIR%"
|
||||||
|
|
||||||
|
FOR %%f IN ("%BIN_DIR%\*.exe") DO (
|
||||||
|
echo Starting %%~nf...
|
||||||
|
start cmd /k "%%~f -i 0 -c "%CONFIG_DIR%" & echo Press any key to close this window... & pause>nul"
|
||||||
|
echo %%~nf started.
|
||||||
|
)
|
||||||
|
|
||||||
|
echo All binaries in the directory have been started.
|
||||||
Loading…
x
Reference in New Issue
Block a user