mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 09:36:00 +08:00
fix: add openim server deploy (#1036)
* fix: add openim server deploy Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add openim im ctl Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add more deployment docs Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add openim save images and release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * build: set IBM sarama and set k8s deployment helm Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: add openim code fix Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: add openim code fix Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
+28
-17
@@ -36,7 +36,7 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
HOOKS_DIR=".git/hooks"
|
||||
HOOKS_DIR="${OPENIM_ROOT}/.git/hooks"
|
||||
|
||||
help_info() {
|
||||
echo "Usage: $0 [options]"
|
||||
@@ -50,32 +50,43 @@ help_info() {
|
||||
}
|
||||
|
||||
delete_hooks() {
|
||||
for file in scripts/githooks/*.sh; do
|
||||
hook_name=$(basename "$file" .sh)
|
||||
for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do
|
||||
hook_name=$(basename "$file" .sh) # This removes the .sh extension
|
||||
rm -f "$HOOKS_DIR/$hook_name"
|
||||
done
|
||||
echo "Git hooks have been deleted."
|
||||
}
|
||||
|
||||
enable_hooks() {
|
||||
echo "Would you like to enable git hooks mode? [y/n]"
|
||||
echo "Would you like to:"
|
||||
echo "1) Enable git hooks mode"
|
||||
echo "2) Delete existing git hooks"
|
||||
echo "Please select a number (or any other key to exit):"
|
||||
read -r choice
|
||||
|
||||
if [[ $choice == "y" || $choice == "Y" ]]; then
|
||||
for file in scripts/githooks/*.sh; do
|
||||
cp -f "$file" "$HOOKS_DIR/$(basename "$file" .sh)"
|
||||
done
|
||||
case "$choice" in
|
||||
1)
|
||||
for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do
|
||||
hook_name=$(basename "$file" .sh) # This removes the .sh extension
|
||||
cp -f "$file" "$HOOKS_DIR/$hook_name"
|
||||
done
|
||||
|
||||
chmod +x $HOOKS_DIR/*
|
||||
|
||||
echo "Git hooks mode has been enabled."
|
||||
echo "With git hooks enabled, every time you perform a git action (e.g. git commit), the corresponding hooks script will be triggered automatically."
|
||||
echo "This means that if the size of the file you're committing exceeds the set limit (e.g. 42MB), the commit will be rejected."
|
||||
else
|
||||
echo "Git hooks mode remains disabled."
|
||||
fi
|
||||
chmod +x $HOOKS_DIR/*
|
||||
|
||||
echo "Git hooks mode has been enabled."
|
||||
echo "With git hooks enabled, every time you perform a git action (e.g. git commit), the corresponding hooks script will be triggered automatically."
|
||||
echo "This means that if the size of the file you're committing exceeds the set limit (e.g. 42MB), the commit will be rejected."
|
||||
;;
|
||||
2)
|
||||
delete_hooks
|
||||
;;
|
||||
*)
|
||||
echo "Exiting without making changes."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
help_info
|
||||
@@ -86,4 +97,4 @@ case "$1" in
|
||||
*)
|
||||
enable_hooks
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
# You need to supplement the script according to the specification.
|
||||
# Read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/init_config.md
|
||||
# 格式化 bash 注释:https://tool.lu/shell/
|
||||
# 配置中心文档:https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/contrib/environment.md
|
||||
|
||||
OPENIM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user