feat: add all page

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-07-07 18:20:08 +08:00
parent f7bd391ed7
commit d6a89567e5
7 changed files with 171 additions and 100 deletions
+89 -15
View File
@@ -17,11 +17,18 @@
source ./style_info.cfg
source ./path_info.cfg
source ./function.sh
echo -e "\n"
echo -e "${BACKGROUND_BLUE}===============> Building all using make build binary files ${COLOR_SUFFIX}"
echo -e "\n"
echo -e "${BOLD_PREFIX}_____ _ _ _____ _____ _____ _____ _____ _____ _____ _____ _____ ${COLOR_SUFFIX}"
bin_dir="../bin"
logs_dir="../logs"
sdk_db_dir="../db/sdk/"
#Automatically created when there is no bin, logs folder
# Automatically created when there is no bin, logs folder
if [ ! -d $bin_dir ]; then
mkdir -p $bin_dir
fi
@@ -32,19 +39,86 @@ if [ ! -d $sdk_db_dir ]; then
mkdir -p $sdk_db_dir
fi
#begin path
begin_path=$PWD
# OpenIM root path
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
for ((i = 0; i < ${#service_source_root[*]}; i++)); do
cd $begin_path
service_path=${service_source_root[$i]}
cd $service_path
make install
if [ $? -ne 0 ]; then
echo -e "${RED_PREFIX}${service_names[$i]} build failed ${COLOR_SUFFIX}\n"
exit -1
else
echo -e "${GREEN_PREFIX}${service_names[$i]} successfully be built ${COLOR_SUFFIX}\n"
fi
source ./style_info.cfg
source ./path_info.cfg
source ./function.sh
#!/bin/bash
cd $OPENIM_ROOT
# Execute 'make build'
make build
# Get the current operating system and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
# Select the repository home directory based on the operating system and architecture
if [[ "$OS" == "darwin" ]]; then
if [[ "$ARCH" == "x86_64" ]]; then
REPO_DIR="darwin/amd64"
else
REPO_DIR="darwin/386"
fi
elif [[ "$OS" == "linux" ]]; then
if [[ "$ARCH" == "x86_64" ]]; then
REPO_DIR="linux/amd64"
elif [[ "$ARCH" == "arm64" ]]; then
REPO_DIR="linux/arm64"
elif [[ "$ARCH" == "mips64" ]]; then
REPO_DIR="linux/mips64"
elif [[ "$ARCH" == "mips64le" ]]; then
REPO_DIR="linux/mips64le"
elif [[ "$ARCH" == "ppc64le" ]]; then
REPO_DIR="linux/ppc64le"
elif [[ "$ARCH" == "s390x" ]]; then
REPO_DIR="linux/s390x"
else
REPO_DIR="linux/386"
fi
elif [[ "$OS" == "windows" ]]; then
if [[ "$ARCH" == "x86_64" ]]; then
REPO_DIR="windows/amd64"
else
REPO_DIR="windows/386"
fi
else
echo -e "${RED_PREFIX}Unsupported OS: $OS${COLOR_SUFFIX}"
exit 1
fi
# Determine if all scripts were successfully built
BUILD_SUCCESS=true
FAILED_SCRIPTS=()
for binary in $(find _output/bin/platforms/$REPO_DIR -type f); do
if [[ ! -x $binary ]]; then
FAILED_SCRIPTS+=("$binary")
BUILD_SUCCESS=false
fi
done
echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX}
echo -e " \n"
echo -e "${BOLD_PREFIX}=====================> Build Results <=====================${COLOR_SUFFIX}"
echo -e " \n"
if [[ "$BUILD_SUCCESS" == true ]]; then
echo -e "${GREEN_PREFIX}All binaries built successfully.${COLOR_SUFFIX}"
else
echo -e "${RED_PREFIX}Some binary builds failed. Please check the following binary files:${COLOR_SUFFIX}"
for script in "${FAILED_SCRIPTS[@]}"; do
echo -e "${RED_PREFIX}$script${COLOR_SUFFIX}"
done
fi
echo -e " \n"
echo -e "${BOLD_PREFIX}============================================================${COLOR_SUFFIX}"
echo -e " \n"