feat: scripts feature extend

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/825/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent fabdd4b313
commit d9e4899da5
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE

@ -53,6 +53,11 @@ export USAGE_OPTIONS
# ==============================================================================
# Targets
## demo: Run demo get started with Makefiles quickly ✨
.PHONY: demo
demo:
@$(MAKE) go.demo
## build: Build binaries by default ✨
.PHONY: build
build:
@ -77,6 +82,11 @@ restart: clean stop build start
multiarch:
@$(MAKE) go.build.multiarch
## verify: execute all verity scripts. ✨
.PHONY: verify
verify:
@$(MAKE) go.verify
## install: Install deployment openim ✨
.PHONY: install
install:
@ -205,11 +215,6 @@ advertise:
release: release.verify release.ensure-tag
@scripts/release.sh
## demo: Run demo ✨
.PHONY: demo
demo:
@$(MAKE) go.demo
## help: Show this help info. ✨
.PHONY: help
help: Makefile

@ -99,8 +99,10 @@ services:
command: minio server /data --console-address ':9090'
openim-server:
image: ghcr.io/openimsdk/openim-server:latest
# build: .
# image: ghcr.io/openimsdk/openim-server:latest
image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:v3.2.1-beta.4
# image: openim/openim-server:latest
# build: .
container_name: openim-server
volumes:
- ./logs:/openim/openim-server/logs
@ -122,13 +124,16 @@ services:
max-file: "2"
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
volumes:
- ./_output/openim/openim-chat/logs:/openim/openim-chat/logs
- ./_output/openim/openim-chat/config:/openim/openim-chat/config
- ./_output/openim/openim-chat/scripts:/openim/openim-chat/scripts
- ${DATA_DIR}/_output/openim/openim-chat/logs:/openim/openim-chat/logs
- ${DATA_DIR}/_output/openim/openim-chat/config:/openim/openim-chat/config
- ${DATA_DIR}/_output/openim/openim-chat/scripts:/openim/openim-chat/scripts
restart: always
user: root:root
depends_on:
- mysql
- mongodb

@ -19,7 +19,7 @@
# 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.
# 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`.
set -o errexit
@ -45,7 +45,7 @@ else
fi
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))
# For help output
@ -58,14 +58,24 @@ openim::color::echo $COLOR_CYAN "NOTE: $0 has been replaced by 'make multiarch'
echo
echo "The equivalent of this invocation is: "
echo " make build ${ARGHELP}"
echo " ./scripts/build_all_service.sh ${ARGHELP}"
echo
echo " Example: "
echo " Print a single binary:"
echo " make build BINS=openim-api"
echo " ./scripts/build_all_service.sh BINS=openim-api"
echo " Print : Enable debugging and logging"
echo " make build BINS=openim-api V=1 DEBUG=1"
echo " ./scripts/build_all_service.sh BINS=openim-api V=1 DEBUG=1"
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
openim::log::success "all service build success, run 'make start' or './scripts/start_all.sh'"

@ -58,3 +58,10 @@ sleep 15
#fixme prevents the openIM service exit after execution in the docker container
tail -f /dev/null
# nohup ./bin/seata-server.sh > ./logs/seata.log.out 2>&1 &
# # seata注册到nacos的ip和端口不配置默认获取本机ipdocker容器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
@$(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
.PHONY: go.updates
go.updates: tools.verify.go-mod-outdated

@ -16,15 +16,12 @@
#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.
#Include shell font styles and some basic information
SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
OPENIM_ROOT=$(dirname "${SCRIPTS_ROOT}")/..
set -o errexit
set -o nounset
set -o pipefail
#Include shell font styles and some basic information
source $SCRIPTS_ROOT/lib/init.sh
source $SCRIPTS_ROOT/path_info.sh
cd $SCRIPTS_ROOT
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${OPENIM_ROOT}/scripts/lib/init.sh"
if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then
# exec build_all_service.sh

@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# This script checks commonly misspelled English words in all files in the
# working directory by client9/misspell package.
# Usage: `scripts/verify-spelling.sh`.

@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# This script does a fast type check of script srnetes code for all platforms.
# Usage: `scripts/verify-typecheck.sh`.

Loading…
Cancel
Save