From 31c6f61dc10a3dc76033f5d92f90003992a6177d Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Sun, 26 Dec 2021 15:45:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=2037=20gam?= =?UTF-8?q?e-server=20env=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exclude-file.txt | 5 ++++ game-server/app.ts | 2 +- game-server/config/database.ts | 8 ++++++- game-server/config/master.ts | 5 ++++ game-server/config/serverName.ts | 4 ++++ game-server/config/servers.ts | 40 +++++++++++++++++++++++++++++++- pushdocker.sh | 18 +++++++++----- 7 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 exclude-file.txt diff --git a/exclude-file.txt b/exclude-file.txt new file mode 100644 index 000000000..83cf1905c --- /dev/null +++ b/exclude-file.txt @@ -0,0 +1,5 @@ +.* +logs +node_modules +dist +bower_components diff --git a/game-server/app.ts b/game-server/app.ts index cdc466964..46b30dd2f 100644 --- a/game-server/app.ts +++ b/game-server/app.ts @@ -46,7 +46,7 @@ filePath.CONFIG_DIR = '/config'; const adminfilePath = _pinus.DEFAULT_ADMIN_PATH; adminfilePath.ADMIN_FILENAME = 'adminUser'; adminfilePath.ADMIN_USER = 'config/adminUser'; -const ALL_ENVS = 'production|development|alpha|dev|isbn|monitor|distribute'; +const ALL_ENVS = 'production|development|alpha|dev|isbn|monitor|distribute|sq1'; /** * 替换全局Promise * 自动解析sourcemap diff --git a/game-server/config/database.ts b/game-server/config/database.ts index 844a90380..464146eb3 100644 --- a/game-server/config/database.ts +++ b/game-server/config/database.ts @@ -41,5 +41,11 @@ module.exports = { 'gmmongo': 'mongodb://dbop:zyzGm2021@dds-8vb9964bb4cc7f241.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb9964bb4cc7f242.mongodb.zhangbei.rds.aliyuncs.com:3717/zyzgm?replicaSet=mgset-507933150', 'redis': 'r-8vb418l8kkju9sis8k.redis.zhangbei.rds.aliyuncs.com', 'redispw': 'zyz_dev_2021' - } + }, + 'sq1': { + 'mongo': 'mongodb://dbop:zyzSQ2021@dds-8vb7d5060bb271d41.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb7d5060bb271d42.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb7d5060bb271d43.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-508112745', + 'gmmongo': 'mongodb://dbop:zyzSQ2021@dds-8vb5de93552a67941.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb5de93552a67942.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb5de93552a67943.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-508112742', + 'redis': 'r-8vb7l1s8ne4vm6v6x6.redis.zhangbei.rds.aliyuncs.com', + 'redispw': 'PANl3Vr2eozkq4N2' + }, }; \ No newline at end of file diff --git a/game-server/config/master.ts b/game-server/config/master.ts index d4ae37c90..8d0e54185 100644 --- a/game-server/config/master.ts +++ b/game-server/config/master.ts @@ -38,5 +38,10 @@ module.exports = { 'id': 'master-server-1', 'host': '172.26.145.161', 'port': 3005 + }, + 'sq1': { + 'id': 'master-server-1', + 'host': '127.0.0.1', + 'port': 3005 } }; \ No newline at end of file diff --git a/game-server/config/serverName.ts b/game-server/config/serverName.ts index ff71680ee..8653503f8 100644 --- a/game-server/config/serverName.ts +++ b/game-server/config/serverName.ts @@ -26,5 +26,9 @@ module.exports = { 'distribute': { 'type': 'distribute', 'name': '分布式测试' + }, + 'sq1': { + 'type': 'sq1', + 'name': '1月功能测试' } }; \ No newline at end of file diff --git a/game-server/config/servers.ts b/game-server/config/servers.ts index 4b4c48892..9264e8cbe 100644 --- a/game-server/config/servers.ts +++ b/game-server/config/servers.ts @@ -243,5 +243,43 @@ module.exports = { 'activity': [ { 'id': 'activity-server-2', 'host': '172.26.145.171', 'port': 9062, "args": " --inspect=9241" }, ] - } + }, + 'sq1': { + 'connector': [ + { 'id': 'connector-server-1', 'port': 4050, 'clientHost': 'zyz_monitor.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3050, 'frontend': true }, + { 'id': 'connector-server-2', 'port': 4051, 'clientHost': 'zyz_monitor.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3051, 'frontend': true }, + { 'id': 'connector-server-3', 'port': 4052, 'clientHost': 'zyz_monitor.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3052, 'frontend': true }, + ], + 'chat': [ + { 'id': 'chat-server-1', 'host': '127.0.0.1', 'port': 6050 }, + ], + 'role': [ + { 'id': 'role-server-1', 'host': '127.0.0.1', 'port': 6053 }, + { 'id': 'role-server-2', 'host': '127.0.0.1', 'port': 6061 }, + { 'id': 'role-server-3', 'host': '127.0.0.1', 'port': 6062 }, + ], + 'battle': [ + { 'id': 'battle-server-1', 'host': '127.0.0.1', 'port': 6054 } + ], + 'gate': [ + { 'id': 'gate-server-1', 'host': '127.0.0.1', 'clientHost': 'zyz_monitor.trgame.cn', 'clientPort': 3014, 'frontend': true }, + { 'id': 'gate-server-2', 'host': '127.0.0.1', 'clientHost': 'zyz_monitor.trgame.cn', 'clientPort': 3015, 'frontend': true } + ], + 'gm': [ + { 'id': 'gm-server-1', 'host': '127.0.0.1', 'port': 6055 } + ], + 'systimer': [ + { 'id': 'systimer-server-1', 'host': '127.0.0.1', 'port': 6056 } + ], + 'guild': [ + { 'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239" }, + { 'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240" } + ], + 'activity': [ + { 'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241" }, + ], + 'order': [ + { 'id': 'order-server-1', 'host': '127.0.0.1', 'port': 6060, "args": " --inspect=9242" }, + ] + }, }; diff --git a/pushdocker.sh b/pushdocker.sh index 253762945..3db14dfc4 100755 --- a/pushdocker.sh +++ b/pushdocker.sh @@ -6,21 +6,27 @@ if [ $# != 1 ] ; then echo "dev: 同步代码到 dev 服务器上,作为测试服供服务开发使用" echo "monitor: 同步代码到 monitor 服务器上,用做监控和压力测试" echo "distribute: 同步代码到 distribute 服务器上,用做监控和压力测试" + echo "sq1: 同步代码到 sq1 服务器上,用做 37 功能测试服 game-server 部署" exit 1; fi +port=22 + if [ ${1} == 'stable' ] ; then destUrl="root@zyz:/root/zyz/" elif [ ${1} == 'alpha' ] ; then -destUrl="root@zyzalpha:/root/zyz/" + destUrl="root@zyzalpha:/root/zyz/" elif [ ${1} == 'dev' ] ; then -destUrl="root@zyzdev:/root/zyz/" + destUrl="root@zyzdev:/root/zyz/" elif [ ${1} == 'isbn' ] ; then -destUrl="root@zyzisbn:/root/zyz/" + destUrl="root@zyzisbn:/root/zyz/" elif [ ${1} == 'monitor' ] ; then -destUrl="root@zyzmon:/root/zyz/" + destUrl="root@zyzmon:/root/zyz/" elif [ ${1} == 'distribute' ] ; then -destUrl="root@zyzdistribute:/root/zyz/" + destUrl="root@zyzdistribute:/root/zyz/" +elif [ ${1} == 'sq1' ] ; then + destUrl="root@sq1:/root/zyz/" + port=3737 else echo "需要一个参数指明服务器" exit 1; @@ -28,7 +34,7 @@ fi node ./config.js ${1} -rsync -av --include '.babelrc' --include '.eslintrc.js' --exclude '.*' --exclude 'logs' --exclude './game-server/node_modules' --exclude './game-server/node_modules' --exclude './game-server/dist' --exclude 'node_modules' --exclude 'bower_components' --exclude 'dist' --progress --inplace --no-owner --no-group --rsh='ssh -p22' . ${destUrl} +rsync -av --include '.babelrc' --include '.eslintrc.js' --exclude-from='exclude-file.txt' --progress --inplace --no-owner --no-group --rsh='ssh -p'${port} . ${destUrl} git checkout ./game-server/config.json git checkout ./gm-server/config/env git checkout ./web-server/config/env