From 2da37583e16123d2c5887ad161d1b5c112fb66bb Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Fri, 4 Aug 2023 14:39:08 +0800 Subject: [PATCH] build: release images v1.1.1-beta.1 Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- Dockerfile | 2 ++ scripts/check_all.sh | 43 +++++++++++++++++++++++++++++++------------ 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1e03ee71..ab278f981 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,4 +44,6 @@ COPY --from=builder /openim/openim-chat/_output/bin/platforms /openim/openim-cha COPY --from=builder ${OPENIM_CHAT_CMDDIR} /openim/openim-chat/scripts COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml +VOLUME ["/openim/openim-chat/logs","/openim/openim-chat/config","/openim/openim-chat/scripts"] + CMD ${OPENIM_CHAT_CMDDIR}/docker_start_all.sh \ No newline at end of file diff --git a/scripts/check_all.sh b/scripts/check_all.sh index 0e2cb2838..5b2abd08a 100755 --- a/scripts/check_all.sh +++ b/scripts/check_all.sh @@ -30,18 +30,37 @@ service_port_name=( openImChatPort ) -switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}') +switch=$(cat $config_path | grep demoswitch | awk -F '[:]' '{print $NF}') for i in ${service_port_name[*]}; do - list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') - list_to_string $list - for j in ${ports_array}; do - port=$(ss -tunlp| grep open_im | awk '{print $5}' | grep -w ${j} | awk -F '[:]' '{print $NF}') - if [[ ${port} -ne ${j} ]]; then - echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX} - echo -e ${RED_PREFIX}"please check ${OPENIM_ROOT}/logs/openIM.log "${COLOR_SUFFIX} + case $i in + "openImChatApiPort") + new_service_name="chat-api" + new_service_port="10008" + ;; + "openImAdminApiPort") + new_service_name="admin-rpc" + new_service_port="30200" + ;; + "openImAdminPort") + new_service_name="chat-rpc" + new_service_port="30300" + ;; + "openImChatPort") + new_service_name="admin-api" + new_service_port="10009" + ;; + *) + echo "Invalid service name: $i" exit -1 - else - echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX} - fi - done + ;; + esac + + port=$(ss -tunlp | grep "$new_service_name" | awk '{print $5}' | awk -F '[:]' '{print $NF}') + if [[ "$port" != "$new_service_port" ]]; then + echo -e "${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX} service does not start normally, not initiated port is ${COLOR_SUFFIX}${YELLOW_PREFIX}${new_service_port}${COLOR_SUFFIX}" + echo -e "${RED_PREFIX}please check ${SCRIPTS_ROOT}/../logs/openIM.log ${COLOR_SUFFIX}" + exit -1 + else + echo -e "${new_service_port}${GREEN_PREFIX} port has been listening, belongs service is ${i}${COLOR_SUFFIX}" + fi done