mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-13 14:35:40 +08:00
Refactor: Extract export_ql_envs function and move env.sh sourcing earlier
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
dc266e3148
commit
9a877ddc22
|
|
@ -3,6 +3,13 @@
|
||||||
dir_shell=/ql/shell
|
dir_shell=/ql/shell
|
||||||
. $dir_shell/share.sh
|
. $dir_shell/share.sh
|
||||||
|
|
||||||
|
export_ql_envs() {
|
||||||
|
# Export BACK_PORT from QlPort for backend server to use
|
||||||
|
export BACK_PORT="${ql_port}"
|
||||||
|
# Export GRPC_PORT from QlGrpcPort for gRPC server to use
|
||||||
|
export GRPC_PORT="${ql_grpc_port}"
|
||||||
|
}
|
||||||
|
|
||||||
log_with_style() {
|
log_with_style() {
|
||||||
local level="$1"
|
local level="$1"
|
||||||
local message="$2"
|
local message="$2"
|
||||||
|
|
@ -13,15 +20,9 @@ log_with_style() {
|
||||||
|
|
||||||
log_with_style "INFO" "🚀 1. 检测配置文件..."
|
log_with_style "INFO" "🚀 1. 检测配置文件..."
|
||||||
import_config "$@"
|
import_config "$@"
|
||||||
# Export BACK_PORT from QlPort for backend server to use
|
export_ql_envs
|
||||||
export BACK_PORT="${ql_port}"
|
|
||||||
# Export GRPC_PORT from QlGrpcPort for gRPC server to use
|
|
||||||
export GRPC_PORT="${ql_grpc_port}"
|
|
||||||
|
|
||||||
fix_config
|
|
||||||
|
|
||||||
# Source env.sh after all config is complete to capture all environment variables
|
|
||||||
. $dir_shell/env.sh
|
. $dir_shell/env.sh
|
||||||
|
fix_config
|
||||||
|
|
||||||
pm2 l &>/dev/null
|
pm2 l &>/dev/null
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user