Commit eb4ca9cb authored by tywldx's avatar tywldx

修改NODE的启动方式

parent 5d1bf8fd
...@@ -67,21 +67,25 @@ function restartNodeProject() ...@@ -67,21 +67,25 @@ function restartNodeProject()
{ {
project=$1 project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc` desc=`node $config_server/get_project_config.js -name $project -attr desc`
stop_command=`node $config_server/get_project_config.js -name $project -attr command2`
sh $config_server/show_info.sh $project 重新启动 $desc sh $config_server/show_info.sh $project 重新启动 $desc
cd $project_path/$project cd $project_path/$project
$stop_command
forever stop $project # forever stop $project
forever stop $project-www # forever stop $project-www
setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print` # pm2 stop $project
echo "------setup_path_temp:$setup_path_temp" start_command=`node $config_server/get_project_config.js -name $project -attr command`
$start_command
echo `forever start -a -s --uid $project ${setup_path_temp}` # setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print`
# echo "------setup_path_temp:$setup_path_temp"
setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print` #
if [ -n "$setup_path_temp_for_appbackent" ];then # echo `forever start -a -s --uid $project ${setup_path_temp}`
echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &" #
echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}` # setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print`
fi # if [ -n "$setup_path_temp_for_appbackent" ];then
# echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &"
# echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}`
# fi
} }
function restartPythonProject() function restartPythonProject()
......
...@@ -67,21 +67,26 @@ function restartNodeProject() ...@@ -67,21 +67,26 @@ function restartNodeProject()
for project in ${projects[@]} for project in ${projects[@]}
do do
desc=`node $config_server/get_project_config.js -name $project -attr desc` desc=`node $config_server/get_project_config.js -name $project -attr desc`
stop_command=`node $config_server/get_project_config.js -name $project -attr command2`
sh $config_server/show_info.sh $project 重新启动 $desc sh $config_server/show_info.sh $project 重新启动 $desc
cd $project_path/$project cd $project_path/$project
forever stop $project $stop_command
forever stop $project-www # forever stop $project
setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print` # forever stop $project-www
echo "------setup_path_temp:$setup_path_temp" # pm2 stop $project
start_command=`node $config_server/get_project_config.js -name $project -attr command`
echo `forever start -a -s --uid $project ${setup_path_temp}` $start_command
# setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print`
setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print` # echo "------setup_path_temp:$setup_path_temp"
if [ -n "$setup_path_temp_for_appbackent" ];then #
echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &" # echo `forever start -a -s --uid $project ${setup_path_temp}`
echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}` #
fi # setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print`
# if [ -n "$setup_path_temp_for_appbackent" ];then
# echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &"
# echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}`
# fi
done done
} }
......
...@@ -46,21 +46,25 @@ function restartNodeProject() ...@@ -46,21 +46,25 @@ function restartNodeProject()
{ {
project=$1 project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc` desc=`node $config_server/get_project_config.js -name $project -attr desc`
stop_command=`node $config_server/get_project_config.js -name $project -attr command2`
sh $config_server/show_info.sh $project 重新启动 $desc sh $config_server/show_info.sh $project 重新启动 $desc
cd $project_path/$project cd $project_path/$project
$stop_command
forever stop $project # forever stop $project
forever stop $project-www # forever stop $project-www
setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print` # pm2 stop $project
echo "------setup_path_temp:$setup_path_temp" start_command=`node $config_server/get_project_config.js -name $project -attr command`
$start_command
echo `forever start -a -s --uid $project ${setup_path_temp}` # setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print`
# echo "------setup_path_temp:$setup_path_temp"
setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print` #
if [ -n "$setup_path_temp_for_appbackent" ];then # echo `forever start -a -s --uid $project ${setup_path_temp}`
echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &" #
echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}` # setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print`
fi # if [ -n "$setup_path_temp_for_appbackent" ];then
# echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &"
# echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}`
# fi
} }
function restartPythonProject() function restartPythonProject()
......
...@@ -18,13 +18,14 @@ var users = [{}, { ...@@ -18,13 +18,14 @@ var users = [{}, {
var pClass = function() {}; var pClass = function() {};
pClass.prototype = { pClass.prototype = {
init: function(isActive, projectType, port, projectName, gitPath, logName, configFile, command, nodeVersion, userIndex, desc, auth) { init: function(isActive, projectType, port, projectName, gitPath, logName, configFile, command, nodeVersion, userIndex, desc, auth, command2) {
this.name = projectName; this.name = projectName;
this.type = projectType; this.type = projectType;
this.git_path = "http://" + users[userIndex].name + ":" + users[userIndex].pwd + "@gitabc.xyqb.com/" + gitPath + "/" + projectName + ".git" this.git_path = "http://" + users[userIndex].name + ":" + users[userIndex].pwd + "@gitabc.xyqb.com/" + gitPath + "/" + projectName + ".git"
this.log_name = logName; this.log_name = logName;
this.config_file = configFile; this.config_file = configFile;
this.command = command; this.command = command;
this.command2 = command2;
this.node_version = nodeVersion; this.node_version = nodeVersion;
this.port = port; this.port = port;
this.desc = desc; this.desc = desc;
...@@ -48,52 +49,52 @@ pClass.prototype = { ...@@ -48,52 +49,52 @@ pClass.prototype = {
} }
} }
// projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion // projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion
new pClass().init(true, "java", "7003", "xyqb", "QG", "xyqb.log", "application.properties", null, null, 2, "现金贷和白条-server"); new pClass().init(true, "java", "7003", "xyqb", "QG", "xyqb.log", "application.properties", null, null, 2, "现金贷和白条-server","");
new pClass().init(true, "java", "7019", "xyqb-mall", "QG", "mall.log", "application.properties", null, null, 2, "商城后台-server"); new pClass().init(true, "java", "7019", "xyqb-mall", "QG", "mall.log", "application.properties", null, null, 2, "商城后台-server","");
new pClass().init(true, "java", "7010", "xyqb-offline", "QG", "xyqb_offline.log", "application.properties", null, null, 2, "线下业务-server"); new pClass().init(true, "java", "7010", "xyqb-offline", "QG", "xyqb_offline.log", "application.properties", null, null, 2, "线下业务-server","");
new pClass().init(true, "java", "7042", "xyqb-user2", "head_group", "xyqb_user.log", "application.properties", null, null, 2, "用户注册登录-V2-server"); new pClass().init(true, "java", "7042", "xyqb-user2", "head_group", "xyqb_user.log", "application.properties", null, null, 2, "用户注册登录-V2-server","");
new pClass().init(true, "java", "7005", "di-ting", "QG", "di_ting.log", "application.properties", null, null, 2, "风控审计-server"); new pClass().init(true, "java", "7005", "di-ting", "QG", "di_ting.log", "application.properties", null, null, 2, "风控审计-server","");
new pClass().init(true, "java", "7013", "han-gu-guan", "QG", "han-gu-guan.log", "application.properties", null, null, 2, "用户注册登录-V1-server"); new pClass().init(true, "java", "7013", "han-gu-guan", "QG", "han-gu-guan.log", "application.properties", null, null, 2, "用户注册登录-V1-server","");
new pClass().init(true, "java", "7015", "jian-men-guan", "QG", "jian_men_guan.log", "application.properties", null, null, 2, "信审服务-server"); new pClass().init(true, "java", "7015", "jian-men-guan", "QG", "jian_men_guan.log", "application.properties", null, null, 2, "信审服务-server","");
new pClass().init(true, "java", "7028", "black-hole", "QG", "black-hole.log", "application.properties", null, null, 2, "合同中心-server"); new pClass().init(true, "java", "7028", "black-hole", "QG", "black-hole.log", "application.properties", null, null, 2, "合同中心-server","");
new pClass().init(true, "java", "7006", "gu-bei", "QG", "pay-center.log", "application.properties", null, null, 2, "支付中心-server"); new pClass().init(true, "java", "7006", "gu-bei", "QG", "pay-center.log", "application.properties", null, null, 2, "支付中心-server","");
new pClass().init(true, "java", "7023", "xyqb-quartz", "QG", "quartz.log", "application.properties", null, null, 2, "定时任务-server"); new pClass().init(true, "java", "7023", "xyqb-quartz", "QG", "quartz.log", "application.properties", null, null, 2, "定时任务-server","");
new pClass().init(true, "java", "7021", "spider-center", "QG", "spider-center.log", "application.properties", null, null, 2, "授信-server"); new pClass().init(true, "java", "7021", "spider-center", "QG", "spider-center.log", "application.properties", null, null, 2, "授信-server","");
new pClass().init(true, "java", "7037", "cash-loan-flow", "QG", "cash_loan_flow.log", "application.properties", null, null, 2, "现金贷流量对接-server"); new pClass().init(true, "java", "7037", "cash-loan-flow", "QG", "cash_loan_flow.log", "application.properties", null, null, 2, "现金贷流量对接-server","");
new pClass().init(true, "java", "7012", "financial-system", "QG", "financial_system.log", "application.properties", null, null, 2, "财务系统-server"); new pClass().init(true, "java", "7012", "financial-system", "QG", "financial_system.log", "application.properties", null, null, 2, "财务系统-server","");
new pClass().init(true, "java", "7034", "fund-manage", "QG", "fund_manage.log", "application.properties", null, null, 2, "债转系统-server"); new pClass().init(true, "java", "7034", "fund-manage", "QG", "fund_manage.log", "application.properties", null, null, 2, "债转系统-server","");
new pClass().init(true, "java", "7029", "gyxd", "QG", "gyxd.log", "application.properties", null, null, 2, "广源小贷-server"); new pClass().init(true, "java", "7029", "gyxd", "QG", "gyxd.log", "application.properties", null, null, 2, "广源小贷-server","");
new pClass().init(true, "java", "7038", "merchant-backend", "QG", "merchant.log", "application.properties", null, null, 2, "商户后台-server","凌子华/陈东亮"); new pClass().init(true, "java", "7038", "merchant-backend", "QG", "merchant.log", "application.properties", null, null, 2, "商户后台-server","凌子华/陈东亮");
new pClass().init(true, "java", "7031", "redpacket", "QG", "redpacket.log", "application.properties", null, null, 2, "红包系统-server"); new pClass().init(true, "java", "7031", "redpacket", "QG", "redpacket.log", "application.properties", null, null, 2, "红包系统-server","");
new pClass().init(true, "java", "7044", "finance-api", "bo.wang", "finance-api.log", "application.properties", null, null, 2, "财务系统-server"); new pClass().init(true, "java", "7044", "finance-api", "bo.wang", "finance-api.log", "application.properties", null, null, 2, "财务系统-server","");
new pClass().init(true, "java", "7045", "check-accounts", "QG", "check_accounts.log", "application.properties", null, null, 2, "对账系统-server"); new pClass().init(true, "java", "7045", "check-accounts", "QG", "check_accounts.log", "application.properties", null, null, 2, "对账系统-server","");
new pClass().init(true, "java", "7014", "du-jiang-yan", "QG", "du_jiang_yan.log", "application.properties", null, null, 2, "第三方对接导流-server"); new pClass().init(true, "java", "7014", "du-jiang-yan", "QG", "du_jiang_yan.log", "application.properties", null, null, 2, "第三方对接导流-server","");
// new pClass(true,"java","7027","sms-center","QG","sms-center.log",null,null,null,"短信中心-server"); // new pClass(true,"java","7027","sms-center","QG","sms-center.log",null,null,null,"短信中心-server");
// ui---- // ui----
// projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion // projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion
new pClass().init(true, "ui", "7032", "op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "运营系统-ui"); new pClass().init(true, "ui", "7032", "op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "运营系统-ui","");
new pClass().init(true, "ui", "7040", "activity-ui", "QG", null, "src/app/config.js", "npm run build", "node7", 1, "活动中心-ui"); new pClass().init(true, "ui", "7040", "activity-ui", "QG", null, "src/app/config.js", "npm run build", "node7", 1, "活动中心-ui","");
new pClass().init(true, "ui", "7011", "financial-system-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "财务系统-ui"); new pClass().init(true, "ui", "7011", "financial-system-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "财务系统-ui","");
new pClass().init(true, "ui", "7030", "gyxd-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "广源小贷-ui"); new pClass().init(true, "ui", "7030", "gyxd-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "广源小贷-ui");
new pClass().init(true, "ui", "7008", "offline-ui", "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "线下白条-ui"); new pClass().init(true, "ui", "7008", "offline-ui", "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "线下白条-ui","");
new pClass().init(true, "ui", "7035", "funding-corp-op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "白条债转系统-ui"); new pClass().init(true, "ui", "7035", "funding-corp-op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "白条债转系统-ui","");
new pClass().init(true, "ui", "7007", "paycenter-ui", "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "支付中心-ui"); new pClass().init(true, "ui", "7007", "paycenter-ui", "QG", null, "src/app/config/env.config.js", "npm run build", "node7", 1, "支付中心-ui","");
new pClass().init(true, "ui", "7043", "xyqb-user-ui", "head_group", null, "src/app/config.js", "npm run qa", "node7", 1, "用户注册登录-V2-ui"); new pClass().init(true, "ui", "7043", "xyqb-user-ui", "head_group", null, "src/app/config.js", "npm run qa", "node7", 1, "用户注册登录-V2-ui","");
new pClass().init(true, "ui", "7039", "merchant-op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "商户系统-ui"); new pClass().init(true, "ui", "7039", "merchant-op-ui", "QG", null, "src/js/env.config.js", "npm run build", "node7", 1, "商户系统-ui","");
new pClass().init(true, "ui", "7004", "di-ting-ui", "QG", null, "client/app/config.js", "grunt build", "node4", 1, "信审-ui"); new pClass().init(true, "ui", "7004", "di-ting-ui", "QG", null, "client/app/config.js", "grunt build", "node4", 1, "信审-ui","");
new pClass().init(true, "ui", "7020", "spider-center-ui", "QG", null, "src/app/config/env.config.js", "npm run qa", "node7", 1, "授信中心-ui"); new pClass().init(true, "ui", "7020", "spider-center-ui", "QG", null, "src/app/config/env.config.js", "npm run qa", "node7", 1, "授信中心-ui","");
new pClass().init(true, "ui", "7002", "qgbc-ui", "QG", null, "src/app/config/env.config.js", "npm run build_production", "node7", 1, "现金贷和白条-白条-ui"); new pClass().init(true, "ui", "7002", "qgbc-ui", "QG", null, "src/app/config/env.config.js", "npm run build_production", "node7", 1, "现金贷和白条-白条-ui","");
new pClass().init(true, "ui", "7001", "xyqb-ui", "QG", null, "client/app/config.js", "grunt build", "node4", 1, "现金贷和白条-现金贷-ui"); new pClass().init(true, "ui", "7001", "xyqb-ui", "QG", null, "client/app/config.js", "grunt build", "node4", 1, "现金贷和白条-现金贷-ui","");
new pClass().init(true, "ui", "7046", "activity-op-ui", "QG", null, "src/js/env.config.js", "gulp build", "node7", 1, "优惠券管理后台-ui"); new pClass().init(true, "ui", "7046", "activity-op-ui", "QG", null, "src/js/env.config.js", "gulp build", "node7", 1, "优惠券管理后台-ui","");
new pClass().init(true, "ui", "7048", "order-op-ui", "OP", null, "src/js/env.config.js", "gulp build", "node7", 1, "订单系统-ui"); new pClass().init(true, "ui", "7048", "order-op-ui", "OP", null, "src/js/env.config.js", "gulp build", "node7", 1, "订单系统-ui","");
// node // node
new pClass().init(true, "node", "7018", "AppBackend", "QG", null, "config/environment/test.js", "forever start -a -s --uid AppBackend bin/www", null, 1, "APP后台服务-server"); new pClass().init(true, "node", "7018", "AppBackend", "QG", null, "config/environment/test.js", "forever start -a -s --uid AppBackend bin/www", null, 1, "APP后台服务-server","","forever stop AppBackend");
new pClass().init(true, "node", "7041", "activity-op", "QG", null, "src/config.js", "forever start -a -s --uid activity-op src/app.js", null, 1, "优惠券中心-server"); new pClass().init(true, "node", "7041", "activity-op", "QG", null, "src/config.js", "forever start -a -s --uid activity-op src/app.js", null, 1, "优惠券中心-server","forever stop activity-op");
new pClass().init(true, "node", "7047", "op-api", "OP", null, "src/config.js", "pm2 start ./bin/server.js --node-args=\"--harmony\" -n op-api", null, 1, "系统Api Gateway-server"); new pClass().init(true, "node", "7047", "op-api", "OP", null, "src/config.js", "sh start.sh", null, 1, "系统Api Gateway-server","sh stop.sh");
//python //python
new pClass().init(true, "python", "7022", "qin-qiong", "QG", null, "config/beta/config.properties", null, null, 1, "加密解密-server"); new pClass().init(true, "python", "7022", "qin-qiong", "QG", null, "config/beta/config.properties", null, null, 1, "加密解密-server","");
new pClass().init(true, "python", "7033", "xyqb-query", "QG", null, "server/config/beta/config.ini", null, null, 1, "query-server"); new pClass().init(true, "python", "7033", "xyqb-query", "QG", null, "server/config/beta/config.ini", null, null, 1, "query-server","");
new pClass().init(false, "python", "7027", "msg-center", "QG", null, "server/config/beta/config.ini", null, null, 1, "短信中心-以前的sms-center"); new pClass().init(false, "python", "7027", "msg-center", "QG", null, "server/config/beta/config.ini", null, null, 1, "短信中心-以前的sms-center","");
var temp = ""; var temp = "";
......
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