diff --git a/.github/workflows/scriptsci.yml b/.github/workflows/scriptsci.yml index c07485ac0..18955a5f2 100644 --- a/.github/workflows/scriptsci.yml +++ b/.github/workflows/scriptsci.yml @@ -76,8 +76,8 @@ jobs: - name: Check all services run: | - sudo chmod +x ./scripts/check_all.sh - sudo ./scripts/check_all.sh + sudo chmod +x ./scripts/check-all.sh + sudo ./scripts/check-all.sh sudo cat logs/openIM.log 2>/dev/null shell: bash diff --git a/README-zh_CN.md b/README-zh_CN.md index c578c9db4..3180b91f4 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -267,7 +267,7 @@ bashCopy code ``` bashCopy code -./scripts/check_all.sh +./scripts/check-all.sh ``` 停止服务 diff --git a/README.md b/README.md index d79eab43a..1a97ac413 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,7 @@ Start services Check services ``` -./scripts/check_all.sh +./scripts/check-all.sh ``` Stop services diff --git a/docker-compose.yaml b/docker-compose.yaml index 2fae9a29a..b1788e938 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -104,11 +104,11 @@ services: # image: openim/openim-server:latest # build: . container_name: openim-server - healthcheck: - test: ["CMD-SHELL", "./scripts/check_all.sh"] - interval: 30s - timeout: 10s - retries: 5 + # healthcheck: + # test: ["CMD-SHELL", "./scripts/check-all.sh"] + # interval: 30s + # timeout: 10s + # retries: 5 volumes: - ${DATA_DIR}/_output/openim/logs:/openim/openim-server/logs - ${DATA_DIR}/config:/openim/openim-server/config @@ -134,7 +134,7 @@ services: # image: openim/openim-chat:latest container_name: openim-chat healthcheck: - test: ["CMD-SHELL", "./scripts/check_all.sh"] + test: ["CMD-SHELL", "./scripts/check-all.sh"] interval: 30s timeout: 10s retries: 5 diff --git a/scripts/README.md b/scripts/README.md index a68a53a4d..ad7d5e760 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -34,7 +34,7 @@ scripts/ ├── build.cmd # Windows build command script ├── build-all-service.sh # Script to build all services ├── build_push_k8s_images.sh # Script to build and push images for Kubernetes -├── check_all.sh # Script to check status of all services +├── check-all.sh # Script to check status of all services ├── common.sh # Contains common functions used by other scripts ├── coverage.awk # AWK script for coverage report generation ├── coverage.sh # Script for generating coverage reports @@ -42,7 +42,7 @@ scripts/ ├── docker-start-all-all.sh # Script to start all services in a docker environment ├── ensure_tag.sh # Script to ensure proper tagging of docker images ├── enterprise # Scripts specific to enterprise version -│ ├── check_all.sh # Check status of all enterprise services +│ ├── check-all.sh # Check status of all enterprise services │ ├── function.sh # Functions specific to enterprise version │ └── path_info.cfg # Path information configuration for enterprise version ├── env_check.sh # Script to check the environment diff --git a/scripts/check_all.sh b/scripts/check_all.sh deleted file mode 100755 index e704b4a64..000000000 --- a/scripts/check_all.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script is check openim service is running normally -# -# Usage: `scripts/check_all.sh`. -# Encapsulated as: `make check`. -# READ: https://github.com/OpenIMSDK/Open-IM-Server/tree/main/scripts/install/environment.sh - -set -o errexit -set -o nounset -set -o pipefail - -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -source "${OPENIM_ROOT}/scripts/install/common.sh" - -OPENIM_VERBOSE=4 - -echo "++++ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}" - -echo "++++ Check all dependent service ports" -echo "+ The port being checked: ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}" -openim::util::check_ports ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]} - -if [[ $? -ne 0 ]]; then - openim::log::error_exit "The service does not start properly, please check the port, query variable definition!" - echo "+++ https://github.com/OpenIMSDK/Open-IM-Server/tree/main/scripts/install/environment.sh +++" -else - echo "++++ Check all dependent service ports successfully !" -fi - -echo "++++ Check all OpenIM service ports" -echo "+ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}" -openim::util::check_ports ${OPENIM_SERVER_PORT_LISTARIES[@]} -if [[ $? -ne 0 ]]; then - echo "+++ cat openim log file >>> ${LOG_FILE}" - openim::log::error_exit "The service does not start properly, please check the port, query variable definition!" -else - echo "++++ Check all openim service ports successfully !" -fi \ No newline at end of file diff --git a/scripts/docker_check_service.sh b/scripts/docker_check_service.sh index 33c386329..f6f0bdacf 100755 --- a/scripts/docker_check_service.sh +++ b/scripts/docker_check_service.sh @@ -86,7 +86,7 @@ do_sth() { kill "$_progress_pid" "$_countdown_pid" - "${SCRIPTS_ROOT}/check_all.sh" + "${SCRIPTS_ROOT}/check-all.sh" echo -e "${PURPLE_PREFIX}=========> Check docker-compose status ${COLOR_SUFFIX} \n" } diff --git a/scripts/install/environment.sh b/scripts/install/environment.sh index fda23ef58..d8d63d8fb 100755 --- a/scripts/install/environment.sh +++ b/scripts/install/environment.sh @@ -117,7 +117,7 @@ def "COS_SESSION_TOKEN" # 腾 def "OSS_ENDPOINT" "https://oss-cn-chengdu.aliyuncs.com" # 阿里云OSS的端点URL def "OSS_BUCKET" "demo-9999999" # 阿里云OSS的存储桶名称 def "OSS_BUCKET_URL" "https://demo-9999999.oss-cn-chengdu.aliyuncs.com" # 阿里云OSS的存储桶URL -def "OSS_ACCESS_KEY_ID" "${USER}" # 阿里云OSS的访问密钥ID +def "OSS_ACCESS_KEY_ID" # 阿里云OSS的访问密钥ID def "OSS_ACCESS_KEY_SECRET" # 阿里云OSS的密钥 def "OSS_SESSION_TOKEN" # 阿里云OSS的会话令牌 diff --git a/scripts/install/install.sh b/scripts/install/install.sh index fbb40f8d3..ab38b7a0f 100755 --- a/scripts/install/install.sh +++ b/scripts/install/install.sh @@ -17,5 +17,12 @@ OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P) [[ -z ${COMMON_SOURCED} ]] && source ${OPENIM_ROOT}/scripts/install/common.sh -# common.sh environment.sh mariadb_for_ubuntu.sh openim-msgtransfer.sh openim-push.sh openim-rpc.sh -# dependency.sh install.sh openim-msggateway.sh openim-crontask.sh redis_for_ubuntu.sh test.sh man.sh \ No newline at end of file +source ${OPENIM_ROOT}/scripts/install/dependency.sh +source ${OPENIM_ROOT}/scripts/install/openim-msggateway.sh +source ${OPENIM_ROOT}/scripts/install/openim-msgtransfer.sh +source ${OPENIM_ROOT}/scripts/install/openim-push.sh +source ${OPENIM_ROOT}/scripts/install/openim-rpc.sh +source ${OPENIM_ROOT}/scripts/install/openim-crontask.sh +source ${OPENIM_ROOT}/scripts/install/openim-api.sh +source ${OPENIM_ROOT}/scripts/install/test.sh +source ${OPENIM_ROOT}/scripts/install/man.sh \ No newline at end of file diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index 0fadd2d4a..929a9912d 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -117,7 +117,7 @@ go.stop: .PHONY: go.check go.check: @echo "===========> Checking openim" - @$(ROOT_DIR)/scripts/check_all.sh + @$(ROOT_DIR)/scripts/check-all.sh ## go.build.verify: Verify that a suitable version of Go exists .PHONY: go.build.verify