|
@ -13,6 +13,8 @@ args.option(['g', 'pg'], 'postgre 服务 URL'); |
|
|
args.option(['b', 'backups'], '后端数据库备份恢复接口地址'); |
|
|
args.option(['b', 'backups'], '后端数据库备份恢复接口地址'); |
|
|
args.option(['s', 'kubesphere'], 'kubesphere地址'); |
|
|
args.option(['s', 'kubesphere'], 'kubesphere地址'); |
|
|
args.option(['d', 'dbconfig'], '后台同步数据库host示例:postgres/example/10.8.30.160/30432 格式:用户名/密码/host/port'); |
|
|
args.option(['d', 'dbconfig'], '后台同步数据库host示例:postgres/example/10.8.30.160/30432 格式:用户名/密码/host/port'); |
|
|
|
|
|
args.option(['w', 'water'], '水环境地址'); |
|
|
|
|
|
args.option(['a', 'worksafety'], '安监地址'); |
|
|
|
|
|
|
|
|
const flags = args.parse(process.argv); |
|
|
const flags = args.parse(process.argv); |
|
|
|
|
|
|
|
@ -28,7 +30,10 @@ const BACKUPS_URL = process.env.BACKUPS_URL || flags.backups; |
|
|
const KUBESPHERE_URL = process.env.KUBESPHERE_URL || flags.kubesphere; |
|
|
const KUBESPHERE_URL = process.env.KUBESPHERE_URL || flags.kubesphere; |
|
|
const DATABASE_CONFIG = process.env.DATABASE_HOST || flags.dbconfig;//同步数据库配置
|
|
|
const DATABASE_CONFIG = process.env.DATABASE_HOST || flags.dbconfig;//同步数据库配置
|
|
|
|
|
|
|
|
|
if (!DB || !BACKUPS_URL || !KUBESPHERE_URL || !DATABASE_CONFIG) { |
|
|
const WATER_URL = process.env.WATER_URL || flags.water; |
|
|
|
|
|
const WORKSAFETY_URL = process.env.WORKSAFETY_URL || flags.worksafety; |
|
|
|
|
|
|
|
|
|
|
|
if (!DB || !BACKUPS_URL || !KUBESPHERE_URL || !DATABASE_CONFIG || !WATER_URL || !WORKSAFETY_URL) { |
|
|
console.log('缺少启动参数,异常退出'); |
|
|
console.log('缺少启动参数,异常退出'); |
|
|
args.showHelp(); |
|
|
args.showHelp(); |
|
|
process.exit(-1); |
|
|
process.exit(-1); |
|
@ -81,13 +86,13 @@ const product = { |
|
|
}, { |
|
|
}, { |
|
|
entry: require('./app/lib/middlewares/proxy').entry, |
|
|
entry: require('./app/lib/middlewares/proxy').entry, |
|
|
opts: { |
|
|
opts: { |
|
|
host: 'https://waterconservancy.anxinyun.cn', |
|
|
host: WATER_URL, |
|
|
match: /\/_water\//, |
|
|
match: /\/_water\//, |
|
|
} |
|
|
} |
|
|
}, { |
|
|
}, { |
|
|
entry: require('./app/lib/middlewares/proxy').entry, |
|
|
entry: require('./app/lib/middlewares/proxy').entry, |
|
|
opts: { |
|
|
opts: { |
|
|
host: 'https://smartworksafety.anxinyun.cn', |
|
|
host: WORKSAFETY_URL, |
|
|
match: /\/_worksafety\//, |
|
|
match: /\/_worksafety\//, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|