mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 02:55:58 +08:00
feat: Enhance Template Generation Logic in OPENIM Deployment Scripts (#1510)
* feat: add init-config.sh * feat: add helm charts test cicd Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add helm charts test cicd Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add helm charts test cicd Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add helm charts test cicd Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
@@ -35,6 +35,8 @@ declare -A TEMPLATES=(
|
||||
["${OPENIM_ROOT}/deployments/templates/alertmanager.yml"]="${OPENIM_ROOT}/config/alertmanager.yml"
|
||||
)
|
||||
|
||||
openim::log::info "Read more configuration information: https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md"
|
||||
|
||||
for template in "${!TEMPLATES[@]}"; do
|
||||
if [[ ! -f "${template}" ]]; then
|
||||
openim::log::error_exit "template file ${template} does not exist..."
|
||||
@@ -42,6 +44,16 @@ for template in "${!TEMPLATES[@]}"; do
|
||||
|
||||
IFS=';' read -ra OUTPUT_FILES <<< "${TEMPLATES[$template]}"
|
||||
for output_file in "${OUTPUT_FILES[@]}"; do
|
||||
if [[ -f "${output_file}" ]]; then
|
||||
read -p "File ${output_file} already exists. Overwrite? (Y/N): "
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
openim::log::info "Overwriting ${output_file}. Previous configuration will be lost."
|
||||
else
|
||||
openim::log::info "Skipping generation of ${output_file}."
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
openim::log::info "⌚ Working with template file: ${template} to ${output_file}..."
|
||||
"${OPENIM_ROOT}/scripts/genconfig.sh" "${ENV_FILE}" "${template}" > "${output_file}" || {
|
||||
openim::log::error "Error processing template file ${template}"
|
||||
|
||||
Reference in New Issue
Block a user