feat: commit tag

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-08-18 14:49:50 +00:00
parent a38dfb9a1d
commit 1f25f7dc78
15 changed files with 199 additions and 858 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ scripts/
├── common.sh # Contains common functions used by other scripts
├── coverage.awk # AWK script for coverage report generation
├── coverage.sh # Script for generating coverage reports
├── docker_check_service.sh # Docker specific service check script
├── docker-check-service.sh # Docker specific service check script
├── 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
+1 -1
View File
@@ -45,7 +45,7 @@ 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}"
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 !"
@@ -22,8 +22,6 @@ source "$SCRIPTS_ROOT/style_info.sh"
echo -e "${GREEN_PREFIX}=========> Check docker-compose status ${COLOR_SUFFIX} \n"
cd "$OPENIM_ROOT"
if command -v docker-compose &> /dev/null; then
+2
View File
@@ -24,6 +24,8 @@ trap 'openim::util::onCtrlC' INT
nohup ${OPENIM_ROOT}/scripts/start-all.sh > ${LOG_FILE} 2>&1 &
sleep 15
nohup ${OPENIM_ROOT}/scripts/check-all.sh > ${LOG_FILE} 2>&1 &
tail -f ${LOG_FILE}
+31
View File
@@ -0,0 +1,31 @@
#!/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.
#FIXME This script is the startup script for multiple servers.
#FIXME The full names of the shell scripts that need to be started are placed in the `need_to_start_server_shell` array.
set -o nounset
set -o pipefail
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd -P)
source "${OPENIM_ROOT}/scripts/install/common.sh"
for file in "${OPENIM_SERVER_TARGETS[@]}"; do
VARNAME="$(echo $file | tr '[:lower:]' '[:upper:]' | tr '.' '_' | tr '-' '_')"
VARVALUE="$OPENIM_OUTPUT_HOSTBIN/$file"
# /etc/profile.d/openim-env.sh
echo "export $VARNAME=$VARVALUE" > /etc/profile.d/openim-env.sh
source /etc/profile.d/openim-env.sh
done
+37 -8
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# --------------------------------------------------------------
# OpenIM Protoc Tool v1.0.0
@@ -19,6 +19,10 @@
# Note: The specific installation and usage instructions may vary based on the tool's actual implementation. It's advised to refer to official documentation.
# --------------------------------------------------------------
PROTOC_DOWNLOAD_URL="https://github.com/OpenIMSDK/Open-IM-Protoc/releases/download/v1.0.0/linux.zip"
DOWNLOAD_DIR="/tmp/openim-protoc"
INSTALL_DIR="/usr/local/bin"
function help_message {
echo "Usage: ./install-protobuf.sh [option]"
echo "Options:"
@@ -31,14 +35,34 @@ function help_message {
function install_protobuf {
echo "Installing OpenIM Protoc tool..."
# Logic for installation based on the OS
# e.g., download, unzip, and add to PATH
# Create temporary directory and download the zip file
mkdir -p $DOWNLOAD_DIR
wget $PROTOC_DOWNLOAD_URL -O $DOWNLOAD_DIR/linux.zip
# Unzip the file
unzip -o $DOWNLOAD_DIR/linux.zip -d $DOWNLOAD_DIR
# Move binaries to the install directory and make them executable
sudo cp $DOWNLOAD_DIR/linux/protoc $INSTALL_DIR/
sudo cp $DOWNLOAD_DIR/linux/protoc-gen-go $INSTALL_DIR/
sudo chmod +x $INSTALL_DIR/protoc
sudo chmod +x $INSTALL_DIR/protoc-gen-go
# Clean up
rm -rf $DOWNLOAD_DIR
echo "OpenIM Protoc tool installed successfully!"
}
function uninstall_protobuf {
echo "Uninstalling OpenIM Protoc tool..."
# Logic for uninstallation
# e.g., remove from PATH and delete files
# Removing binaries from the install directory
sudo rm -f $INSTALL_DIR/protoc
sudo rm -f $INSTALL_DIR/protoc-gen-go
echo "OpenIM Protoc tool uninstalled successfully!"
}
function reinstall_protobuf {
@@ -49,8 +73,13 @@ function reinstall_protobuf {
function check_protobuf {
echo "Checking for OpenIM Protoc tool installation..."
# Logic to check if the tool is installed
# e.g., which protoc or checking PATH
which protoc > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "OpenIM Protoc tool is installed."
else
echo "OpenIM Protoc tool is not installed."
fi
}
while [ "$1" != "" ]; do
@@ -70,4 +99,4 @@ while [ "$1" != "" ]; do
exit 1
esac
shift
done
done
+1 -1
View File
@@ -60,7 +60,7 @@ start_docker_compose() {
docker compose up -d
fi
${OPENIM_ROOT}/scripts/docker_check_service.sh
${OPENIM_ROOT}/scripts/docker-check-service.sh
}
main() {
+1 -1
View File
@@ -82,4 +82,4 @@ else
docker compose up -d
fi
${SCRIPTS_ROOT}/docker_check_service.sh
${SCRIPTS_ROOT}/docker-check-service.sh
+5 -5
View File
@@ -287,7 +287,7 @@ openim::util::check_ports() {
if [[ ${#not_started[@]} -ne 0 ]]; then
openim::log::info "### Not started ports:"
for port in "${not_started[@]}"; do
openim::log::error "Port $port is not started. cat openim log >>> cat ${LOG_FILE}"
openim::log::error "Port $port is not started. OpenIM Log >>> cat ${LOG_FILE}"
done
fi
@@ -352,7 +352,7 @@ openim::util::check_process_names() {
if [[ ${#not_started[@]} -ne 0 ]]; then
openim::log::info "Not started processes:"
for process_name in "${not_started[@]}"; do
openim::log::error "Process $process_name is not started. cat openim log >>> cat ${LOG_FILE}"
openim::log::error "Process $process_name is not started. OpenIM Log >>> cat ${LOG_FILE}"
done
fi
@@ -1201,11 +1201,11 @@ function openim::util::get_server_ip() {
# Check if IP retrieval was successful
if [[ -z "$IP" ]]; then
# If not, get the internal IP address
IP=$(hostname -I | awk '{print $1}')
IP=$(ip addr show | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}' | cut -d'/' -f1 | head -n 1)
fi
else
# If curl is not available, get the internal IP address
IP=$(hostname -I | awk '{print $1}')
IP=$(ip addr show | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}' | cut -d'/' -f1 | head -n 1)
fi
# Return the fetched IP address
@@ -1280,4 +1280,4 @@ function openim::util::gen_os_arch() {
echo -e "${RED_PREFIX}Unsupported OS: $OS${COLOR_SUFFIX}"
exit 1
fi
}
}