feat: add scripts (#514)

This commit is contained in:
Xinwei Xiong 2023-07-12 19:21:55 +08:00 committed by GitHub
parent de1b970046
commit 1b5eb4a5c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

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

View File

@ -24,6 +24,9 @@ source $SCRIPTS_ROOT/function.sh
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}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"

View File

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

View 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}')
list_to_string $portList2
echo -e "debug========>cmd=$cmd AAAAA"
prome_ports=($ports_array)
#Start related rpc services based on the number of ports
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]}"
fi
echo $cmd
echo -e "debug========>cmd=$cmd"
echo "=====================start ${service_filename[$i]}======================">>$OPENIM_ROOT/logs/openIM.log
nohup $cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
echo -e "debug========>OpenIMROOT=$OPENIM_ROOT"
sleep 1
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"