feat: add more test project

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
Xinwei Xiong(cubxxw-openim) 2 years ago
parent d411117b87
commit f7ba123a6c
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE

@ -103,11 +103,11 @@ services:
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main # image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:main
# image: openim/openim-server:main # image: openim/openim-server:main
container_name: openim-server container_name: openim-server
# healthcheck: healthcheck:
# test: ["CMD-SHELL", "./scripts/check-all.sh"] test: ["CMD-SHELL", "./scripts/check-all.sh"]
# interval: 30s interval: 30s
# timeout: 10s timeout: 10s
# retries: 5 retries: 5
volumes: volumes:
- ./logs:/openim/openim-server/logs - ./logs:/openim/openim-server/logs
- ./config:/openim/openim-server/config - ./config:/openim/openim-server/config

@ -24,27 +24,30 @@ OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${OPENIM_ROOT}/scripts/lib/init.sh" source "${OPENIM_ROOT}/scripts/lib/init.sh"
# 定义一个配置文件数组,其中包含需要生成的配置文件的名称路径 (en: Define a profile array that contains the name path of the profile to be generated.) # 定义一个配置文件数组,其中包含需要生成的配置文件的名称路径
readonly ENV_FILE=${ENV_FILE:-"${OPENIM_ROOT}"/scripts/install/environment.sh} # (en: Define a profile array that contains the name path of the profile to be generated.)
readonly ENV_FILE=${ENV_FILE:-"${OPENIM_ROOT}/scripts/install/environment.sh"}
# 定义关联数组,其中键是模板文件,值是对应的输出文件 (en: Defines an associative array where the keys are the template files and the values are the corresponding output files.) # 定义关联数组,其中键是模板文件,值是对应的输出文件
# (en: Defines an associative array where the keys are the template files and the values are the corresponding output files.)
declare -A TEMPLATES=( declare -A TEMPLATES=(
[""${OPENIM_ROOT}"/deployments/templates/env_template.yaml"]=""${OPENIM_ROOT}"/.env" ["${OPENIM_ROOT}/templates/env_template.yaml"]="${OPENIM_ROOT}/.env"
[""${OPENIM_ROOT}"/deployments/templates/openim.yaml"]=""${OPENIM_ROOT}"/config/config.yaml" ["${OPENIM_ROOT}/templates/openim.yaml"]="${OPENIM_ROOT}/openim-server/main/config/config.yaml"
) )
for template in "${!TEMPLATES[@]}"; do for template in "${!TEMPLATES[@]}"; do
output_file=${TEMPLATES[$template]}
if [[ ! -f "${template}" ]]; then if [[ ! -f "${template}" ]]; then
openim::log::error_exit "template file ${template} does not exist..." openim::log::error_exit "template file ${template} does not exist..."
fi fi
openim::log::info "⌚ Working with template file: ${template} to ${output_file}..." IFS=';' read -ra OUTPUT_FILES <<< "${TEMPLATES[$template]}"
""${OPENIM_ROOT}"/scripts/genconfig.sh" "${ENV_FILE}" "${template}" > "${output_file}" || { for output_file in "${OUTPUT_FILES[@]}"; do
openim::log::error "Error processing template file ${template}" openim::log::info "⌚ Working with template file: ${template} to ${output_file}..."
exit 1 "${OPENIM_ROOT}/scripts/genconfig.sh" "${ENV_FILE}" "${template}" > "${output_file}" || {
} openim::log::error "Error processing template file ${template}"
exit 1
}
done
done done
openim::log::success "✨ All configuration files have been successfully generated!" openim::log::success "✨ All configuration files have been successfully generated!"

Loading…
Cancel
Save