Commit 33756000 authored by 智勇's avatar 智勇

合并order

parent 9ebdace0
...@@ -9,7 +9,6 @@ import re ...@@ -9,7 +9,6 @@ import re
import copy import copy
import sys import sys
opApiHost = 'http://172.30.220.22:3003'
f = io.open('replace_config.yaml', 'r', encoding='utf-8') f = io.open('replace_config.yaml', 'r', encoding='utf-8')
res = yaml.load(f) res = yaml.load(f)
print("全部配置信息:", res) print("全部配置信息:", res)
...@@ -49,7 +48,7 @@ for file in files: ...@@ -49,7 +48,7 @@ for file in files:
if rule.get('useNamespace', None) and rule['to']: if rule.get('useNamespace', None) and rule['to']:
rule['to'] = '-' + namespace + rule['to'] rule['to'] = '-' + namespace + rule['to']
if rule.get('useDomain', None): if rule.get('useHost', None):
domain = sys.argv[1].split('.')[0] domain = sys.argv[1].split('.')[0]
rule['to'] = '//' + domain + rule['to'] rule['to'] = '//' + domain + rule['to']
......
# reg: 匹配的正则 # reg: 匹配的正则
# to: 正则匹配后替换需要的值 # to: 正则匹配后替换需要的值
# useNamespace: 是否在替换的值前追加 '-[namespace名称]' # useNamespace: 是否在替换的值前追加 '-[namespace名称]'
# useHost: 是否在替换时使用该项目域名的第一段
# order 默认0, 负数用在自定义属性上,在通用规则前生效 # order 默认0, 负数用在自定义属性上,在通用规则前生效
# useDomain xxx
rule: &rule rule: &rule
reg: '' reg: ''
to: '' to: ''
useNamespace: false useNamespace: false
useDomain: false useHost: false
order: 0 order: 0
lkbDomain: &lkbDomain '.liangkebang.com' lkbDomain: &lkbDomain '.liangkebang.com'
...@@ -53,14 +53,13 @@ staticRule: &staticRule ...@@ -53,14 +53,13 @@ staticRule: &staticRule
reg: '//static[-/0-9a-z.]*public' reg: '//static[-/0-9a-z.]*public'
to: *lkbDomain to: *lkbDomain
useNamespace: true useNamespace: true
useDomain: true useHost: true
common: &common common: &common
h5AuthRule: *h5AuthRule h5AuthRule: *h5AuthRule
xyqbApiRule: *xyqbApiRule
quantgroupApiRule: *quantgroupApiRule
xyqbCookieRule: *xyqbCookieRule
# xyqbApiDomainRule: *xyqbApiDomainRule
qgApiRule: *qgApiRule qgApiRule: *qgApiRule
qgCookieRule: *qgCookieRule qgCookieRule: *qgCookieRule
staticRule: *staticRule quantgroupApiRule: *quantgroupApiRule
\ No newline at end of file staticRule: *staticRule
xyqbApiRule: *xyqbApiRule
xyqbCookieRule: *xyqbCookieRule
\ No newline at end of file
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