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
33756000
Commit
33756000
authored
Nov 20, 2018
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并order
parent
9ebdace0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
replace.py
yaml/replace.py
+1
-2
replace_config.yaml
yaml/replace_config.yaml
+7
-8
No files found.
yaml/replace.py
View file @
33756000
...
@@ -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
(
'use
Domain
'
,
None
):
if
rule
.
get
(
'use
Host
'
,
None
):
domain
=
sys
.
argv
[
1
]
.
split
(
'.'
)[
0
]
domain
=
sys
.
argv
[
1
]
.
split
(
'.'
)[
0
]
rule
[
'to'
]
=
'//'
+
domain
+
rule
[
'to'
]
rule
[
'to'
]
=
'//'
+
domain
+
rule
[
'to'
]
...
...
yaml/replace_config.yaml
View file @
33756000
# 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
use
Domain
:
false
use
Host
:
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
use
Domain
:
true
use
Host
:
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
quantgroupApiRule
:
*quantgroupApiRule
staticRule
:
*staticRule
staticRule
:
*staticRule
xyqbApiRule
:
*xyqbApiRule
xyqbCookieRule
:
*xyqbCookieRule
\ 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