mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-27 05:52:29 +08:00
feat: scripts feature extend
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
fabdd4b313
commit
d9e4899da5
15
Makefile
15
Makefile
@ -53,6 +53,11 @@ export USAGE_OPTIONS
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Targets
|
# Targets
|
||||||
|
|
||||||
|
## demo: Run demo get started with Makefiles quickly ✨
|
||||||
|
.PHONY: demo
|
||||||
|
demo:
|
||||||
|
@$(MAKE) go.demo
|
||||||
|
|
||||||
## build: Build binaries by default ✨
|
## build: Build binaries by default ✨
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
@ -77,6 +82,11 @@ restart: clean stop build start
|
|||||||
multiarch:
|
multiarch:
|
||||||
@$(MAKE) go.build.multiarch
|
@$(MAKE) go.build.multiarch
|
||||||
|
|
||||||
|
## verify: execute all verity scripts. ✨
|
||||||
|
.PHONY: verify
|
||||||
|
verify:
|
||||||
|
@$(MAKE) go.verify
|
||||||
|
|
||||||
## install: Install deployment openim ✨
|
## install: Install deployment openim ✨
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
@ -205,11 +215,6 @@ advertise:
|
|||||||
release: release.verify release.ensure-tag
|
release: release.verify release.ensure-tag
|
||||||
@scripts/release.sh
|
@scripts/release.sh
|
||||||
|
|
||||||
## demo: Run demo ✨
|
|
||||||
.PHONY: demo
|
|
||||||
demo:
|
|
||||||
@$(MAKE) go.demo
|
|
||||||
|
|
||||||
## help: Show this help info. ✨
|
## help: Show this help info. ✨
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help: Makefile
|
help: Makefile
|
||||||
|
|||||||
@ -99,8 +99,10 @@ services:
|
|||||||
command: minio server /data --console-address ':9090'
|
command: minio server /data --console-address ':9090'
|
||||||
|
|
||||||
openim-server:
|
openim-server:
|
||||||
image: ghcr.io/openimsdk/openim-server:latest
|
# image: ghcr.io/openimsdk/openim-server:latest
|
||||||
# build: .
|
image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:v3.2.1-beta.4
|
||||||
|
# image: openim/openim-server:latest
|
||||||
|
# build: .
|
||||||
container_name: openim-server
|
container_name: openim-server
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/openim/openim-server/logs
|
- ./logs:/openim/openim-server/logs
|
||||||
@ -122,13 +124,16 @@ services:
|
|||||||
max-file: "2"
|
max-file: "2"
|
||||||
|
|
||||||
openim-chat:
|
openim-chat:
|
||||||
image: ghcr.io/openimsdk/openim-chat:latest
|
# image: ghcr.io/openimsdk/openim-chat:latest
|
||||||
|
image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
|
||||||
|
# image: openim/openim-chat:latest
|
||||||
container_name: openim-chat
|
container_name: openim-chat
|
||||||
volumes:
|
volumes:
|
||||||
- ./_output/openim/openim-chat/logs:/openim/openim-chat/logs
|
- ${DATA_DIR}/_output/openim/openim-chat/logs:/openim/openim-chat/logs
|
||||||
- ./_output/openim/openim-chat/config:/openim/openim-chat/config
|
- ${DATA_DIR}/_output/openim/openim-chat/config:/openim/openim-chat/config
|
||||||
- ./_output/openim/openim-chat/scripts:/openim/openim-chat/scripts
|
- ${DATA_DIR}/_output/openim/openim-chat/scripts:/openim/openim-chat/scripts
|
||||||
restart: always
|
restart: always
|
||||||
|
user: root:root
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
- mongodb
|
- mongodb
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
# WHAT: Directory names to build. If any of these directories has a 'main'
|
# WHAT: Directory names to build. If any of these directories has a 'main'
|
||||||
# package, the build will produce executable files under $(OUT_DIR)/bin/platforms OR $(OUT_DIR)/bin—tools/platforms.
|
# package, the build will produce executable files under $(OUT_DIR)/bin/platforms OR $(OUT_DIR)/bin—tools/platforms.
|
||||||
# If not specified, "everything" will be built.
|
# If not specified, "everything" will be built.
|
||||||
# Usage: `scripts/build_all_server.sh`.
|
# Usage: `scripts/build_all_service.sh`.
|
||||||
# Example: `hack/build-go.sh WHAT=cmd/kubelet`.
|
# Example: `hack/build-go.sh WHAT=cmd/kubelet`.
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
@ -45,7 +45,7 @@ else
|
|||||||
fi
|
fi
|
||||||
echo -e "${GREEN_PREFIX}======> cpu_count=$cpu_count${COLOR_SUFFIX}"
|
echo -e "${GREEN_PREFIX}======> cpu_count=$cpu_count${COLOR_SUFFIX}"
|
||||||
|
|
||||||
openim::log::status "Building OpenIM, Parallel compilation compile=$cpu_count"
|
openim::log::info "Building OpenIM, Parallel compilation compile=$cpu_count"
|
||||||
compile_count=$((cpu_count / 2))
|
compile_count=$((cpu_count / 2))
|
||||||
|
|
||||||
# For help output
|
# For help output
|
||||||
@ -58,14 +58,24 @@ openim::color::echo $COLOR_CYAN "NOTE: $0 has been replaced by 'make multiarch'
|
|||||||
echo
|
echo
|
||||||
echo "The equivalent of this invocation is: "
|
echo "The equivalent of this invocation is: "
|
||||||
echo " make build ${ARGHELP}"
|
echo " make build ${ARGHELP}"
|
||||||
|
echo " ./scripts/build_all_service.sh ${ARGHELP}"
|
||||||
echo
|
echo
|
||||||
echo " Example: "
|
echo " Example: "
|
||||||
echo " Print a single binary:"
|
echo " Print a single binary:"
|
||||||
echo " make build BINS=openim-api"
|
echo " make build BINS=openim-api"
|
||||||
|
echo " ./scripts/build_all_service.sh BINS=openim-api"
|
||||||
echo " Print : Enable debugging and logging"
|
echo " Print : Enable debugging and logging"
|
||||||
echo " make build BINS=openim-api V=1 DEBUG=1"
|
echo " make build BINS=openim-api V=1 DEBUG=1"
|
||||||
|
echo " ./scripts/build_all_service.sh BINS=openim-api V=1 DEBUG=1"
|
||||||
echo
|
echo
|
||||||
make --no-print-directory -C "${OPENIM_ROOT}" -j$compile_count build "$*"
|
|
||||||
|
if [ -z "$*" ]; then
|
||||||
|
openim::log::info "no args, build all service"
|
||||||
|
make --no-print-directory -C "${OPENIM_ROOT}" -j$compile_count build
|
||||||
|
else
|
||||||
|
openim::log::info "build service: $*"
|
||||||
|
make --no-print-directory -C "${OPENIM_ROOT}" -j$compile_count build "$*"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
openim::log::success "all service build success, run 'make start' or './scripts/start_all.sh'"
|
openim::log::success "all service build success, run 'make start' or './scripts/start_all.sh'"
|
||||||
|
|||||||
7
scripts/docker_start_all.sh
Executable file → Normal file
7
scripts/docker_start_all.sh
Executable file → Normal file
@ -58,3 +58,10 @@ sleep 15
|
|||||||
|
|
||||||
#fixme prevents the openIM service exit after execution in the docker container
|
#fixme prevents the openIM service exit after execution in the docker container
|
||||||
tail -f /dev/null
|
tail -f /dev/null
|
||||||
|
|
||||||
|
# nohup ./bin/seata-server.sh > ./logs/seata.log.out 2>&1 &
|
||||||
|
|
||||||
|
# # seata注册到nacos的ip和端口,不配置默认获取本机ip(docker容器ip)
|
||||||
|
# echo $SEATA_IP $SEATA_PORT
|
||||||
|
|
||||||
|
# tail -f logs/seata.log.out
|
||||||
@ -213,6 +213,18 @@ go.format: tools.verify.golines tools.verify.goimports
|
|||||||
go.imports: tools.verify.goimports
|
go.imports: tools.verify.goimports
|
||||||
@$(TOOLS_DIR)/goimports -l -w $(SRC)
|
@$(TOOLS_DIR)/goimports -l -w $(SRC)
|
||||||
|
|
||||||
|
## verify: execute all verity scripts.
|
||||||
|
.PHONY: go.verify
|
||||||
|
go.verify:
|
||||||
|
@echo "Starting verification..."
|
||||||
|
@scripts_list=$$(find $(ROOT_DIR)/scripts -type f -name 'verify-*' | sort); \
|
||||||
|
for script in $$scripts_list; do \
|
||||||
|
echo "Executing $$script..."; \
|
||||||
|
$$script || exit 1; \
|
||||||
|
echo "$$script completed successfully"; \
|
||||||
|
done
|
||||||
|
@echo "All verification scripts executed successfully."
|
||||||
|
|
||||||
## go.updates: Check for updates to go.mod dependencies
|
## go.updates: Check for updates to go.mod dependencies
|
||||||
.PHONY: go.updates
|
.PHONY: go.updates
|
||||||
go.updates: tools.verify.go-mod-outdated
|
go.updates: tools.verify.go-mod-outdated
|
||||||
|
|||||||
@ -16,15 +16,12 @@
|
|||||||
#FIXME This script is the startup script for multiple servers.
|
#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.
|
#FIXME The full names of the shell scripts that need to be started are placed in the `need_to_start_server_shell` array.
|
||||||
|
|
||||||
#Include shell font styles and some basic information
|
set -o errexit
|
||||||
SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
set -o nounset
|
||||||
OPENIM_ROOT=$(dirname "${SCRIPTS_ROOT}")/..
|
set -o pipefail
|
||||||
|
|
||||||
#Include shell font styles and some basic information
|
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
source $SCRIPTS_ROOT/lib/init.sh
|
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||||
source $SCRIPTS_ROOT/path_info.sh
|
|
||||||
|
|
||||||
cd $SCRIPTS_ROOT
|
|
||||||
|
|
||||||
if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then
|
if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then
|
||||||
# exec build_all_service.sh
|
# exec build_all_service.sh
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
# This script checks commonly misspelled English words in all files in the
|
# This script checks commonly misspelled English words in all files in the
|
||||||
# working directory by client9/misspell package.
|
# working directory by client9/misspell package.
|
||||||
# Usage: `scripts/verify-spelling.sh`.
|
# Usage: `scripts/verify-spelling.sh`.
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
# This script does a fast type check of script srnetes code for all platforms.
|
# This script does a fast type check of script srnetes code for all platforms.
|
||||||
# Usage: `scripts/verify-typecheck.sh`.
|
# Usage: `scripts/verify-typecheck.sh`.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user