Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
config_repository
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
config_repository
Commits
02a8322a
Commit
02a8322a
authored
Aug 27, 2020
by
luoyong.meng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.quantgroup.cn:QA/config_repository
parents
0e84f1e4
5b6b29da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
32 deletions
+28
-32
replace.py
yaml/replace.py
+19
-31
replace_config_tke.yaml
yaml/replace_config_tke.yaml
+9
-1
No files found.
yaml/replace.py
View file @
02a8322a
...
@@ -63,37 +63,25 @@ def _replayHanlder(rule, to, matched):
...
@@ -63,37 +63,25 @@ def _replayHanlder(rule, to, matched):
return
to
;
return
to
;
# 替换文件中的内容
# 替换文件中的内容
if
project
==
'recruiting-management'
or
project
==
'recruiting-ui'
:
for
file
in
files
:
for
file
in
files
:
logger
.
info
(
'开始替换文件:'
+
str
(
file
))
logger
.
info
(
'开始替换文件:'
+
str
(
file
))
for
line
in
fileinput
.
input
(
file
,
inplace
=
1
):
for
line
in
fileinput
.
input
(
file
,
inplace
=
1
):
for
item
in
config
:
p
=
re
.
compile
(
r''
+
'api.stantoo.com'
)
rule
=
copy
.
deepcopy
(
item
[
1
])
to
=
'recruitapi-'
+
namespace
+
'.liangkebang.net'
if
rule
.
get
(
'useNamespace'
,
None
)
and
rule
[
'to'
]:
_handler1
=
partial
(
_replayHanlder
,
'api.stantoo.com'
,
to
)
rule
[
'to'
]
=
'-'
+
namespace
+
rule
[
'to'
]
line
=
re
.
sub
(
p
,
_handler1
,
line
)
print
(
line
,
end
=
''
)
if
rule
.
get
(
'useHost'
,
None
):
fileinput
.
close
()
domain
=
sys
.
argv
[
1
]
.
split
(
'.'
)[
0
]
rule
[
'to'
]
=
'//'
+
domain
+
rule
[
'to'
]
else
:
for
file
in
files
:
if
rule
[
'reg'
]:
logger
.
info
(
'开始替换文件:'
+
str
(
file
))
p
=
re
.
compile
(
r''
+
rule
[
'reg'
])
for
line
in
fileinput
.
input
(
file
,
inplace
=
1
):
_handler1
=
partial
(
_replayHanlder
,
rule
[
'reg'
],
rule
[
'to'
])
for
item
in
config
:
line
=
re
.
sub
(
p
,
_handler1
,
line
)
rule
=
copy
.
deepcopy
(
item
[
1
])
if
rule
.
get
(
'useNamespace'
,
None
)
and
rule
[
'to'
]:
print
(
line
,
end
=
''
)
rule
[
'to'
]
=
'-'
+
namespace
+
rule
[
'to'
]
fileinput
.
close
()
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
(
'完成'
)
logger
.
info
(
'完成'
)
yaml/replace_config_tke.yaml
View file @
02a8322a
...
@@ -70,6 +70,13 @@ redashRule: &redashRule
...
@@ -70,6 +70,13 @@ redashRule: &redashRule
to
:
'
redash.q-gp.com'
to
:
'
redash.q-gp.com'
order
:
9
order
:
9
# sentry
sentryRule
:
&sentryRule
<<
:
*rule
reg
:
'
sentry[-/0-9a-z.]*liangkebang.net'
to
:
'
sentry.q-gp.com'
order
:
10
# 神测测试环境
# 神测测试环境
bnDefaultRule
:
&bnDefaultRule
bnDefaultRule
:
&bnDefaultRule
<<
:
*rule
<<
:
*rule
...
@@ -86,4 +93,5 @@ common: &common
...
@@ -86,4 +93,5 @@ common: &common
xyqbCookieRule
:
*xyqbCookieRule
xyqbCookieRule
:
*xyqbCookieRule
bnRule
:
*bnRule
bnRule
:
*bnRule
bnDefaultRule
:
*bnDefaultRule
bnDefaultRule
:
*bnDefaultRule
redashRule
:
*redashRule
redashRule
:
*redashRule
\ No newline at end of file
sentryRule
:
*sentryRule
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment