mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-12 22:16:42 +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/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() {
|
||||
local level="$1"
|
||||
local message="$2"
|
||||
|
|
@ -13,15 +20,9 @@ log_with_style() {
|
|||
|
||||
log_with_style "INFO" "🚀 1. 检测配置文件..."
|
||||
import_config "$@"
|
||||
# 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}"
|
||||
|
||||
fix_config
|
||||
|
||||
# Source env.sh after all config is complete to capture all environment variables
|
||||
export_ql_envs
|
||||
. $dir_shell/env.sh
|
||||
fix_config
|
||||
|
||||
pm2 l &>/dev/null
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user