1. Currently, there are 4 Rancher environment variables (no default values set, must be configured) whose values share a common part: dev.xxx.cn
PCS_API_CFG_SCMS_EDITOR_HOST_INFO=https://editor.dev.xxx.cn # HOME URL of the content management system editor
PCS_API_CFG_PCS_API_ASSET_HOST_INFO=https://web.dev.xxx.cn # HOME URL of the planning and command system interface resources
PCS_API_CFG_CPU_HOST_INFO=https://fcpu.dev.xxx.cn # HOME URL for CP uploads
PCS_API_CFG_SCMS_FRONT_HOST_INFO=https://web.dev.xxx.cn # HOME URL of the HTTP client frontend for the content management system
2. In the new phase, update the 4 Rancher environment variables (default values are now set, so configuration is optional). Add a new environment variable for the common part: RMT_MAIN_DOMAIN
RMT_MAIN_DOMAIN=dev.xxx.cn # Main domain of the converged media environment
PCS_API_CFG_SCMS_EDITOR_HOST_INFO=https://editor.${RMT_MAIN_DOMAIN} # HOME URL of the content management system editor
PCS_API_CFG_PCS_API_ASSET_HOST_INFO=https://web.${RMT_MAIN_DOMAIN} # HOME URL of the planning and command system interface resources
PCS_API_CFG_CPU_HOST_INFO=https://fcpu.${RMT_MAIN_DOMAIN} # HOME URL for CP uploads
PCS_API_CFG_SCMS_FRONT_HOST_INFO=https://web.${RMT_MAIN_DOMAIN} # HOME URL of the HTTP client frontend for the content management system
3. The Shell script is shown below. See Figure 1.

# Rancher 环境变量(未设置默认值,必须设置)
if [[ `echo $RMT_MAIN_DOMAIN` == '' ]]
then
echo "需要设置 RMT_MAIN_DOMAIN"
exit 1
else
echo "设置的 RMT_MAIN_DOMAIN 为:$RMT_MAIN_DOMAIN"
fi
# Rancher 环境变量(已设置默认值,可无需设置)
env | grep "PCS_API_CFG_SCMS_EDITOR_HOST_INFO" || export PCS_API_CFG_SCMS_EDITOR_HOST_INFO="https://editor.${RMT_MAIN_DOMAIN}"
sed -i "s#PCS_API_CFG_SCMS_EDITOR_HOST_INFO#$PCS_API_CFG_SCMS_EDITOR_HOST_INFO#g" $DEV_COMMON_CONFIG_PARAMS_LOCAL_PATH
echo "PCS_API_CFG_SCMS_EDITOR_HOST_INFO replace $PCS_API_CFG_SCMS_EDITOR_HOST_INFO -> $DEV_COMMON_CONFIG_PARAMS_LOCAL_PATH"
echo "PCS_API_CFG_SCMS_EDITOR_HOST_INFO replace $PCS_API_CFG_SCMS_EDITOR_HOST_INFO -> $DEV_COMMON_CONFIG_PARAMS_LOCAL_PATH" >> $DIR/change.log
4. When the environment variable RMT_MAIN_DOMAIN is not added in Rancher, upgrading the container throws an error. See Figure 2.

/config/init/config0.sh: line 18: RMT_MAIN_DOMAIN: unbound variable
需要设置 RMT_MAIN_DOMAIN
5. When the environment variable RMT_MAIN_DOMAIN= is added in Rancher with an empty string value, upgrading the container throws an error. See Figure 3.

需要设置 RMT_MAIN_DOMAIN
6. When the environment variable RMT_MAIN_DOMAIN=dev.xxx.cn is added in Rancher with the value dev.xxx.cn, the container upgrade succeeds and the environment variable takes effect. See Figure 4.

// 内容管理系统编辑器
'scmsEditor' => [
'hostInfo' => 'https://editor.dev.xxx.cn', // HOME URL
'baseUrl' => '', // BASE URL
],
