Commit 5b6b29da authored by zhijie.xue's avatar zhijie.xue

增加sentry过滤;去掉思坦途项目相关

parent 724b31bb
......@@ -63,37 +63,25 @@ def _replayHanlder(rule, to, matched):
return to;
# 替换文件中的内容
if project == 'recruiting-management' or project == 'recruiting-ui':
for file in files:
logger.info('开始替换文件:' + str(file))
for line in fileinput.input(file, inplace = 1):
p = re.compile(r'' + 'api.stantoo.com')
to = 'recruitapi-' + namespace + '.liangkebang.net'
_handler1 = partial(_replayHanlder, 'api.stantoo.com', to)
line = re.sub(p, _handler1, line)
print(line, end = '')
fileinput.close()
else:
for file in files:
logger.info('开始替换文件:' + str(file))
for line in fileinput.input(file, inplace = 1):
for item in config:
rule = copy.deepcopy(item[1])
if rule.get('useNamespace', None) and rule['to']:
rule['to'] = '-' + namespace + rule['to']
if rule.get('useHost', None):
domain = sys.argv[1].split('.')[0]
rule['to'] = '//' + domain + rule['to']
if rule['reg']:
p = re.compile(r'' + rule['reg'])
_handler1 = partial(_replayHanlder, rule['reg'], rule['to'])
line = re.sub(p, _handler1, line)
print(line, end = '')
fileinput.close()
for file in files:
logger.info('开始替换文件:' + str(file))
for line in fileinput.input(file, inplace = 1):
for item in config:
rule = copy.deepcopy(item[1])
if rule.get('useNamespace', None) and rule['to']:
rule['to'] = '-' + namespace + rule['to']
if rule.get('useHost', None):
domain = sys.argv[1].split('.')[0]
rule['to'] = '//' + domain + rule['to']
if rule['reg']:
p = re.compile(r'' + rule['reg'])
_handler1 = partial(_replayHanlder, rule['reg'], rule['to'])
line = re.sub(p, _handler1, line)
print(line, end = '')
fileinput.close()
logger.info('完成')
......@@ -70,6 +70,13 @@ redashRule: &redashRule
to: 'redash.q-gp.com'
order: 9
# sentry
sentryRule: &sentryRule
<<: *rule
reg: 'sentry[-/0-9a-z.]*liangkebang.net'
to: 'sentry.q-gp.com'
order: 10
# 神测测试环境
bnDefaultRule: &bnDefaultRule
<<: *rule
......@@ -86,4 +93,5 @@ common: &common
xyqbCookieRule: *xyqbCookieRule
bnRule: *bnRule
bnDefaultRule: *bnDefaultRule
redashRule: *redashRule
\ No newline at end of file
redashRule: *redashRule
sentryRule: *sentryRule
\ 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