batch build

pull/236/head
skiffer-git 2 years ago
parent f51a074f86
commit 556ed8413f

@ -45,7 +45,7 @@ for ((i = 0; i < ${#service_source_root[*]}; i++)); do
if [ $stat == 0 ]
then
echo -e "${GREEN_PREFIX}${service_names[$i]} successfully be built ${COLOR_SUFFIX}\n"
success_num=$success_num+1
let success_num=$success_num+1
else
echo -e "${RED_PREFIX}${service_names[$i]} build failed ${COLOR_SUFFIX}\n"
@ -53,9 +53,7 @@ for ((i = 0; i < ${#service_source_root[*]}; i++)); do
fi
done
echo "success_num" $success_num
echo "service_source_root" ${#service_source_root[*]}
echo "success_num" $success_num "service num:" ${#service_source_root[*]}
if [ $success_num == ${#service_source_root[*]} ]
then
echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX}

@ -0,0 +1,67 @@
#!/usr/bin/env bash
#fixme This script is the total startup script
#fixme The full name of the shell script that needs to be started is placed in the need_to_start_server_shell array
#fixme Put the shell script name here
need_to_start_server_shell=(
start_rpc_service.sh
msg_gateway_start.sh
push_start.sh
msg_transfer_start.sh
sdk_svr_start.sh
demo_svr_start.sh
)
time=`date +"%Y-%m-%d %H:%M:%S"`
echo "==========================================================">>../logs/openIM.log 2>&1 &
echo "==========================================================">>../logs/openIM.log 2>&1 &
echo "==========================================================">>../logs/openIM.log 2>&1 &
echo "==========server start time:${time}===========">>../logs/openIM.log 2>&1 &
echo "==========================================================">>../logs/openIM.log 2>&1 &
echo "==========================================================">>../logs/openIM.log 2>&1 &
echo "==========================================================">>../logs/openIM.log 2>&1 &
build_pid_array=()
for i in ${need_to_start_server_shell[*]}; do
chmod +x $i
./$i &
build_pid=$!
build_pid_array[i]=$build_pid
done
echo "wait all start finish....."
for i in ${need_to_start_server_shell[*]}; do
chmod +x $i
./$i &
if [ $? -ne 0 ]; then
exit -1
fi
done
success_num=0
for ((i = 0; i < ${#need_to_start_server_shell[*]}; i++)); do
echo "wait pid: " ${build_pid_array[i]} ${need_to_start_server_shell[$i]}
wait ${build_pid_array[i]}
stat=$?
echo ${build_pid_array[i]} " " $stat
if [ $stat == 0 ]
then
echo -e "${GREEN_PREFIX}${need_to_start_server_shell[$i]} successfully be built ${COLOR_SUFFIX}\n"
let success_num=$success_num+1
else
echo -e "${RED_PREFIX}${need_to_start_server_shell[$i]} build failed ${COLOR_SUFFIX}\n"
exit -1
fi
done
echo "success_num" $success_num "service num:" ${#need_to_start_server_shell[*]}
if [ $success_num == ${#need_to_start_server_shell[*]} ]
then
echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX}
fi
Loading…
Cancel
Save