Commit ad44cf1b authored by tywldx's avatar tywldx

增加api2

parent ea78e8f9
...@@ -87,15 +87,16 @@ do ...@@ -87,15 +87,16 @@ do
ip_arr=(${IP_host//./ }) ip_arr=(${IP_host//./ })
ipfirst="${ip_arr[0]}.${ip_arr[1]}.${ip_arr[2]}" ipfirst="${ip_arr[0]}.${ip_arr[1]}.${ip_arr[2]}"
iplast="${ip_arr[3]}" iplast="${ip_arr[3]}"
ip_last_repeat=${ip_last//./-}
projectAndPorts=`node $config_server/get_project_config.js -type multi -attr port -attr2 true` projectAndPorts=`node $config_server/get_project_config.js -type multi -attr port -attr2 true`
for projectAndPort in ${projectAndPorts[@]} for projectAndPort in ${projectAndPorts[@]}
do do
var=(${projectAndPort//|/ }) var=(${projectAndPort//|/ })
ip_last_repeat=${ip_last//./-}
project_name="${var[0]}" project_name="${var[0]}"
sub_doman="${var[0]}-${ip_last}" sub_doman="${var[0]}-${ip_last}"
target_ip="$ipfirst.$iplast" target_ip="$ipfirst.$ip_last_repeat"
http_port="${var[1]}" http_port="${var[1]}"
https_port="${var[1]}" https_port="${var[1]}"
file_name="$nginxname/$target_ip.conf" file_name="$nginxname/$target_ip.conf"
...@@ -109,10 +110,11 @@ done ...@@ -109,10 +110,11 @@ done
for host_name in ${dockernamespace[@]} for host_name in ${dockernamespace[@]}
do do
projectAndPorts=`node $config_server/get_project_config.js -type multi -attr port/url -attr2 true` projectAndPorts=`node $config_server/get_project_config.js -type multi -attr port/url -attr2 true`
namespace=(${host_name//|/ })
for projectAndPort in ${projectAndPorts[@]} for projectAndPort in ${projectAndPorts[@]}
do do
var=(${projectAndPort//|/ }) var=(${projectAndPort//|/ })
namespace=(${host_name//|/ })
# echo "${var[2]}/${namespace[0]}/${namespace[1]}/${namespace[2]}/${namespace[3]}" # echo "${var[2]}/${namespace[0]}/${namespace[1]}/${namespace[2]}/${namespace[3]}"
project_name="${var[0]}" project_name="${var[0]}"
sub_doman="${var[2]}-${namespace[0]}" sub_doman="${var[2]}-${namespace[0]}"
...@@ -124,7 +126,9 @@ do ...@@ -124,7 +126,9 @@ do
if [[ ${var[0]} != "xjd-ui" ]] && [[ ${var[0]} != "new-paycenter-ui" ]];then if [[ ${var[0]} != "xjd-ui" ]] && [[ ${var[0]} != "new-paycenter-ui" ]];then
createNginxHttpAndSSLConf $project_name $sub_doman $target_ip $http_port $https_port $file_name createNginxHttpAndSSLConf $project_name $sub_doman $target_ip $http_port $https_port $file_name
fi fi
done done
# 单独增加passportapi2
createNginxHttpAndSSLConf xyqb-user2-api2 passportapi2 ${namespace[1]} ${namespace[2]} ${namespace[3]} $nginxname/${namespace[0]}.conf
done done
nginx -s reload nginx -s reload
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment