Merge remote-tracking branch 'origin/main' into add-new-feature-#484

pull/518/head
plutoyty 1 year ago
commit 40b26f9a2f

@ -32,7 +32,7 @@ VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/scripts
#Copy scripts files and binary files to the blank image #Copy scripts files and binary files to the blank image
COPY --from=build /Open-IM-Server/scripts /Open-IM-Server/scripts COPY --from=build /Open-IM-Server/scripts /Open-IM-Server/scripts
COPY --from=build /Open-IM-Server/_output/bin/platforms/linux/amd64 /Open-IM-Server/_output/bin/platforms/linux/amd64 COPY --from=build /Open-IM-Server/_output/bin/platforms/linux/amd64 /Open-IM-Server/_output/bin/platforms/linux/amd64
WORKDIR /Open-IM-Server/scripts WORKDIR /Open-IM-Server/scripts

@ -26,8 +26,6 @@ echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}" echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}" echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
cd $SCRIPTS_ROOT
echo -e "" echo -e ""
echo -e "${BACKGROUND_BLUE}===============> Building all using make build binary files ${COLOR_SUFFIX}" echo -e "${BACKGROUND_BLUE}===============> Building all using make build binary files ${COLOR_SUFFIX}"
@ -65,6 +63,11 @@ cd $OPENIM_ROOT
# Execute 'make build' # Execute 'make build'
make build make build
if [ $? -ne 0 ]; then
echo "make build Error, script exits"
exit 1
fi
# Get the current operating system and architecture # Get the current operating system and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]') OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m) ARCH=$(uname -m)

@ -24,6 +24,9 @@ source $SCRIPTS_ROOT/function.sh
cd $SCRIPTS_ROOT cd $SCRIPTS_ROOT
chmod +x build_all_service.sh
./build_all_service.sh
echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}" echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}" echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}" echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"

@ -79,13 +79,10 @@ cmd_utils_name="openim-cmdutils"
cmd_utils_binary_root="$OPENIM_ROOT/$BIN_DIR" cmd_utils_binary_root="$OPENIM_ROOT/$BIN_DIR"
cmd_utils_source_root="$OPENIM_ROOT/cmd/openim-cmdutils/" cmd_utils_source_root="$OPENIM_ROOT/cmd/openim-cmdutils/"
echo "debug========> config_path=$config_path"
# Global configuration file default dir # Global configuration file default dir
config_path="$OPENIM_ROOT/config/config.yaml" config_path="$OPENIM_ROOT/config/config.yaml"
configfile_path="$OPENIM_ROOT/config" configfile_path="$OPENIM_ROOT/config"
echo "BUG: debug========> config_path=$config_path"
# servicefile dir path # servicefile dir path
service_source_root=( service_source_root=(
# api service file # api service file

@ -95,7 +95,6 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do
portList2=$(cat $config_path | grep ${service_prometheus_port_name[$i]} | awk -F '[:]' '{print $NF}') portList2=$(cat $config_path | grep ${service_prometheus_port_name[$i]} | awk -F '[:]' '{print $NF}')
list_to_string $portList2 list_to_string $portList2
echo -e "debug========>cmd=$cmd AAAAA"
prome_ports=($ports_array) prome_ports=($ports_array)
#Start related rpc services based on the number of ports #Start related rpc services based on the number of ports
for ((j = 0; j < ${#service_ports[*]}; j++)); do for ((j = 0; j < ${#service_ports[*]}; j++)); do
@ -109,10 +108,8 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do
cmd="./${service_filename[$i]} --port ${service_ports[$j]}" cmd="./${service_filename[$i]} --port ${service_ports[$j]}"
fi fi
echo $cmd echo $cmd
echo -e "debug========>cmd=$cmd"
echo "=====================start ${service_filename[$i]}======================">>$OPENIM_ROOT/logs/openIM.log echo "=====================start ${service_filename[$i]}======================">>$OPENIM_ROOT/logs/openIM.log
nohup $cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 & nohup $cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
echo -e "debug========>OpenIMROOT=$OPENIM_ROOT"
sleep 1 sleep 1
pid="netstat -ntlp|grep $j |awk '{printf \$7}'|cut -d/ -f1" pid="netstat -ntlp|grep $j |awk '{printf \$7}'|cut -d/ -f1"
echo -e "${GREEN_PREFIX}${service_filename[$i]} start success,port number:${service_ports[$j]} pid:$(eval $pid)$COLOR_SUFFIX" echo -e "${GREEN_PREFIX}${service_filename[$i]} start success,port number:${service_ports[$j]} pid:$(eval $pid)$COLOR_SUFFIX"

Loading…
Cancel
Save