Compare commits
377
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e4f2f848a | ||
|
|
52d82b2ae7 | ||
|
|
dccf11023e | ||
|
|
33f39de1ac | ||
|
|
5a323cc3f3 | ||
|
|
c201f85aa4 | ||
|
|
b666d9a987 | ||
|
|
c44614fcd2 | ||
|
|
0c0e8394a2 | ||
|
|
cdbf7b3f23 | ||
|
|
7f0cd927d3 | ||
|
|
38f3d3fe2b | ||
|
|
a35ae676ec | ||
|
|
a907ccd3bc | ||
|
|
f270395796 | ||
|
|
7a22c2dcca | ||
|
|
a0ead4b842 | ||
|
|
a71eaf8ca7 | ||
|
|
22e8e53fb5 | ||
|
|
a11acbfa9e | ||
|
|
dbd051b733 | ||
|
|
aba1124a8e | ||
|
|
556ed2b091 | ||
|
|
85aaf5e59c | ||
|
|
f6278c70e6 | ||
|
|
01d5aabd6a | ||
|
|
6fac70ae84 | ||
|
|
963fa94273 | ||
|
|
1d8651d143 | ||
|
|
9cf0ffd40a | ||
|
|
cf3051221a | ||
|
|
4426fd5f76 | ||
|
|
3dba385830 | ||
|
|
f0abe3ccce | ||
|
|
95efa66816 | ||
|
|
176d4398ff | ||
|
|
b2c969a117 | ||
|
|
0c2dddb136 | ||
|
|
f4167d4a5b | ||
|
|
ddc3cb74f0 | ||
|
|
09310182bc | ||
|
|
90feffe652 | ||
|
|
c3819ab3de | ||
|
|
b6af5bfb15 | ||
|
|
b782695654 | ||
|
|
ff25deb642 | ||
|
|
4b926d9d55 | ||
|
|
6dddb721b7 | ||
|
|
609f08d2a3 | ||
|
|
ecd059746a | ||
|
|
c620129717 | ||
|
|
bb83f177cd | ||
|
|
4142286d64 | ||
|
|
627222904a | ||
|
|
a5714431a2 | ||
|
|
9e4d1e6290 | ||
|
|
d650ff15ff | ||
|
|
30865af389 | ||
|
|
c7b132e35e | ||
|
|
f5c32fe060 | ||
|
|
7320edff46 | ||
|
|
74863653d2 | ||
|
|
efd802a99e | ||
|
|
03b050e678 | ||
|
|
d72236e673 | ||
|
|
0f89203f7c | ||
|
|
984d0b41f2 | ||
|
|
eaf1980241 | ||
|
|
ebb0fc2f3a | ||
|
|
ebcb75ba88 | ||
|
|
cc7587149a | ||
|
|
247f28c4dc | ||
|
|
d8eee0419c | ||
|
|
0e7fc552cb | ||
|
|
8a0613e182 | ||
|
|
a619372f87 | ||
|
|
f56cd559ca | ||
|
|
60867ebfe8 | ||
|
|
54e91f9793 | ||
|
|
6dc08615a5 | ||
|
|
65dfc7a4b5 | ||
|
|
3d24a570b0 | ||
|
|
e5bd4e97e0 | ||
|
|
9c46880d65 | ||
|
|
8335f694de | ||
|
|
44174095c6 | ||
|
|
63e3e77300 | ||
|
|
de21e3ae39 | ||
|
|
8badc7befc | ||
|
|
dcbb993cbe | ||
|
|
9ef9756967 | ||
|
|
66c53dc81b | ||
|
|
8bb1335e5c | ||
|
|
e945282de8 | ||
|
|
788549ce3b | ||
|
|
ec64cd0810 | ||
|
|
06c1f884d3 | ||
|
|
d0897e4c7e | ||
|
|
8aa34f1cae | ||
|
|
a75db1a89d | ||
|
|
79c07a05b6 | ||
|
|
8590b4e337 | ||
|
|
33bcfeb9f3 | ||
|
|
5101c358c9 | ||
|
|
6a72c2cceb | ||
|
|
6c225015f9 | ||
|
|
30180b3426 | ||
|
|
ca6412db39 | ||
|
|
a7bf3ddf3c | ||
|
|
141c6f0ad8 | ||
|
|
bed88bc786 | ||
|
|
3d4a6af838 | ||
|
|
23d1fffc92 | ||
|
|
403642adb7 | ||
|
|
a0cf501c67 | ||
|
|
62fc5ceb6c | ||
|
|
50b379e501 | ||
|
|
a62e71a01e | ||
|
|
d6e6ecd0f6 | ||
|
|
80cef43763 | ||
|
|
665436d5e2 | ||
|
|
aa7af29210 | ||
|
|
b5c41dd95b | ||
|
|
6444e21d99 | ||
|
|
3bfb59bd28 | ||
|
|
493e2d882a | ||
|
|
37446c4e57 | ||
|
|
d81b71e7bf | ||
|
|
e853bed556 | ||
|
|
a7170d438e | ||
|
|
2c5e8cb8c4 | ||
|
|
3b9b4757ca | ||
|
|
d47ef3cde4 | ||
|
|
2c3c795cf5 | ||
|
|
57c5ec4e3e | ||
|
|
2b7fee0ca2 | ||
|
|
145cabbea7 | ||
|
|
2a67a86c36 | ||
|
|
3d957fe585 | ||
|
|
1febbdbd51 | ||
|
|
0258de9a17 | ||
|
|
12e0a469fc | ||
|
|
b77deef4c2 | ||
|
|
70a095b043 | ||
|
|
cd76d495d3 | ||
|
|
f3da8f251b | ||
|
|
74ddbb14fb | ||
|
|
d2d082cebd | ||
|
|
8d19ed68b2 | ||
|
|
48317b2c07 | ||
|
|
98d0ad735f | ||
|
|
b2b377c2b5 | ||
|
|
21c33a8860 | ||
|
|
39120a3d7e | ||
|
|
87cc9b011f | ||
|
|
ab14fff5ab | ||
|
|
823066200a | ||
|
|
e3552039d6 | ||
|
|
3e172f81e2 | ||
|
|
e4224dc465 | ||
|
|
33291691ea | ||
|
|
65a6979a3b | ||
|
|
a7153687c7 | ||
|
|
9db7a80414 | ||
|
|
e45857043b | ||
|
|
a816750c8c | ||
|
|
f79b2c8567 | ||
|
|
699339c738 | ||
|
|
b4f7c52d29 | ||
|
|
e68b3a0c34 | ||
|
|
5860edb63b | ||
|
|
acf43a9b62 | ||
|
|
e005119b49 | ||
|
|
47233b57ac | ||
|
|
605280149a | ||
|
|
2c73ef67e7 | ||
|
|
02a0ebd499 | ||
|
|
b2c1856de9 | ||
|
|
f36c12b0b9 | ||
|
|
eb4b6612a5 | ||
|
|
4171e1e5a3 | ||
|
|
600888d91d | ||
|
|
d89c26b5fb | ||
|
|
a1bc54b777 | ||
|
|
f0be6bbac3 | ||
|
|
1a8e58c89f | ||
|
|
a6f6cc2409 | ||
|
|
28781fe93d | ||
|
|
83921ed22e | ||
|
|
deed34c88e | ||
|
|
f6b5cea183 | ||
|
|
e3bdcd241a | ||
|
|
735f509e82 | ||
|
|
1e96b1d167 | ||
|
|
26c783f917 | ||
|
|
2b260ba40d | ||
|
|
cb1879f85a | ||
|
|
a52f202ad0 | ||
|
|
99074aaef3 | ||
|
|
f554495db5 | ||
|
|
545bf99243 | ||
|
|
1c209af4e9 | ||
|
|
febbf75371 | ||
|
|
92269dc7a9 | ||
|
|
3e4f385620 | ||
|
|
9a4c6dc7dd | ||
|
|
4be786ecb6 | ||
|
|
faec7425b6 | ||
|
|
31ac840f8f | ||
|
|
d5d8b18ed2 | ||
|
|
dc1cc2434d | ||
|
|
96b3ff79bc | ||
|
|
cf7d08e11e | ||
|
|
dcc4b57607 | ||
|
|
c1be513888 | ||
|
|
b3b469441f | ||
|
|
572a1ca5e3 | ||
|
|
08c48e3cad | ||
|
|
d79e4a54c2 | ||
|
|
013c48ab1c | ||
|
|
cb5033be49 | ||
|
|
60c82d10da | ||
|
|
57373c3c12 | ||
|
|
19c0d4f373 | ||
|
|
c72c63817b | ||
|
|
6e068e82c8 | ||
|
|
c306b66c74 | ||
|
|
8fc7880201 | ||
|
|
f6cdc61a6d | ||
|
|
9946440cf1 | ||
|
|
393a7589d7 | ||
|
|
1e83e4178d | ||
|
|
7ace433909 | ||
|
|
58b5091fc3 | ||
|
|
fbf944a1c2 | ||
|
|
029a8d813f | ||
|
|
3056443464 | ||
|
|
8957bf19d6 | ||
|
|
36f49e3716 | ||
|
|
8aff206ea0 | ||
|
|
6d091290df | ||
|
|
c75ba04079 | ||
|
|
b332c4a4d5 | ||
|
|
3f27ef813c | ||
|
|
337e4604db | ||
|
|
8e31ceaf04 | ||
|
|
31a08de579 | ||
|
|
7278ee2627 | ||
|
|
20cd2b5656 | ||
|
|
ef6aa14bbc | ||
|
|
2404cb21a4 | ||
|
|
b9512e8130 | ||
|
|
6b7c497baa | ||
|
|
b347d177e5 | ||
|
|
fcad1d3f60 | ||
|
|
03beb43145 | ||
|
|
874c3b99b3 | ||
|
|
2f8a86ec26 | ||
|
|
be7fcc3297 | ||
|
|
c21f64bc6e | ||
|
|
255e89f71d | ||
|
|
685162d651 | ||
|
|
fc795985b7 | ||
|
|
a9c4e57952 | ||
|
|
dd9275f884 | ||
|
|
a317e4a65b | ||
|
|
4f353f9845 | ||
|
|
b0e2e7338b | ||
|
|
6d61fa5ea7 | ||
|
|
331a990690 | ||
|
|
20b71dae2d | ||
|
|
db6b6af096 | ||
|
|
17838716d9 | ||
|
|
d9ceb3e9c9 | ||
|
|
4651c33c40 | ||
|
|
e3be8e9718 | ||
|
|
99a13a5a7c | ||
|
|
dc5a0fdf1f | ||
|
|
822971d72c | ||
|
|
be144877d9 | ||
|
|
50874a3b70 | ||
|
|
1a95d6c2b1 | ||
|
|
95f3216743 | ||
|
|
4c23035604 | ||
|
|
d28a3ef2f7 | ||
|
|
83c1bade7a | ||
|
|
b993132b6f | ||
|
|
d1e0062d3f | ||
|
|
3177b79f36 | ||
|
|
74b550dfa3 | ||
|
|
91a6ae943a | ||
|
|
e25a274523 | ||
|
|
a1c46c0000 | ||
|
|
b6dafd1bf4 | ||
|
|
154fd35331 | ||
|
|
d06612cb2f | ||
|
|
6450d3084c | ||
|
|
1ebf4b5147 | ||
|
|
a065577d61 | ||
|
|
72ccc9a101 | ||
|
|
6df6d014cc | ||
|
|
4fe73f88e7 | ||
|
|
1e4ff720d1 | ||
|
|
86b4aa0b27 | ||
|
|
9025e7c012 | ||
|
|
e7544ca437 | ||
|
|
7b2a766983 | ||
|
|
defe711ce6 | ||
|
|
a7b08c7bed | ||
|
|
ffbb985919 | ||
|
|
eb44c30dbb | ||
|
|
c9e6b53ea9 | ||
|
|
976736adf1 | ||
|
|
8749e07cf9 | ||
|
|
8b4f3efa9f | ||
|
|
ac7a5cad6e | ||
|
|
b52a142361 | ||
|
|
45dd0f8413 | ||
|
|
ac81b8c6a2 | ||
|
|
13ac6ff7ad | ||
|
|
f4cadead73 | ||
|
|
f9935652f1 | ||
|
|
fe024fa17c | ||
|
|
e4da10a370 | ||
|
|
6981130ce1 | ||
|
|
ea4a807d09 | ||
|
|
0336c66a9c | ||
|
|
2b2389bc19 | ||
|
|
c6f768e102 | ||
|
|
4989e8e49d | ||
|
|
b1eb05c7a6 | ||
|
|
e5bd90af87 | ||
|
|
1fd7f70fdf | ||
|
|
5c6eb93deb | ||
|
|
e0063ba2a9 | ||
|
|
643ef06d0f | ||
|
|
467a213edb | ||
|
|
ff4a7b38b6 | ||
|
|
9ec3816dd4 | ||
|
|
8978c7a8d0 | ||
|
|
b17353b3b2 | ||
|
|
043abc334a | ||
|
|
991f253611 | ||
|
|
17dcc7b15b | ||
|
|
901d8eb1e2 | ||
|
|
55022c7646 | ||
|
|
1fda08b12d | ||
|
|
e5ac297649 | ||
|
|
49c70a6afb | ||
|
|
21a914a633 | ||
|
|
41d6bf7ae5 | ||
|
|
df046a8d0a | ||
|
|
fec260621c | ||
|
|
4077146d0b | ||
|
|
780688c503 | ||
|
|
1630d16a80 | ||
|
|
f43e99fb62 | ||
|
|
c6f7425039 | ||
|
|
73911fe15d | ||
|
|
a73c5b2e60 | ||
|
|
2cb26de407 | ||
|
|
4a89b08cf7 | ||
|
|
32193f3c14 | ||
|
|
9477430c5c | ||
|
|
976342041a | ||
|
|
4428e88531 | ||
|
|
e18cc37918 | ||
|
|
cc6547c90e | ||
|
|
0f79e7d607 | ||
|
|
015ab6771d | ||
|
|
1c96858a74 | ||
|
|
067c15f023 | ||
|
|
e41c1ef463 | ||
|
|
e7a9d4a1a6 | ||
|
|
5f96542180 | ||
|
|
9499c2ac8d | ||
|
|
3576205a5f |
No files matched your search
@@ -11,7 +11,7 @@ spec:
|
|||||||
- matrix:
|
- matrix:
|
||||||
generators:
|
generators:
|
||||||
- git:
|
- git:
|
||||||
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
revision: master
|
revision: master
|
||||||
files:
|
files:
|
||||||
- path: environments/demo/agents.yaml
|
- path: environments/demo/agents.yaml
|
||||||
@@ -23,7 +23,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-agent-unit
|
path: release-charts/mixingx-agent-unit
|
||||||
helm:
|
helm:
|
||||||
@@ -39,12 +39,15 @@ spec:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-audit
|
path: release-charts/mixingx-audit
|
||||||
helm:
|
helm:
|
||||||
@@ -14,12 +14,15 @@ spec:
|
|||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/environments/demo/image-version.yaml
|
- $values/environments/demo/image-version.yaml
|
||||||
- $values/environments/demo/audit-values.yaml
|
- $values/environments/demo/audit-values.yaml
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: mixingx-codeserver
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
sources:
|
||||||
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
|
targetRevision: master
|
||||||
|
path: release-charts/mixingx-codeserver
|
||||||
|
helm:
|
||||||
|
releaseName: mixingx-codeserver
|
||||||
|
valueFiles:
|
||||||
|
- $values/environments/demo/image-version.yaml
|
||||||
|
- $values/environments/demo/codeserver-values.yaml
|
||||||
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
|
targetRevision: master
|
||||||
|
ref: values
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: mixingx
|
||||||
|
syncPolicy:
|
||||||
|
# 测试工具,自动同步(同客户仓先例);prune=false 与根应用一致
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-platform
|
path: release-charts/mixingx-platform
|
||||||
helm:
|
helm:
|
||||||
@@ -14,12 +14,15 @@ spec:
|
|||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/environments/demo/image-version.yaml
|
- $values/environments/demo/image-version.yaml
|
||||||
- $values/environments/demo/platform-values.yaml
|
- $values/environments/demo/platform-values.yaml
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -11,7 +11,7 @@ spec:
|
|||||||
- matrix:
|
- matrix:
|
||||||
generators:
|
generators:
|
||||||
- git:
|
- git:
|
||||||
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
revision: master
|
revision: master
|
||||||
files:
|
files:
|
||||||
- path: environments/demo/edges.yaml
|
- path: environments/demo/edges.yaml
|
||||||
@@ -23,7 +23,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-edge-unit
|
path: release-charts/mixingx-edge-unit
|
||||||
helm:
|
helm:
|
||||||
@@ -39,12 +39,28 @@ spec:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
{{- /* ADS Router 逐实例身份透传(chart 默认 enabled=true):实例缺 adsRouter
|
||||||
|
身份时不在此兜底,由 chart 渲染守卫明确拒绝。 */ -}}
|
||||||
|
{{- if hasKey . "adsRouter" }}
|
||||||
|
adsRouter:
|
||||||
|
localNetId: "{{ .adsRouter.localNetId }}"
|
||||||
|
publicAddress: "{{ .adsRouter.publicAddress }}"
|
||||||
|
{{- if hasKey .adsRouter "clientEndPoint" }}
|
||||||
|
clientEndPoint: "{{ .adsRouter.clientEndPoint }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if hasKey .adsRouter "externalPort" }}
|
||||||
|
externalPort: {{ .adsRouter.externalPort }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-gateway
|
path: release-charts/mixingx-gateway
|
||||||
helm:
|
helm:
|
||||||
@@ -14,12 +14,15 @@ spec:
|
|||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/environments/demo/image-version.yaml
|
- $values/environments/demo/image-version.yaml
|
||||||
- $values/environments/demo/gateway-values.yaml
|
- $values/environments/demo/gateway-values.yaml
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-infra
|
path: release-charts/mixingx-infra
|
||||||
helm:
|
helm:
|
||||||
@@ -14,12 +14,15 @@ spec:
|
|||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/environments/demo/image-version.yaml
|
- $values/environments/demo/image-version.yaml
|
||||||
- $values/environments/demo/infra-values.yaml
|
- $values/environments/demo/infra-values.yaml
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -6,12 +6,15 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: networking/longhorn-ui
|
path: networking/longhorn-ui
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: longhorn-system
|
namespace: longhorn-system
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -40,5 +40,8 @@ spec:
|
|||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: longhorn-system
|
namespace: longhorn-system
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-mqttx
|
path: release-charts/mixingx-mqttx
|
||||||
helm:
|
helm:
|
||||||
@@ -14,12 +14,15 @@ spec:
|
|||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/environments/demo/image-version.yaml
|
- $values/environments/demo/image-version.yaml
|
||||||
- $values/environments/demo/mqttx-values.yaml
|
- $values/environments/demo/mqttx-values.yaml
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: mixingx-network-agent
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
sources:
|
||||||
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
|
targetRevision: master
|
||||||
|
path: release-charts/mixingx-network-agent
|
||||||
|
helm:
|
||||||
|
releaseName: mixingx-network-agent
|
||||||
|
valueFiles:
|
||||||
|
- $values/environments/demo/image-version.yaml
|
||||||
|
- $values/environments/demo/network-agent-values.yaml
|
||||||
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
|
targetRevision: master
|
||||||
|
ref: values
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: mixingx
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -11,7 +11,7 @@ spec:
|
|||||||
- matrix:
|
- matrix:
|
||||||
generators:
|
generators:
|
||||||
- git:
|
- git:
|
||||||
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
revision: master
|
revision: master
|
||||||
files:
|
files:
|
||||||
- path: environments/demo/protocol-servers.yaml
|
- path: environments/demo/protocol-servers.yaml
|
||||||
@@ -23,7 +23,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-protocol-server-unit
|
path: release-charts/mixingx-protocol-server-unit
|
||||||
helm:
|
helm:
|
||||||
@@ -46,12 +46,15 @@ spec:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-sso
|
path: release-charts/mixingx-sso
|
||||||
helm:
|
helm:
|
||||||
@@ -14,12 +14,15 @@ spec:
|
|||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/environments/demo/image-version.yaml
|
- $values/environments/demo/image-version.yaml
|
||||||
- $values/environments/demo/sso-values.yaml
|
- $values/environments/demo/sso-values.yaml
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -6,12 +6,15 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: storageclasses
|
path: storageclasses
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- PruneLast=true
|
- PruneLast=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.hub.chart.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: release-charts/mixingx-ultra
|
path: release-charts/mixingx-ultra
|
||||||
helm:
|
helm:
|
||||||
@@ -14,12 +14,15 @@ spec:
|
|||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/environments/demo/image-version.yaml
|
- $values/environments/demo/image-version.yaml
|
||||||
- $values/environments/demo/ultra-values.yaml
|
- $values/environments/demo/ultra-values.yaml
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
namespace: mixingx
|
namespace: mixingx
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
@@ -35,10 +35,22 @@ spec:
|
|||||||
site: "{{ .id }}"
|
site: "{{ .id }}"
|
||||||
idWorkerId: {{ .idWorkerId }}
|
idWorkerId: {{ .idWorkerId }}
|
||||||
description: "{{ .description }}"
|
description: "{{ .description }}"
|
||||||
{{- if .nodeLabel }}
|
{{- if hasKey . "nodeLabel" }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- /* ADS Router 逐实例身份透传,契约同 demo(本模板保持停用)。 */ -}}
|
||||||
|
{{- if hasKey . "adsRouter" }}
|
||||||
|
adsRouter:
|
||||||
|
localNetId: "{{ .adsRouter.localNetId }}"
|
||||||
|
publicAddress: "{{ .adsRouter.publicAddress }}"
|
||||||
|
{{- if hasKey .adsRouter "clientEndPoint" }}
|
||||||
|
clientEndPoint: "{{ .adsRouter.clientEndPoint }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if hasKey .adsRouter "externalPort" }}
|
||||||
|
externalPort: {{ .adsRouter.externalPort }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
ref: values
|
ref: values
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
|
repoURL: http://git.mixingx.local/trace/mixingx.deploy.git
|
||||||
targetRevision: master
|
targetRevision: master
|
||||||
path: applications/demo
|
path: applications/demo
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
# 输出: v1.0.2 这样的版本号(stdout,单行)
|
# 输出: v1.0.2 这样的版本号(stdout,单行)
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
set -eu
|
set -eu
|
||||||
CHART_REPO="${CHART_REPO:-https://gitee.com/mixing-tech/mixingx.hub.chart.git}"
|
CHART_REPO="${CHART_REPO:-http://git.mixingx.local/trace/mixingx.hub.chart.git}"
|
||||||
|
|
||||||
latest=$(git ls-remote --tags "$CHART_REPO" 'refs/tags/chart-v*' \
|
latest=$(git ls-remote --tags "$CHART_REPO" 'refs/tags/chart-v*' \
|
||||||
| sed -E 's#.*refs/tags/chart-v##' \
|
| sed -E 's#.*refs/tags/chart-v##' \
|
||||||
|
|||||||
+304
-60
@@ -12,34 +12,60 @@
|
|||||||
# 逐镜像记录 digest(.digests,供 release-notes 反向追踪)
|
# 逐镜像记录 digest(.digests,供 release-notes 反向追踪)
|
||||||
# chart chart 仓库 Chart.yaml bump + commit + tag chart-vX.Y.Z + push
|
# chart chart 仓库 Chart.yaml bump + commit + tag chart-vX.Y.Z + push
|
||||||
# (tag 已存在则复用跳过;纯复用发布整步跳过)
|
# (tag 已存在则复用跳过;纯复用发布整步跳过)
|
||||||
# pin release 分支:按 PLAN 逐服务钉 image tag 与 chart targetRevision,
|
# pin release 分支:按 PLAN 逐服务钉 image tag(image-version keys 与/或
|
||||||
|
# valuesFiles 里的 image.tag)与 chart targetRevision(appFile 非空时),
|
||||||
# 追加 release-notes.yaml(最新在前),push
|
# 追加 release-notes.yaml(最新在前),push
|
||||||
#
|
#
|
||||||
# 服务计划 PLAN(JSON 数组,每服务一条;未出现的服务 = keep):
|
# 服务计划 PLAN(JSON 数组,每服务一条;未出现的服务 = keep):
|
||||||
# [{"service":"sso","action":"deliver","harborTag":"develop-v.1.0.1-202608250629-41"},
|
# [{"service":"sso","action":"deliver","harborTag":"develop-v.1.0.1-202608250629-41"},
|
||||||
# {"service":"agent","action":"reuse","version":"v1.0.1"},
|
# {"service":"agent","action":"reuse","version":"v1.0.1"},
|
||||||
# {"service":"ultra","action":"keep"}]
|
# {"service":"ultra","action":"keep"},
|
||||||
# service: gateway / sso / ultra / audit / agent / edge(前后端一对,共用 tag)
|
# {"service":"wifi","action":"pin-acr","acrTag":"develop-v.1.0.1-202609080530-26",
|
||||||
|
# "repos":["network-agent"],"keys":[],"appFile":"",
|
||||||
|
# "valuesFiles":["network-agent-values.yaml"]}]
|
||||||
|
# service: 任意服务名(六内置 + 带映射的自定义服务,见下)
|
||||||
# action : keep(缺省,不动)
|
# action : keep(缺省,不动)
|
||||||
# reuse(复用已交付版本 version,镜像已在 ACR 不重推)
|
# reuse(复用已交付版本 version,镜像已在 ACR 不重推)
|
||||||
# deliver(harborTag 为未交付过的 Harbor tag,缺省取 demo 当前,retag 到新版本号)
|
# deliver(harborTag 为未交付过的 Harbor tag,缺省取 demo 当前,retag 到新版本号)
|
||||||
# ci-now(行为同 deliver,仅 release-notes 如实记录为 ci-now)
|
# ci-now(行为同 deliver,仅 release-notes 如实记录为 ci-now)
|
||||||
|
# pin-acr(acrTag 为 ACR 上已有 tag,原样钉进客户目录,不搬运不 retag——
|
||||||
|
# 镜像搬运已剥离给门户「直推 ACR」;版本号即所选 tag 名,
|
||||||
|
# chart 引用保持不变,ArgoCD 由 values 变更触发 sync)
|
||||||
|
# 交付映射(PLAN 条目自带,带任一字段即整体信任,缺省字段视为空):
|
||||||
|
# repos Harbor 镜像仓列表(retag/pin 的镜像来源;自带映射时必填)
|
||||||
|
# keys environments/<客户>/image-version.yaml 的行名(空 = 不进版本表)
|
||||||
|
# appFile applications/<客户>/ 下的 Application 文件(空 = 不随统一 chart,
|
||||||
|
# 即独立 chart 服务,Application 引用其自有 chart 的 master)
|
||||||
|
# valuesFiles environments/<客户>/ 下的 values 文件列表(钉版落点:替换其中
|
||||||
|
# image.tag;形态兼容 整行 registry/repo:tag / repository+tag 拆分 /
|
||||||
|
# image: 块下 tag:)
|
||||||
|
# 未带映射的条目回退 REPOS/KEYS/APPFILE 三张缺省字典(六内置服务);
|
||||||
|
# 非 keep 动作必须能落点:keys 与 valuesFiles 至少一项非空。
|
||||||
|
# 组件条目(component:true + name/acrTag/valuesFiles/imageName):第三方镜像
|
||||||
|
# (postgres/redis 等)精确替换客户 values 里的 tag,只支持 pin-acr/keep。
|
||||||
# 兼容参数: SERVICES=sso,agent(=这些服务 deliver,其余 keep)
|
# 兼容参数: SERVICES=sso,agent(=这些服务 deliver,其余 keep)
|
||||||
# IMAGES=sso=tagX(=该服务 deliver 且显式 harborTag;逗号分隔多个)
|
# IMAGES=sso=tagX(=该服务 deliver 且显式 harborTag;逗号分隔多个)
|
||||||
# PLAN 存在时优先;全部缺省 = 6 服务全 deliver demo 当前 tag(与改造前一致)
|
# PLAN 存在时优先;全部缺省 = 6 内置服务全 deliver demo 当前 tag(与改造前一致)
|
||||||
# protocol mock 不进 PLAN,保留 PROMOTE_PROTOCOLS 独立开关
|
# protocol mock 不进 PLAN,保留 PROMOTE_PROTOCOLS 独立开关
|
||||||
#
|
#
|
||||||
# 版本号分配:
|
# 版本号分配:
|
||||||
# 有 deliver/ci-now(或 CHART_ONLY=true)→ 需要新版本号(RELEASE_VERSION 缺省 auto-bump);
|
# 有 deliver/ci-now/pin-acr(或 CHART_ONLY=true)→ 需要新版本号(RELEASE_VERSION 缺省 auto-bump);
|
||||||
# chart tag 已存在不再拒绝,记 CHART_TAG_EXISTS=true 复用(幂等,可同参数重跑/同版本发多客户)
|
# chart tag 已存在不再拒绝,记 CHART_TAG_EXISTS=true 复用(幂等,可同参数重跑/同版本发多客户)
|
||||||
# 全部 keep/reuse(纯复用发布)→ 不分配新版本号,chart 步骤跳过,
|
# 全部 keep/reuse(纯复用发布)→ 不分配新版本号,chart 步骤跳过,
|
||||||
# reuse 服务 chart targetRevision 各指已有 chart-<version>
|
# reuse 服务 chart targetRevision 各指已有 chart-<version>
|
||||||
|
# pin-acr 也算正式发布:分配新版本号并 bump chart(应用引用跟随),镜像钉所选 tag 名
|
||||||
#
|
#
|
||||||
# 其他参数:
|
# 其他参数:
|
||||||
# CHART_ONLY=true 只发 chart:prepare 跳过镜像基线与 Harbor 校验,retag 整步跳过,
|
# CHART_ONLY=true 只发 chart:prepare 跳过镜像基线与 Harbor 校验,retag 整步跳过,
|
||||||
# pin 只动 chart targetRevision 与 release-notes
|
# pin 只动 chart targetRevision 与 release-notes
|
||||||
|
# ASSIGN_VERSION 是否分配新版本号(缺省 true)。false = 纯钉版发布:
|
||||||
|
# 不分配版本号、不 bump chart、不动平台 Application,
|
||||||
|
# 只钉 values/image-version 与 release-notes;此时 PLAN 中
|
||||||
|
# 不得有 deliver/ci-now(镜像 retag 的目标名就是版本号,必须有号)
|
||||||
# RELEASE_NOTES 发布说明,写入 release-notes.yaml 条目
|
# RELEASE_NOTES 发布说明,写入 release-notes.yaml 条目
|
||||||
# DB_CHANGE 逗号分隔服务名(须为本次非 keep 服务子集),条目 dbChange 标 true
|
# DB_CHANGE 逗号分隔服务名(须为本次非 keep 服务子集),条目 dbChange 标 true
|
||||||
|
# (仅作 release-notes/commit 标记,提示运维本次含数据库变更;
|
||||||
|
# 迁移脚本不由 CI 产出,运维自行生成并执行)
|
||||||
# OPERATOR 发布操作人,默认 drone
|
# OPERATOR 发布操作人,默认 drone
|
||||||
# PROMOTE_DRY_RUN=true 本地演练:docker 与 git push 仅打印不执行
|
# PROMOTE_DRY_RUN=true 本地演练:docker 与 git push 仅打印不执行
|
||||||
#
|
#
|
||||||
@@ -59,8 +85,8 @@ PLAN_TXT_FILE="$WS/.plan.txt"
|
|||||||
FACTS_FILE="$WS/.plan-facts"
|
FACTS_FILE="$WS/.plan-facts"
|
||||||
COMMIT_MSG_FILE="$WS/.commit-msg"
|
COMMIT_MSG_FILE="$WS/.commit-msg"
|
||||||
CHART_DIR="$WS/.ci/chart"
|
CHART_DIR="$WS/.ci/chart"
|
||||||
DEPLOY_REPO="${DEPLOY_REPO:-https://gitee.com/mixing-tech/mixingx.deploy.git}"
|
DEPLOY_REPO="${DEPLOY_REPO:-http://git.mixingx.local/trace/mixingx.deploy.git}"
|
||||||
CHART_REPO="${CHART_REPO:-https://gitee.com/mixing-tech/mixingx.hub.chart.git}"
|
CHART_REPO="${CHART_REPO:-http://git.mixingx.local/trace/mixingx.hub.chart.git}"
|
||||||
CHARTS_DIR="release-charts"
|
CHARTS_DIR="release-charts"
|
||||||
HARBOR_HOST="${HARBOR_HOST:-192.168.1.119:8888}"
|
HARBOR_HOST="${HARBOR_HOST:-192.168.1.119:8888}"
|
||||||
DRY_RUN="${PROMOTE_DRY_RUN:-false}"
|
DRY_RUN="${PROMOTE_DRY_RUN:-false}"
|
||||||
@@ -81,9 +107,11 @@ run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
git_setup() {
|
git_setup() {
|
||||||
git config --global url."https://gitee.com/".insteadOf "git@gitee.com:" 2>/dev/null || true
|
git config --global url."http://git.mixingx.local/".insteadOf "git@git.mixingx.local:" 2>/dev/null || true
|
||||||
git config user.name "Drone Release"
|
# 身份必须 --global:chart 步骤在克隆出的 chart 仓里 commit(pin 在 deploy 仓),
|
||||||
git config user.email "drone-release@mixingx.local"
|
# 本地 config 只落在当前仓,克隆仓会因无 user.name/email 而 "unable to auto-detect email"
|
||||||
|
git config --global user.name "Drone Release"
|
||||||
|
git config --global user.email "drone-release@mixingx.local"
|
||||||
}
|
}
|
||||||
|
|
||||||
require_env() {
|
require_env() {
|
||||||
@@ -144,10 +172,11 @@ CHART_ONLY = os.environ.get("CHART_ONLY", "false") == "true"
|
|||||||
WITH_PROTOCOLS = os.environ.get("PROMOTE_PROTOCOLS", "false") == "true"
|
WITH_PROTOCOLS = os.environ.get("PROMOTE_PROTOCOLS", "false") == "true"
|
||||||
HARBOR_HOST = os.environ.get("HARBOR_HOST", "192.168.1.119:8888")
|
HARBOR_HOST = os.environ.get("HARBOR_HOST", "192.168.1.119:8888")
|
||||||
|
|
||||||
# ── 服务映射常量表(pin 步骤经 .plan.json 继承同一份定义,勿另起副本)──
|
# ── 交付映射:PLAN 条目自带映射优先(信任 + 格式校验),三张字典是未带时的缺省 ──
|
||||||
ALL = ["gateway", "sso", "ultra", "audit", "agent", "edge"]
|
# (pin 步骤经 .plan.json 继承每条目解析后的映射,勿另起副本)
|
||||||
ACTIONS = ["keep", "reuse", "deliver", "ci-now"]
|
DEFAULT_SERVICES = ["gateway", "sso", "ultra", "audit", "agent", "edge"]
|
||||||
# 服务 → 镜像 repo 列表(前后端共用同一 tag)
|
ACTIONS = ["keep", "reuse", "deliver", "ci-now", "pin-acr"]
|
||||||
|
# 缺省服务 → 镜像 repo 列表(前后端共用同一 tag)
|
||||||
REPOS = {
|
REPOS = {
|
||||||
"gateway": ["gateway"],
|
"gateway": ["gateway"],
|
||||||
"sso": ["sso", "sso-web"],
|
"sso": ["sso", "sso-web"],
|
||||||
@@ -156,7 +185,7 @@ REPOS = {
|
|||||||
"agent": ["agent", "agent-web"],
|
"agent": ["agent", "agent-web"],
|
||||||
"edge": ["edge", "edge-web"],
|
"edge": ["edge", "edge-web"],
|
||||||
}
|
}
|
||||||
# 服务 → image-version.yaml 中 images 下的 key 列表
|
# 缺省服务 → image-version.yaml 中 images 下的 key 列表
|
||||||
KEYS = {
|
KEYS = {
|
||||||
"gateway": ["gateway"],
|
"gateway": ["gateway"],
|
||||||
"sso": ["sso", "ssoWeb"],
|
"sso": ["sso", "ssoWeb"],
|
||||||
@@ -165,7 +194,7 @@ KEYS = {
|
|||||||
"agent": ["agent", "agentWeb"],
|
"agent": ["agent", "agentWeb"],
|
||||||
"edge": ["edge", "edgeWeb"],
|
"edge": ["edge", "edgeWeb"],
|
||||||
}
|
}
|
||||||
# 服务 → applications/<客户>/ 下的 Application 文件
|
# 缺省服务 → applications/<客户>/ 下的 Application 文件
|
||||||
APPFILE = {
|
APPFILE = {
|
||||||
"gateway": "gateway.yaml",
|
"gateway": "gateway.yaml",
|
||||||
"sso": "sso.yaml",
|
"sso": "sso.yaml",
|
||||||
@@ -175,16 +204,61 @@ APPFILE = {
|
|||||||
"edge": "edges.yaml",
|
"edge": "edges.yaml",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MAPPING_FIELDS = ("repos", "keys", "appFile", "valuesFiles")
|
||||||
|
|
||||||
|
def norm_mapping(svc, e):
|
||||||
|
"""PLAN 条目映射:带任一映射字段 = 整体信任(缺省字段视为空,不与字典合并);
|
||||||
|
未带映射 = 三张缺省字典;字典也没有 = None(keep 可无映射,非 keep 拒绝)"""
|
||||||
|
if not any(f in e for f in MAPPING_FIELDS):
|
||||||
|
if svc in REPOS:
|
||||||
|
return {"repos": REPOS[svc], "keys": KEYS[svc],
|
||||||
|
"appFile": APPFILE[svc], "valuesFiles": []}
|
||||||
|
return None
|
||||||
|
def field_list(name, pat, what):
|
||||||
|
raw = e.get(name) or []
|
||||||
|
if not isinstance(raw, list):
|
||||||
|
die(f"服务 {svc} 的映射字段 {name} 应为列表")
|
||||||
|
vals = []
|
||||||
|
for x in raw:
|
||||||
|
v = str(x).strip()
|
||||||
|
if v:
|
||||||
|
if not re.fullmatch(pat, v):
|
||||||
|
die(f"服务 {svc} 的映射字段 {name} 含非法值: {v}(应为{what})")
|
||||||
|
vals.append(v)
|
||||||
|
return vals
|
||||||
|
m = {
|
||||||
|
"repos": field_list("repos", r"[a-z0-9][a-z0-9._-]*", "镜像仓名"),
|
||||||
|
"keys": field_list("keys", r"[A-Za-z0-9][A-Za-z0-9_-]*", "image-version 行名"),
|
||||||
|
"appFile": "",
|
||||||
|
"valuesFiles": field_list("valuesFiles", r"[\w.-]+\.ya?ml", "values 文件名"),
|
||||||
|
}
|
||||||
|
app = str(e.get("appFile") or "").strip()
|
||||||
|
if app:
|
||||||
|
if not re.fullmatch(r"[\w.-]+\.ya?ml", app):
|
||||||
|
die(f"服务 {svc} 的映射字段 appFile 含非法值: {app}(应为文件名)")
|
||||||
|
m["appFile"] = app
|
||||||
|
if not m["repos"]:
|
||||||
|
die(f"服务 {svc} 自带映射缺 repos(Harbor 镜像仓,retag/pin 的镜像来源)")
|
||||||
|
return m
|
||||||
|
|
||||||
def die(msg):
|
def die(msg):
|
||||||
sys.exit("[promote] 错误: " + msg)
|
sys.exit("[promote] 错误: " + msg)
|
||||||
|
|
||||||
data = yaml.safe_load(open(demo_path, encoding="utf-8")) or {}
|
data = yaml.safe_load(open(demo_path, encoding="utf-8")) or {}
|
||||||
images = data.get("images") or {}
|
images = data.get("images") or {}
|
||||||
|
|
||||||
def demo_tag(svc):
|
def demo_tag(svc, mapping):
|
||||||
"""deliver/ci-now 缺省 harborTag = demo 当前 tag(前后端应共用同一 tag)"""
|
"""deliver/ci-now 缺省 harborTag = demo 当前 tag(前后端应共用同一 tag)。
|
||||||
|
有 keys 从 image-version 取;无 keys(独立 chart 服务)从 demo 的首个 values 文件取"""
|
||||||
|
if not mapping["keys"]:
|
||||||
|
p = os.path.join(os.path.dirname(demo_path), mapping["valuesFiles"][0])
|
||||||
|
if os.path.exists(p):
|
||||||
|
t = re.search(r"tag:\s*[\"']?([\w.\-]+)", open(p, encoding="utf-8").read())
|
||||||
|
if t:
|
||||||
|
return t.group(1)
|
||||||
|
die(f"服务 {svc} 缺省 harborTag 无法从 demo 的 {mapping['valuesFiles'][0]} 读取,请显式指定")
|
||||||
tags = []
|
tags = []
|
||||||
for k in KEYS[svc]:
|
for k in mapping["keys"]:
|
||||||
node = images.get(k)
|
node = images.get(k)
|
||||||
if not isinstance(node, dict) or not node.get("tag"):
|
if not isinstance(node, dict) or not node.get("tag"):
|
||||||
die(f"demo image-version 缺少 images.{k}.tag,无法取 {svc} 的 demo 当前 tag")
|
die(f"demo image-version 缺少 images.{k}.tag,无法取 {svc} 的 demo 当前 tag")
|
||||||
@@ -204,8 +278,8 @@ if raw_plan:
|
|||||||
if not isinstance(plan, list):
|
if not isinstance(plan, list):
|
||||||
die('PLAN 应为 JSON 数组,每服务一条 {"service":..., "action":...}')
|
die('PLAN 应为 JSON 数组,每服务一条 {"service":..., "action":...}')
|
||||||
for i, e in enumerate(plan):
|
for i, e in enumerate(plan):
|
||||||
if not isinstance(e, dict) or "service" not in e:
|
if not isinstance(e, dict) or ("service" not in e and not e.get("component")):
|
||||||
die(f"PLAN[{i}] 应为对象且含 service 字段")
|
die(f"PLAN[{i}] 应为对象且含 service 字段(或 component 组件条目)")
|
||||||
entries.append(dict(e))
|
entries.append(dict(e))
|
||||||
else:
|
else:
|
||||||
selected = {}
|
selected = {}
|
||||||
@@ -228,23 +302,49 @@ else:
|
|||||||
e["harborTag"] = t
|
e["harborTag"] = t
|
||||||
entries.append(e)
|
entries.append(e)
|
||||||
else:
|
else:
|
||||||
# 全部缺省 = 6 服务全 deliver demo 当前 tag(行为与改造前一致)
|
# 全部缺省 = 6 内置服务全 deliver demo 当前 tag(行为与改造前一致)
|
||||||
entries = [{"service": s, "action": "deliver"} for s in ALL]
|
entries = [{"service": s, "action": "deliver"} for s in DEFAULT_SERVICES]
|
||||||
|
|
||||||
# ── 2. 校验 + 规范化为全量 6 服务计划 ──
|
# ── 2. 校验 + 规范化(缺省六服务 + PLAN 带映射的额外服务 + 组件条目)──
|
||||||
norm, seen = {}, set()
|
norm, seen = {}, set()
|
||||||
|
component_entries = []
|
||||||
|
extra_order = [] # 非缺省字典的服务(PLAN 出现序;keep 条目也进,留痕一致)
|
||||||
for e in entries:
|
for e in entries:
|
||||||
|
if e.get("component"):
|
||||||
|
# 系统组件(第三方镜像):映射随条目携带,只支持 pin-acr/keep
|
||||||
|
name = str(e.get("name") or "").strip()
|
||||||
|
tag = str(e.get("acrTag") or "").strip()
|
||||||
|
vfiles = [str(x).strip() for x in (e.get("valuesFiles") or []) if str(x).strip()]
|
||||||
|
iname = str(e.get("imageName") or "").strip()
|
||||||
|
if not (name and tag and vfiles and iname):
|
||||||
|
die(f"组件条目缺字段(name/acrTag/valuesFiles/imageName): {e}")
|
||||||
|
if name in seen:
|
||||||
|
die(f"条目名重复: {name}")
|
||||||
|
seen.add(name)
|
||||||
|
component_entries.append({"component": True, "name": name, "action": "pin-acr",
|
||||||
|
"acrTag": tag, "valuesFiles": vfiles, "imageName": iname})
|
||||||
|
continue
|
||||||
svc = e.get("service")
|
svc = e.get("service")
|
||||||
if svc not in ALL:
|
if not isinstance(svc, str) or not svc.strip():
|
||||||
die(f"非法服务名: {svc}(合法值: {', '.join(ALL)})")
|
die(f"PLAN 条目缺 service 或非字符串: {e}")
|
||||||
|
svc = svc.strip()
|
||||||
if svc in seen:
|
if svc in seen:
|
||||||
die(f"PLAN 中服务重复: {svc}")
|
die(f"PLAN 中服务重复: {svc}")
|
||||||
seen.add(svc)
|
seen.add(svc)
|
||||||
action = e.get("action", "keep")
|
action = e.get("action", "keep")
|
||||||
if action not in ACTIONS:
|
if action not in ACTIONS:
|
||||||
die(f"非法 action: {action}(合法值: {', '.join(ACTIONS)})")
|
die(f"非法 action: {action}(合法值: {', '.join(ACTIONS)})")
|
||||||
n = {"service": svc, "action": action,
|
mapping = norm_mapping(svc, e)
|
||||||
"repos": REPOS[svc], "keys": KEYS[svc], "appFile": APPFILE[svc]}
|
if mapping is None:
|
||||||
|
# keep 允许无映射(纯 no-op 留痕);非 keep 必须自带映射或命中缺省字典
|
||||||
|
if action != "keep":
|
||||||
|
die(f"服务 {svc} 无交付映射(PLAN 未带映射,也不在缺省字典: {', '.join(DEFAULT_SERVICES)}),只能 keep")
|
||||||
|
mapping = {"repos": [], "keys": [], "appFile": "", "valuesFiles": []}
|
||||||
|
if action != "keep" and not mapping["keys"] and not mapping["valuesFiles"]:
|
||||||
|
die(f"服务 {svc} 非 keep 动作但映射无钉版落点(keys/valuesFiles 均空)")
|
||||||
|
if svc not in REPOS:
|
||||||
|
extra_order.append(svc)
|
||||||
|
n = {"service": svc, "action": action, **mapping}
|
||||||
if action == "reuse":
|
if action == "reuse":
|
||||||
ver = str(e.get("version") or "")
|
ver = str(e.get("version") or "")
|
||||||
if not re.fullmatch(r"v\d+\.\d+\.\d+", ver):
|
if not re.fullmatch(r"v\d+\.\d+\.\d+", ver):
|
||||||
@@ -252,20 +352,33 @@ for e in entries:
|
|||||||
n["version"] = ver
|
n["version"] = ver
|
||||||
elif action in ("deliver", "ci-now"):
|
elif action in ("deliver", "ci-now"):
|
||||||
tag = str(e.get("harborTag") or "").strip()
|
tag = str(e.get("harborTag") or "").strip()
|
||||||
n["harborTag"] = tag or demo_tag(svc)
|
n["harborTag"] = tag or demo_tag(svc, mapping)
|
||||||
n["harborTagExplicit"] = bool(tag)
|
n["harborTagExplicit"] = bool(tag)
|
||||||
|
elif action == "pin-acr":
|
||||||
|
tag = str(e.get("acrTag") or "").strip()
|
||||||
|
if not tag:
|
||||||
|
die(f"pin-acr 服务 {svc} 需提供 acrTag(ACR 上已有的 tag 名)")
|
||||||
|
n["acrTag"] = tag
|
||||||
norm[svc] = n
|
norm[svc] = n
|
||||||
plan_out = [norm.get(s) or {"service": s, "action": "keep",
|
plan_out = [norm.get(s) or {"service": s, "action": "keep",
|
||||||
"repos": REPOS[s], "keys": KEYS[s], "appFile": APPFILE[s]}
|
"repos": REPOS[s], "keys": KEYS[s], "appFile": APPFILE[s],
|
||||||
for s in ALL]
|
"valuesFiles": []}
|
||||||
has_deliver = any(e["action"] in ("deliver", "ci-now") for e in plan_out)
|
for s in DEFAULT_SERVICES]
|
||||||
|
plan_out += [norm.get(s) or {"service": s, "action": "keep",
|
||||||
|
"repos": [], "keys": [], "appFile": "", "valuesFiles": []}
|
||||||
|
for s in extra_order]
|
||||||
|
plan_out += component_entries
|
||||||
|
# 组件 pin-acr 也算正式发布(与门户 hasDeliver 同语义:分配版本号并 bump chart)
|
||||||
|
has_deliver = any(e["action"] in ("deliver", "ci-now", "pin-acr") for e in plan_out)
|
||||||
|
|
||||||
# ── 3. DB_CHANGE 校验:逗号分隔服务名,须为本次非 keep 服务的子集 ──
|
# ── 3. DB_CHANGE 校验:逗号分隔服务名,须为本次计划内非 keep 服务的子集 ──
|
||||||
db_change = [s.strip() for s in (os.environ.get("DB_CHANGE") or "").split(",") if s.strip()]
|
db_change = [s.strip() for s in (os.environ.get("DB_CHANGE") or "").split(",") if s.strip()]
|
||||||
nonkeep = {e["service"] for e in plan_out if e["action"] != "keep"}
|
known = {e["service"] for e in plan_out if not e.get("component")}
|
||||||
|
nonkeep = {e["service"] for e in plan_out
|
||||||
|
if e["action"] != "keep" and not e.get("component")}
|
||||||
for s in db_change:
|
for s in db_change:
|
||||||
if s not in ALL:
|
if s not in known:
|
||||||
die(f"DB_CHANGE 含非法服务名: {s}(合法值: {', '.join(ALL)})")
|
die(f"DB_CHANGE 含未在计划中的服务名: {s}(计划内: {', '.join(sorted(known))})")
|
||||||
if s not in nonkeep:
|
if s not in nonkeep:
|
||||||
die(f"DB_CHANGE 服务 {s} 本次为 keep,不在交付范围内(非 keep 服务: {', '.join(sorted(nonkeep)) or '无'})")
|
die(f"DB_CHANGE 服务 {s} 本次为 keep,不在交付范围内(非 keep 服务: {', '.join(sorted(nonkeep)) or '无'})")
|
||||||
|
|
||||||
@@ -281,7 +394,10 @@ elif explicit:
|
|||||||
for repo in e["repos"]:
|
for repo in e["repos"]:
|
||||||
url = f"http://{HARBOR_HOST}/v2/mixingx/{repo}/manifests/{e['harborTag']}"
|
url = f"http://{HARBOR_HOST}/v2/mixingx/{repo}/manifests/{e['harborTag']}"
|
||||||
req = urllib.request.Request(url, headers={
|
req = urllib.request.Request(url, headers={
|
||||||
"Accept": "application/vnd.docker.distribution.manifest.v2+json",
|
"Accept": ("application/vnd.oci.image.index.v1+json, "
|
||||||
|
"application/vnd.oci.image.manifest.v1+json, "
|
||||||
|
"application/vnd.docker.distribution.manifest.v2+json, "
|
||||||
|
"application/vnd.docker.distribution.manifest.list.v2+json"),
|
||||||
"Authorization": f"Basic {auth}"})
|
"Authorization": f"Basic {auth}"})
|
||||||
try:
|
try:
|
||||||
with urllib.request.urlopen(req, timeout=15) as r:
|
with urllib.request.urlopen(req, timeout=15) as r:
|
||||||
@@ -329,14 +445,25 @@ open(plantxt_path, "w", encoding="utf-8").write(raw_plan or json.dumps(plan_out,
|
|||||||
for e in plan_out:
|
for e in plan_out:
|
||||||
if e["action"] == "keep":
|
if e["action"] == "keep":
|
||||||
continue
|
continue
|
||||||
print(f"[promote] 计划: {e['service']:<8} {e['action']:<8} {e.get('harborTag') or e.get('version') or ''}")
|
svc_label = e.get("service") or e.get("name") or ""
|
||||||
|
extra = "(组件)" if e.get("component") else ""
|
||||||
|
print(f"[promote] 计划: {svc_label:<10} {e['action']:<8} {extra}{e.get('harborTag') or e.get('version') or e.get('acrTag') or ''}")
|
||||||
print(f"[promote] DB 变更服务: {', '.join(db_change) or '无'}")
|
print(f"[promote] DB 变更服务: {', '.join(db_change) or '无'}")
|
||||||
PY
|
PY
|
||||||
. "$FACTS_FILE" # HAS_DELIVER=true|false
|
. "$FACTS_FILE" # HAS_DELIVER=true|false
|
||||||
|
|
||||||
# ── 版本号与 chart tag 分配 ──
|
# ── 版本号与 chart tag 分配 ──
|
||||||
|
ASSIGN_VERSION="${ASSIGN_VERSION:-true}"
|
||||||
|
case "$ASSIGN_VERSION" in true|false) : ;; *) die "ASSIGN_VERSION 只接受 true/false,收到: $ASSIGN_VERSION" ;; esac
|
||||||
|
HAS_REAL_DELIVER=$(python3 -c "
|
||||||
|
import json
|
||||||
|
plan = json.load(open('$PLAN_FILE'))
|
||||||
|
print('true' if any(e['action'] in ('deliver','ci-now') for e in plan) else 'false')")
|
||||||
|
if [ "$ASSIGN_VERSION" = "false" ] && [ "$HAS_REAL_DELIVER" = "true" ]; then
|
||||||
|
die "ASSIGN_VERSION=false 与 deliver/ci-now 互斥:镜像 retag 的目标名就是版本号,交付必须分配"
|
||||||
|
fi
|
||||||
GIVEN_VERSION="${RELEASE_VERSION:-}"
|
GIVEN_VERSION="${RELEASE_VERSION:-}"
|
||||||
if [ "$HAS_DELIVER" = "true" ] || [ "$CHART_ONLY" = "true" ]; then
|
if [ "$ASSIGN_VERSION" = "true" ] && { [ "$HAS_DELIVER" = "true" ] || [ "$CHART_ONLY" = "true" ]; }; then
|
||||||
RELEASE_VERSION="${GIVEN_VERSION:-$(sh ci/auto-bump.sh)}"
|
RELEASE_VERSION="${GIVEN_VERSION:-$(sh ci/auto-bump.sh)}"
|
||||||
case "$RELEASE_VERSION" in
|
case "$RELEASE_VERSION" in
|
||||||
v[0-9]*.[0-9]*.[0-9]*) : ;;
|
v[0-9]*.[0-9]*.[0-9]*) : ;;
|
||||||
@@ -353,11 +480,12 @@ PY
|
|||||||
PURE_REUSE=false
|
PURE_REUSE=false
|
||||||
log "交付版本: $RELEASE_VERSION 客户: $CUSTOMER chart tag: $CHART_TAG"
|
log "交付版本: $RELEASE_VERSION 客户: $CUSTOMER chart tag: $CHART_TAG"
|
||||||
else
|
else
|
||||||
# 纯复用发布(全部 keep/reuse):不需要新版本号,chart 步骤整体跳过
|
# 无需新版本号(纯复用,或 ASSIGN_VERSION=false 的纯钉版):chart 步骤整体跳过
|
||||||
RELEASE_VERSION=""; CHART_TAG=""; CHART_TAG_EXISTS=false; PURE_REUSE=true
|
RELEASE_VERSION=""; CHART_TAG=""; CHART_TAG_EXISTS=false; PURE_REUSE=true
|
||||||
[ -z "$GIVEN_VERSION" ] || log "警告: 纯复用发布不需要新版本号,已忽略传入的 $GIVEN_VERSION"
|
[ -z "$GIVEN_VERSION" ] || log "警告: 本次发布不分配新版本号,已忽略传入的 $GIVEN_VERSION"
|
||||||
log "纯复用发布(无 deliver/ci-now):不分配新版本号,chart 步骤将跳过"
|
log "本次发布不分配新版本号,chart 步骤将跳过"
|
||||||
fi
|
fi
|
||||||
|
export ASSIGN_VERSION
|
||||||
|
|
||||||
# 克隆 chart 仓库(供 chart 步骤复用)并核对交付镜像清单
|
# 克隆 chart 仓库(供 chart 步骤复用)并核对交付镜像清单
|
||||||
rm -rf "$WS/.ci"; mkdir -p "$WS/.ci"
|
rm -rf "$WS/.ci"; mkdir -p "$WS/.ci"
|
||||||
@@ -384,6 +512,7 @@ PY
|
|||||||
echo "CHART_TAG_EXISTS=$CHART_TAG_EXISTS"
|
echo "CHART_TAG_EXISTS=$CHART_TAG_EXISTS"
|
||||||
echo "CHART_ONLY=$CHART_ONLY"
|
echo "CHART_ONLY=$CHART_ONLY"
|
||||||
echo "PURE_REUSE=$PURE_REUSE"
|
echo "PURE_REUSE=$PURE_REUSE"
|
||||||
|
echo "ASSIGN_VERSION=$ASSIGN_VERSION"
|
||||||
echo "OPERATOR=$(shq "$OPERATOR")"
|
echo "OPERATOR=$(shq "$OPERATOR")"
|
||||||
echo "RELEASE_NOTES=$(shq "$RELEASE_NOTES")"
|
echo "RELEASE_NOTES=$(shq "$RELEASE_NOTES")"
|
||||||
echo "DB_CHANGE=$(shq "$DB_CHANGE")"
|
echo "DB_CHANGE=$(shq "$DB_CHANGE")"
|
||||||
@@ -492,6 +621,9 @@ do_pin() {
|
|||||||
|
|
||||||
git fetch -q origin release || die "release 分支不存在,请先推送初始 release 分支(改造清单 B1)"
|
git fetch -q origin release || die "release 分支不存在,请先推送初始 release 分支(改造清单 B1)"
|
||||||
git checkout -q -B release origin/release
|
git checkout -q -B release origin/release
|
||||||
|
if [ "$CHART_ONLY" = "true" ] && [ -s "$PLAN_FILE" ] && grep -q '"component": *true' "$PLAN_FILE"; then
|
||||||
|
die "CHART_ONLY 与组件条目互斥(仅 chart 发布不动任何镜像)"
|
||||||
|
fi
|
||||||
|
|
||||||
ENVDIR="environments/$CUSTOMER"
|
ENVDIR="environments/$CUSTOMER"
|
||||||
APPDIR="applications/$CUSTOMER"
|
APPDIR="applications/$CUSTOMER"
|
||||||
@@ -516,7 +648,8 @@ NOTES = os.environ.get("RELEASE_NOTES", "")
|
|||||||
DB_CHANGE = [s for s in os.environ.get("DB_CHANGE", "").split(",") if s]
|
DB_CHANGE = [s for s in os.environ.get("DB_CHANGE", "").split(",") if s]
|
||||||
|
|
||||||
plan = json.load(open(plan_path, encoding="utf-8"))
|
plan = json.load(open(plan_path, encoding="utf-8"))
|
||||||
actions = [e for e in plan if e["action"] != "keep"]
|
actions = [e for e in plan if e["action"] != "keep" and not e.get("component")]
|
||||||
|
components = [e for e in plan if e.get("component")]
|
||||||
has_deliver = any(e["action"] in ("deliver", "ci-now") for e in plan)
|
has_deliver = any(e["action"] in ("deliver", "ci-now") for e in plan)
|
||||||
|
|
||||||
# 平台 Application(infra/mqttx)不属于 PLAN 服务映射,跟随每次新 chart tag
|
# 平台 Application(infra/mqttx)不属于 PLAN 服务映射,跟随每次新 chart tag
|
||||||
@@ -534,14 +667,21 @@ if os.path.exists(digests_path):
|
|||||||
iv_path = os.path.join(envdir, "image-version.yaml")
|
iv_path = os.path.join(envdir, "image-version.yaml")
|
||||||
rn_path = os.path.join(envdir, "release-notes.yaml")
|
rn_path = os.path.join(envdir, "release-notes.yaml")
|
||||||
|
|
||||||
# ── 1) image-version.yaml:只钉非 keep 服务的 key(CHART_ONLY 不动镜像文件)──
|
# ── 1) image-version.yaml:只钉有 keys 且非 keep 的服务(CHART_ONLY 不动镜像文件)──
|
||||||
from_tags, to_tags = {}, {}
|
from_tags, to_tags = {}, {}
|
||||||
|
def new_tag_of(e):
|
||||||
|
if e["action"] in ("deliver", "ci-now"):
|
||||||
|
return RELEASE_VERSION
|
||||||
|
if e["action"] == "pin-acr":
|
||||||
|
return e["acrTag"] # 所选 ACR tag 原样钉入,不 retag
|
||||||
|
return e["version"]
|
||||||
|
|
||||||
if not CHART_ONLY:
|
if not CHART_ONLY:
|
||||||
data = yaml.safe_load(open(iv_path, encoding="utf-8")) or {}
|
data = yaml.safe_load(open(iv_path, encoding="utf-8")) or {}
|
||||||
images = data.get("images") or {}
|
images = data.get("images") or {}
|
||||||
for e in actions:
|
for e in [x for x in actions if x["keys"]]:
|
||||||
svc = e["service"]
|
svc = e["service"]
|
||||||
new_tag = RELEASE_VERSION if e["action"] in ("deliver", "ci-now") else e["version"]
|
new_tag = new_tag_of(e)
|
||||||
to_tags[svc] = new_tag
|
to_tags[svc] = new_tag
|
||||||
for i, key in enumerate(e["keys"]):
|
for i, key in enumerate(e["keys"]):
|
||||||
node = images.get(key)
|
node = images.get(key)
|
||||||
@@ -559,6 +699,99 @@ if not CHART_ONLY:
|
|||||||
yaml.safe_dump(data, open(iv_path, "w", encoding="utf-8"),
|
yaml.safe_dump(data, open(iv_path, "w", encoding="utf-8"),
|
||||||
default_flow_style=False, sort_keys=False, allow_unicode=True)
|
default_flow_style=False, sort_keys=False, allow_unicode=True)
|
||||||
print(f"[promote] {iv_path} 钉版完成(未选中服务原样保留)")
|
print(f"[promote] {iv_path} 钉版完成(未选中服务原样保留)")
|
||||||
|
|
||||||
|
# ── 1.5) valuesFiles 服务:逐文件替换镜像 tag(独立 chart 服务的钉版落点)──
|
||||||
|
# 三种形态:A. <repo>:<tag> 整行 B. repository: 行 + 相邻 tag:
|
||||||
|
# C. image: 块下相邻 tag:(registry 由 _common/registry.yaml 提供、
|
||||||
|
# 仓名由 chart 缺省提供,客户 values 只钉 tag 时无 repo 行)
|
||||||
|
def replace_values_tag(vpath, repo, new_tag):
|
||||||
|
"""就地替换 vpath 中服务镜像的 tag,返回旧 tag;三种形态均未命中返回 None"""
|
||||||
|
lines = open(vpath, encoding="utf-8").readlines()
|
||||||
|
pat_a = re.compile("(" + re.escape(repo) + r"):([A-Za-z0-9][\w.\-]*)")
|
||||||
|
pat_b = re.compile(r"^(\s*tag:\s*)(\S+)\s*$")
|
||||||
|
for idx, line in enumerate(lines):
|
||||||
|
if not repo or repo not in line:
|
||||||
|
continue
|
||||||
|
m = pat_a.search(line)
|
||||||
|
if m: # 形态 A
|
||||||
|
old = m.group(2).strip("\"'")
|
||||||
|
lines[idx] = pat_a.sub(lambda _m: _m.group(1) + ":" + new_tag, line)
|
||||||
|
open(vpath, "w", encoding="utf-8").write("".join(lines))
|
||||||
|
return old
|
||||||
|
for j in range(idx + 1, min(idx + 4, len(lines))): # 形态 B
|
||||||
|
mb = pat_b.match(lines[j])
|
||||||
|
if mb:
|
||||||
|
old = mb.group(2).strip("\"'")
|
||||||
|
lines[j] = mb.group(1) + new_tag + "\n"
|
||||||
|
open(vpath, "w", encoding="utf-8").write("".join(lines))
|
||||||
|
return old
|
||||||
|
for idx, line in enumerate(lines): # 形态 C:首个 image: 块
|
||||||
|
if re.match(r"^image:\s*(#.*)?$", line):
|
||||||
|
for j in range(idx + 1, min(idx + 4, len(lines))):
|
||||||
|
mb = pat_b.match(lines[j])
|
||||||
|
if mb:
|
||||||
|
old = mb.group(2).strip("\"'")
|
||||||
|
lines[j] = mb.group(1) + new_tag + "\n"
|
||||||
|
open(vpath, "w", encoding="utf-8").write("".join(lines))
|
||||||
|
return old
|
||||||
|
break
|
||||||
|
return None
|
||||||
|
for e in [x for x in actions if x.get("valuesFiles")]:
|
||||||
|
svc = e["service"]
|
||||||
|
new_tag = new_tag_of(e)
|
||||||
|
olds = []
|
||||||
|
for vf in e["valuesFiles"]:
|
||||||
|
vpath = os.path.join(envdir, vf)
|
||||||
|
if not os.path.exists(vpath):
|
||||||
|
sys.exit(f"[promote] 错误: 客户目录缺 {vf}(服务 {svc} 的钉版 values 文件)")
|
||||||
|
old = replace_values_tag(vpath, e["repos"][0], new_tag)
|
||||||
|
if old is None:
|
||||||
|
sys.exit(f"[promote] 错误: {vf} 中未找到服务 {svc} 的镜像 tag(整行/拆分/image 块三种形态均未命中)")
|
||||||
|
olds.append(old)
|
||||||
|
print(f"[promote] {svc}: {vf} {old} → {new_tag}")
|
||||||
|
if svc not in from_tags:
|
||||||
|
from_tags[svc] = " / ".join(olds)
|
||||||
|
to_tags[svc] = new_tag
|
||||||
|
|
||||||
|
# ── 1.6) 系统组件:逐 values 文件精确替换该镜像的 tag(CHART_ONLY 已互斥)──
|
||||||
|
# 兼容两种 values 形态:A. image: <registry>/<imageName>:<tag>(整行)
|
||||||
|
# B. repository: <registry>/<imageName> + 相邻 tag: <tag>(拆分)
|
||||||
|
# 该客户没有的文件(目录结构差异)跳过并记录;全部未命中才报错。
|
||||||
|
for c in components:
|
||||||
|
pat_a = re.compile("(" + re.escape(c["imageName"]) + r"):([A-Za-z0-9][\w.\-]*)")
|
||||||
|
pat_b = re.compile(r"^(\s*tag:\s*)(\S+)\s*$")
|
||||||
|
hits = [] # (文件, 旧tag)
|
||||||
|
for vf in c["valuesFiles"]:
|
||||||
|
vpath = os.path.join(envdir, vf)
|
||||||
|
if not os.path.exists(vpath):
|
||||||
|
print(f"[promote] 组件 {c['name']}: {vf} 在客户目录不存在,跳过")
|
||||||
|
continue
|
||||||
|
lines = open(vpath, encoding="utf-8").readlines()
|
||||||
|
old_tag, hit_idx = None, None
|
||||||
|
for idx, line in enumerate(lines):
|
||||||
|
if c["imageName"] not in line:
|
||||||
|
continue
|
||||||
|
m = pat_a.search(line)
|
||||||
|
if m: # 形态 A:同行
|
||||||
|
old_tag, hit_idx = m.group(2).strip("\"'"), idx
|
||||||
|
lines[idx] = pat_a.sub(lambda _m: _m.group(1) + ":" + c["acrTag"], line)
|
||||||
|
break
|
||||||
|
for j in range(idx + 1, min(idx + 4, len(lines))): # 形态 B:邻近 tag: 字段
|
||||||
|
mb = pat_b.match(lines[j])
|
||||||
|
if mb:
|
||||||
|
old_tag, hit_idx = mb.group(2).strip("\"'"), j
|
||||||
|
lines[j] = mb.group(1) + c["acrTag"] + "\n"
|
||||||
|
break
|
||||||
|
if hit_idx is not None:
|
||||||
|
break
|
||||||
|
if hit_idx is not None:
|
||||||
|
open(vpath, "w", encoding="utf-8").write("".join(lines))
|
||||||
|
hits.append((vf, old_tag))
|
||||||
|
print(f"[promote] 组件 {c['name']}: {vf} {c['imageName']} {old_tag} → {c['acrTag']}")
|
||||||
|
if not hits:
|
||||||
|
sys.exit(f"[promote] 错误: 组件 {c['name']}({c['imageName']})在 {', '.join(c['valuesFiles'])} 中均未找到引用")
|
||||||
|
from_tags[c["name"]] = " / ".join(t for _, t in hits)
|
||||||
|
to_tags[c["name"]] = c["acrTag"]
|
||||||
else:
|
else:
|
||||||
print("[promote] CHART_ONLY=true:image-version.yaml 不动")
|
print("[promote] CHART_ONLY=true:image-version.yaml 不动")
|
||||||
|
|
||||||
@@ -586,7 +819,14 @@ def retarget(path, new_ref, required):
|
|||||||
return old_ref, new_ref
|
return old_ref, new_ref
|
||||||
|
|
||||||
for e in actions:
|
for e in actions:
|
||||||
new_ref = CHART_TAG if e["action"] in ("deliver", "ci-now") else f"chart-{e['version']}"
|
if not e["appFile"]:
|
||||||
|
print(f"[promote] {e['service']}: 无 appFile 映射,chart 引用不动(独立 chart 服务)")
|
||||||
|
continue
|
||||||
|
if e["action"] == "pin-acr" and not CHART_TAG:
|
||||||
|
# 未分配版本号(ASSIGN_VERSION=false):只钉镜像 tag,chart 引用不动
|
||||||
|
print(f"[promote] {e['service']}: 未分配版本号,chart 引用不动")
|
||||||
|
continue
|
||||||
|
new_ref = CHART_TAG if e["action"] in ("deliver", "ci-now", "pin-acr") else f"chart-{e['version']}"
|
||||||
r = retarget(os.path.join(appdir, e["appFile"]), new_ref, required=True)
|
r = retarget(os.path.join(appdir, e["appFile"]), new_ref, required=True)
|
||||||
if r:
|
if r:
|
||||||
chart_from[e["service"]], chart_to[e["service"]] = r
|
chart_from[e["service"]], chart_to[e["service"]] = r
|
||||||
@@ -621,8 +861,16 @@ def find_reuse_source(svc, version):
|
|||||||
return "", ""
|
return "", ""
|
||||||
|
|
||||||
svc_entries, src_tags = [], {}
|
svc_entries, src_tags = [], {}
|
||||||
for e in actions:
|
for e in actions + components:
|
||||||
svc, action = e["service"], e["action"]
|
svc, action = e.get("service") or e.get("name"), e["action"]
|
||||||
|
if e.get("component"):
|
||||||
|
# 组件:替换 values 文件里的镜像 tag(已做),chart 无关,如实记账
|
||||||
|
frm, to = from_tags.get(svc, ""), to_tags.get(svc, "")
|
||||||
|
src_tags[svc] = e.get("acrTag", "")
|
||||||
|
svc_entries.append({"name": svc, "action": action, "from": frm, "to": to,
|
||||||
|
"sourceTag": e.get("acrTag", ""), "digest": "",
|
||||||
|
"dbChange": False, "component": True})
|
||||||
|
continue
|
||||||
if CHART_ONLY:
|
if CHART_ONLY:
|
||||||
# CHART_ONLY 条目:from/to 记 chart tag 变化,sourceTag/digest 留空
|
# CHART_ONLY 条目:from/to 记 chart tag 变化,sourceTag/digest 留空
|
||||||
frm, to = chart_from.get(svc, ""), chart_to.get(svc, "")
|
frm, to = chart_from.get(svc, ""), chart_to.get(svc, "")
|
||||||
@@ -634,6 +882,11 @@ for e in actions:
|
|||||||
digest = digests.get(e["repos"][0], "")
|
digest = digests.get(e["repos"][0], "")
|
||||||
if not digest:
|
if not digest:
|
||||||
print(f"[promote] 警告: {svc} 未取到镜像 digest,release-notes 留空")
|
print(f"[promote] 警告: {svc} 未取到镜像 digest,release-notes 留空")
|
||||||
|
elif action == "pin-acr":
|
||||||
|
# 源即 ACR 上所选 tag 本身,如实记;未搬运,无 digest
|
||||||
|
frm, to = from_tags.get(svc, ""), to_tags.get(svc, "")
|
||||||
|
source_tag = e.get("acrTag", "")
|
||||||
|
digest = ""
|
||||||
else: # reuse
|
else: # reuse
|
||||||
frm, to = from_tags.get(svc, ""), e["version"]
|
frm, to = from_tags.get(svc, ""), e["version"]
|
||||||
source_tag, digest = find_reuse_source(svc, e["version"])
|
source_tag, digest = find_reuse_source(svc, e["version"])
|
||||||
@@ -656,20 +909,11 @@ if svc_entries or NOTES.strip():
|
|||||||
else:
|
else:
|
||||||
print("[promote] 全部服务 keep 且无 RELEASE_NOTES,release-notes 不变")
|
print("[promote] 全部服务 keep 且无 RELEASE_NOTES,release-notes 不变")
|
||||||
|
|
||||||
# ── 4) db-scripts 检查(只警告不 fail)──
|
|
||||||
# 2b 改造后:sso/agent/ultra 构建流水线在构建时生成幂等迁移 SQL,以 harbor tag 命名
|
|
||||||
# 存放于仓库根 db-scripts/<svc>/(如 db-scripts/sso/develop-v.1.0.1-xxx.sql),pin 时带至 release
|
|
||||||
for svc in DB_CHANGE:
|
|
||||||
d = os.path.join("db-scripts", svc)
|
|
||||||
st = src_tags.get(svc, "")
|
|
||||||
hit = os.path.isdir(d) and bool(st) and any(st in f for f in os.listdir(d))
|
|
||||||
if not hit:
|
|
||||||
print(f"[promote] 警告: {svc} 声明了 DB 变更,但 db-scripts/{svc}/ 下未找到与 "
|
|
||||||
f"{st or '(无 sourceTag)'} 对应的脚本,请确认迁移 SQL 已随构建流水线写回")
|
|
||||||
|
|
||||||
# ── 5) commit message:服务清单(action/from→to)与 RELEASE_NOTES ──
|
# ── 5) commit message:服务清单(action/from→to)与 RELEASE_NOTES ──
|
||||||
if PURE_REUSE:
|
if PURE_REUSE:
|
||||||
title = f"release: {CUSTOMER} 纯复用发布(无新版本号)"
|
kind = "钉版发布" if svc_entries else "纯复用发布"
|
||||||
|
title = f"release: {CUSTOMER} {kind}(无新版本号)"
|
||||||
elif CHART_ONLY:
|
elif CHART_ONLY:
|
||||||
title = f"release: {CUSTOMER} chart 交付 {CHART_TAG}(CHART_ONLY)"
|
title = f"release: {CUSTOMER} chart 交付 {CHART_TAG}(CHART_ONLY)"
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,268 +0,0 @@
|
|||||||
-- MixingX SSO idempotent migration script (PostgreSQL)
|
|
||||||
-- Image tag: develop-v.1.0.1-202608270652-42
|
|
||||||
-- Generated by CI: dotnet ef migrations script --idempotent
|
|
||||||
-- Apply manually per ADR-0074 (生产 DB 变更全人工).
|
|
||||||
|
|
||||||
-- ===== ApplicationDbContext =====
|
|
||||||
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
|
|
||||||
"MigrationId" character varying(150) NOT NULL,
|
|
||||||
"ProductVersion" character varying(32) NOT NULL,
|
|
||||||
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
|
|
||||||
);
|
|
||||||
|
|
||||||
START TRANSACTION;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPLock" (
|
|
||||||
"Key" character varying(128) NOT NULL,
|
|
||||||
"Instance" character varying(256),
|
|
||||||
"LastLockTime" TIMESTAMP,
|
|
||||||
CONSTRAINT "PK_CAPLock" PRIMARY KEY ("Key")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPPublishedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(200) NOT NULL,
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(40) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPPublishedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPReceivedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(400) NOT NULL,
|
|
||||||
"Group" character varying(200),
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(50) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPReceivedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
CONSTRAINT "PK_role" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "user" (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"Username" character varying(100) NOT NULL,
|
|
||||||
"Password" character varying(500) NOT NULL,
|
|
||||||
"Email" character varying(200),
|
|
||||||
"Phone" character varying(200),
|
|
||||||
"IsActive" boolean NOT NULL,
|
|
||||||
"IsAdmin" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
CONSTRAINT "PK_user" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role_app_item (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"AppId" character varying(100) NOT NULL,
|
|
||||||
"AppName" character varying(100) NOT NULL,
|
|
||||||
"Permissions" text[] NOT NULL,
|
|
||||||
role_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_role_app_item" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_role_app_item_role_role_id" FOREIGN KEY (role_id) REFERENCES role ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE user_role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleId" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
user_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_role" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_user_role_user_user_id" FOREIGN KEY (user_id) REFERENCES "user" ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_role_app_item_role_id" ON role_app_item (role_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_user_role_user_id" ON user_role (user_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260526021536_Init', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE TABLE service_config (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"ServiceId" character varying(100) NOT NULL,
|
|
||||||
"ServiceName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_service_config" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_service_config_ServiceId" ON service_config ("ServiceId");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260713013128_AddServiceConfig', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE TABLE user_preference (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"UserId" bigint NOT NULL,
|
|
||||||
"Scope" character varying(64) NOT NULL,
|
|
||||||
"Payload" jsonb NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_preference" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_user_preference_UserId_Scope" ON user_preference ("UserId", "Scope");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804024643_AddUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
ALTER TABLE user_preference ALTER COLUMN "Scope" TYPE character varying(128);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804090000_ResetUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
UPDATE "user"
|
|
||||||
SET "Password" = 'Start12345', "UpdatedAt" = NOW()
|
|
||||||
WHERE "Username" = 'admin' AND "IsAdmin" AND NOT "Deleted";
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260825100000_ResetAdminPassword', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
@@ -1,268 +0,0 @@
|
|||||||
-- MixingX SSO idempotent migration script (PostgreSQL)
|
|
||||||
-- Image tag: develop-v.1.0.1-202608280622-43
|
|
||||||
-- Generated by CI: dotnet ef migrations script --idempotent
|
|
||||||
-- Apply manually per ADR-0074 (生产 DB 变更全人工).
|
|
||||||
|
|
||||||
-- ===== ApplicationDbContext =====
|
|
||||||
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
|
|
||||||
"MigrationId" character varying(150) NOT NULL,
|
|
||||||
"ProductVersion" character varying(32) NOT NULL,
|
|
||||||
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
|
|
||||||
);
|
|
||||||
|
|
||||||
START TRANSACTION;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPLock" (
|
|
||||||
"Key" character varying(128) NOT NULL,
|
|
||||||
"Instance" character varying(256),
|
|
||||||
"LastLockTime" TIMESTAMP,
|
|
||||||
CONSTRAINT "PK_CAPLock" PRIMARY KEY ("Key")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPPublishedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(200) NOT NULL,
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(40) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPPublishedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPReceivedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(400) NOT NULL,
|
|
||||||
"Group" character varying(200),
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(50) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPReceivedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
CONSTRAINT "PK_role" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "user" (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"Username" character varying(100) NOT NULL,
|
|
||||||
"Password" character varying(500) NOT NULL,
|
|
||||||
"Email" character varying(200),
|
|
||||||
"Phone" character varying(200),
|
|
||||||
"IsActive" boolean NOT NULL,
|
|
||||||
"IsAdmin" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
CONSTRAINT "PK_user" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role_app_item (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"AppId" character varying(100) NOT NULL,
|
|
||||||
"AppName" character varying(100) NOT NULL,
|
|
||||||
"Permissions" text[] NOT NULL,
|
|
||||||
role_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_role_app_item" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_role_app_item_role_role_id" FOREIGN KEY (role_id) REFERENCES role ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE user_role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleId" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
user_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_role" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_user_role_user_user_id" FOREIGN KEY (user_id) REFERENCES "user" ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_role_app_item_role_id" ON role_app_item (role_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_user_role_user_id" ON user_role (user_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260526021536_Init', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE TABLE service_config (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"ServiceId" character varying(100) NOT NULL,
|
|
||||||
"ServiceName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_service_config" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_service_config_ServiceId" ON service_config ("ServiceId");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260713013128_AddServiceConfig', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE TABLE user_preference (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"UserId" bigint NOT NULL,
|
|
||||||
"Scope" character varying(64) NOT NULL,
|
|
||||||
"Payload" jsonb NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_preference" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_user_preference_UserId_Scope" ON user_preference ("UserId", "Scope");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804024643_AddUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
ALTER TABLE user_preference ALTER COLUMN "Scope" TYPE character varying(128);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804090000_ResetUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
UPDATE "user"
|
|
||||||
SET "Password" = 'Start12345', "UpdatedAt" = NOW()
|
|
||||||
WHERE "Username" = 'admin' AND "IsAdmin" AND NOT "Deleted";
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260825100000_ResetAdminPassword', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
@@ -1,268 +0,0 @@
|
|||||||
-- MixingX SSO idempotent migration script (PostgreSQL)
|
|
||||||
-- Image tag: develop-v.1.0.1-202608280736-44
|
|
||||||
-- Generated by CI: dotnet ef migrations script --idempotent
|
|
||||||
-- Apply manually per ADR-0074 (生产 DB 变更全人工).
|
|
||||||
|
|
||||||
-- ===== ApplicationDbContext =====
|
|
||||||
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
|
|
||||||
"MigrationId" character varying(150) NOT NULL,
|
|
||||||
"ProductVersion" character varying(32) NOT NULL,
|
|
||||||
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
|
|
||||||
);
|
|
||||||
|
|
||||||
START TRANSACTION;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPLock" (
|
|
||||||
"Key" character varying(128) NOT NULL,
|
|
||||||
"Instance" character varying(256),
|
|
||||||
"LastLockTime" TIMESTAMP,
|
|
||||||
CONSTRAINT "PK_CAPLock" PRIMARY KEY ("Key")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPPublishedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(200) NOT NULL,
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(40) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPPublishedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPReceivedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(400) NOT NULL,
|
|
||||||
"Group" character varying(200),
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(50) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPReceivedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
CONSTRAINT "PK_role" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "user" (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"Username" character varying(100) NOT NULL,
|
|
||||||
"Password" character varying(500) NOT NULL,
|
|
||||||
"Email" character varying(200),
|
|
||||||
"Phone" character varying(200),
|
|
||||||
"IsActive" boolean NOT NULL,
|
|
||||||
"IsAdmin" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
CONSTRAINT "PK_user" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role_app_item (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"AppId" character varying(100) NOT NULL,
|
|
||||||
"AppName" character varying(100) NOT NULL,
|
|
||||||
"Permissions" text[] NOT NULL,
|
|
||||||
role_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_role_app_item" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_role_app_item_role_role_id" FOREIGN KEY (role_id) REFERENCES role ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE user_role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleId" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
user_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_role" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_user_role_user_user_id" FOREIGN KEY (user_id) REFERENCES "user" ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_role_app_item_role_id" ON role_app_item (role_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_user_role_user_id" ON user_role (user_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260526021536_Init', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE TABLE service_config (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"ServiceId" character varying(100) NOT NULL,
|
|
||||||
"ServiceName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_service_config" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_service_config_ServiceId" ON service_config ("ServiceId");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260713013128_AddServiceConfig', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE TABLE user_preference (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"UserId" bigint NOT NULL,
|
|
||||||
"Scope" character varying(64) NOT NULL,
|
|
||||||
"Payload" jsonb NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_preference" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_user_preference_UserId_Scope" ON user_preference ("UserId", "Scope");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804024643_AddUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
ALTER TABLE user_preference ALTER COLUMN "Scope" TYPE character varying(128);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804090000_ResetUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
UPDATE "user"
|
|
||||||
SET "Password" = 'Start12345', "UpdatedAt" = NOW()
|
|
||||||
WHERE "Username" = 'admin' AND "IsAdmin" AND NOT "Deleted";
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260825100000_ResetAdminPassword', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
@@ -1,268 +0,0 @@
|
|||||||
-- MixingX SSO idempotent migration script (PostgreSQL)
|
|
||||||
-- Image tag: develop-v.1.0.1-202608310638-45
|
|
||||||
-- Generated by CI: dotnet ef migrations script --idempotent
|
|
||||||
-- Apply manually per ADR-0074 (生产 DB 变更全人工).
|
|
||||||
|
|
||||||
-- ===== ApplicationDbContext =====
|
|
||||||
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
|
|
||||||
"MigrationId" character varying(150) NOT NULL,
|
|
||||||
"ProductVersion" character varying(32) NOT NULL,
|
|
||||||
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
|
|
||||||
);
|
|
||||||
|
|
||||||
START TRANSACTION;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPLock" (
|
|
||||||
"Key" character varying(128) NOT NULL,
|
|
||||||
"Instance" character varying(256),
|
|
||||||
"LastLockTime" TIMESTAMP,
|
|
||||||
CONSTRAINT "PK_CAPLock" PRIMARY KEY ("Key")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPPublishedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(200) NOT NULL,
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(40) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPPublishedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPReceivedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(400) NOT NULL,
|
|
||||||
"Group" character varying(200),
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(50) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPReceivedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
CONSTRAINT "PK_role" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "user" (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"Username" character varying(100) NOT NULL,
|
|
||||||
"Password" character varying(500) NOT NULL,
|
|
||||||
"Email" character varying(200),
|
|
||||||
"Phone" character varying(200),
|
|
||||||
"IsActive" boolean NOT NULL,
|
|
||||||
"IsAdmin" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
CONSTRAINT "PK_user" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role_app_item (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"AppId" character varying(100) NOT NULL,
|
|
||||||
"AppName" character varying(100) NOT NULL,
|
|
||||||
"Permissions" text[] NOT NULL,
|
|
||||||
role_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_role_app_item" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_role_app_item_role_role_id" FOREIGN KEY (role_id) REFERENCES role ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE user_role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleId" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
user_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_role" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_user_role_user_user_id" FOREIGN KEY (user_id) REFERENCES "user" ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_role_app_item_role_id" ON role_app_item (role_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_user_role_user_id" ON user_role (user_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260526021536_Init', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE TABLE service_config (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"ServiceId" character varying(100) NOT NULL,
|
|
||||||
"ServiceName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_service_config" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_service_config_ServiceId" ON service_config ("ServiceId");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260713013128_AddServiceConfig', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE TABLE user_preference (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"UserId" bigint NOT NULL,
|
|
||||||
"Scope" character varying(64) NOT NULL,
|
|
||||||
"Payload" jsonb NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_preference" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_user_preference_UserId_Scope" ON user_preference ("UserId", "Scope");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804024643_AddUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
ALTER TABLE user_preference ALTER COLUMN "Scope" TYPE character varying(128);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804090000_ResetUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
UPDATE "user"
|
|
||||||
SET "Password" = 'Start12345', "UpdatedAt" = NOW()
|
|
||||||
WHERE "Username" = 'admin' AND "IsAdmin" AND NOT "Deleted";
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260825100000_ResetAdminPassword', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
@@ -1,268 +0,0 @@
|
|||||||
-- MixingX SSO idempotent migration script (PostgreSQL)
|
|
||||||
-- Image tag: develop-v.1.0.1-202609020612-46
|
|
||||||
-- Generated by CI: dotnet ef migrations script --idempotent
|
|
||||||
-- Apply manually per ADR-0074 (生产 DB 变更全人工).
|
|
||||||
|
|
||||||
-- ===== ApplicationDbContext =====
|
|
||||||
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
|
|
||||||
"MigrationId" character varying(150) NOT NULL,
|
|
||||||
"ProductVersion" character varying(32) NOT NULL,
|
|
||||||
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
|
|
||||||
);
|
|
||||||
|
|
||||||
START TRANSACTION;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPLock" (
|
|
||||||
"Key" character varying(128) NOT NULL,
|
|
||||||
"Instance" character varying(256),
|
|
||||||
"LastLockTime" TIMESTAMP,
|
|
||||||
CONSTRAINT "PK_CAPLock" PRIMARY KEY ("Key")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPPublishedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(200) NOT NULL,
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(40) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPPublishedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPReceivedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(400) NOT NULL,
|
|
||||||
"Group" character varying(200),
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(50) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPReceivedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
CONSTRAINT "PK_role" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "user" (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"Username" character varying(100) NOT NULL,
|
|
||||||
"Password" character varying(500) NOT NULL,
|
|
||||||
"Email" character varying(200),
|
|
||||||
"Phone" character varying(200),
|
|
||||||
"IsActive" boolean NOT NULL,
|
|
||||||
"IsAdmin" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
CONSTRAINT "PK_user" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role_app_item (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"AppId" character varying(100) NOT NULL,
|
|
||||||
"AppName" character varying(100) NOT NULL,
|
|
||||||
"Permissions" text[] NOT NULL,
|
|
||||||
role_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_role_app_item" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_role_app_item_role_role_id" FOREIGN KEY (role_id) REFERENCES role ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE user_role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleId" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
user_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_role" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_user_role_user_user_id" FOREIGN KEY (user_id) REFERENCES "user" ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_role_app_item_role_id" ON role_app_item (role_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_user_role_user_id" ON user_role (user_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260526021536_Init', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE TABLE service_config (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"ServiceId" character varying(100) NOT NULL,
|
|
||||||
"ServiceName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_service_config" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_service_config_ServiceId" ON service_config ("ServiceId");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260713013128_AddServiceConfig', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE TABLE user_preference (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"UserId" bigint NOT NULL,
|
|
||||||
"Scope" character varying(64) NOT NULL,
|
|
||||||
"Payload" jsonb NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_preference" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_user_preference_UserId_Scope" ON user_preference ("UserId", "Scope");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804024643_AddUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
ALTER TABLE user_preference ALTER COLUMN "Scope" TYPE character varying(128);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804090000_ResetUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
UPDATE "user"
|
|
||||||
SET "Password" = 'Start12345', "UpdatedAt" = NOW()
|
|
||||||
WHERE "Username" = 'admin' AND "IsAdmin" AND NOT "Deleted";
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260825100000_ResetAdminPassword', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
@@ -1,268 +0,0 @@
|
|||||||
-- MixingX SSO idempotent migration script (PostgreSQL)
|
|
||||||
-- Image tag: develop-v.1.0.1-202609030134-47
|
|
||||||
-- Generated by CI: dotnet ef migrations script --idempotent
|
|
||||||
-- Apply manually per ADR-0074 (生产 DB 变更全人工).
|
|
||||||
|
|
||||||
-- ===== ApplicationDbContext =====
|
|
||||||
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
|
|
||||||
"MigrationId" character varying(150) NOT NULL,
|
|
||||||
"ProductVersion" character varying(32) NOT NULL,
|
|
||||||
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
|
|
||||||
);
|
|
||||||
|
|
||||||
START TRANSACTION;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPLock" (
|
|
||||||
"Key" character varying(128) NOT NULL,
|
|
||||||
"Instance" character varying(256),
|
|
||||||
"LastLockTime" TIMESTAMP,
|
|
||||||
CONSTRAINT "PK_CAPLock" PRIMARY KEY ("Key")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPPublishedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(200) NOT NULL,
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(40) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPPublishedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "CAPReceivedMessage" (
|
|
||||||
"Id" bigint GENERATED BY DEFAULT AS IDENTITY,
|
|
||||||
"Version" character varying(20),
|
|
||||||
"Name" character varying(400) NOT NULL,
|
|
||||||
"Group" character varying(200),
|
|
||||||
"Content" TEXT,
|
|
||||||
"Retries" integer,
|
|
||||||
"Added" TIMESTAMP NOT NULL,
|
|
||||||
"ExpiresAt" TIMESTAMP,
|
|
||||||
"StatusName" character varying(50) NOT NULL,
|
|
||||||
CONSTRAINT "PK_CAPReceivedMessage" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
CONSTRAINT "PK_role" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE "user" (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"Username" character varying(100) NOT NULL,
|
|
||||||
"Password" character varying(500) NOT NULL,
|
|
||||||
"Email" character varying(200),
|
|
||||||
"Phone" character varying(200),
|
|
||||||
"IsActive" boolean NOT NULL,
|
|
||||||
"IsAdmin" boolean NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"Deleted" boolean NOT NULL,
|
|
||||||
CONSTRAINT "PK_user" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE role_app_item (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"AppId" character varying(100) NOT NULL,
|
|
||||||
"AppName" character varying(100) NOT NULL,
|
|
||||||
"Permissions" text[] NOT NULL,
|
|
||||||
role_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_role_app_item" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_role_app_item_role_role_id" FOREIGN KEY (role_id) REFERENCES role ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE TABLE user_role (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"RoleId" bigint NOT NULL,
|
|
||||||
"RoleName" character varying(100) NOT NULL,
|
|
||||||
user_id bigint NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_role" PRIMARY KEY ("Id"),
|
|
||||||
CONSTRAINT "FK_user_role_user_user_id" FOREIGN KEY (user_id) REFERENCES "user" ("Id") ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName" ON "CAPPublishedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_Version_ExpiresAt_StatusName1" ON "CAPReceivedMessage" ("Version", "ExpiresAt", "StatusName");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_role_app_item_role_id" ON role_app_item (role_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
CREATE INDEX "IX_user_role_user_id" ON user_role (user_id);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260526021536_Init') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260526021536_Init', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE TABLE service_config (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"ServiceId" character varying(100) NOT NULL,
|
|
||||||
"ServiceName" character varying(100) NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_service_config" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_service_config_ServiceId" ON service_config ("ServiceId");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260713013128_AddServiceConfig') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260713013128_AddServiceConfig', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE TABLE user_preference (
|
|
||||||
"Id" bigint NOT NULL,
|
|
||||||
"UserId" bigint NOT NULL,
|
|
||||||
"Scope" character varying(64) NOT NULL,
|
|
||||||
"Payload" jsonb NOT NULL,
|
|
||||||
"RowVersion" integer NOT NULL,
|
|
||||||
"CreatedAt" TIMESTAMP NOT NULL,
|
|
||||||
"UpdatedAt" TIMESTAMP NOT NULL,
|
|
||||||
CONSTRAINT "PK_user_preference" PRIMARY KEY ("Id")
|
|
||||||
);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
CREATE UNIQUE INDEX "IX_user_preference_UserId_Scope" ON user_preference ("UserId", "Scope");
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804024643_AddUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804024643_AddUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
ALTER TABLE user_preference ALTER COLUMN "Scope" TYPE character varying(128);
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260804090000_ResetUserPreference') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260804090000_ResetUserPreference', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
UPDATE "user"
|
|
||||||
SET "Password" = 'Start12345', "UpdatedAt" = NOW()
|
|
||||||
WHERE "Username" = 'admin' AND "IsAdmin" AND NOT "Deleted";
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
|
|
||||||
DO $EF$
|
|
||||||
BEGIN
|
|
||||||
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20260825100000_ResetAdminPassword') THEN
|
|
||||||
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
|
||||||
VALUES ('20260825100000_ResetAdminPassword', '9.0.0');
|
|
||||||
END IF;
|
|
||||||
END $EF$;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ sharedInfra:
|
|||||||
username: postgres
|
username: postgres
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
|
idleInTransactionSessionTimeout: 60s
|
||||||
redis:
|
redis:
|
||||||
host: redis-service
|
host: redis-service
|
||||||
port: 6379
|
port: 6379
|
||||||
@@ -40,3 +41,4 @@ mqttCredentials:
|
|||||||
audit:
|
audit:
|
||||||
publisher:
|
publisher:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# MixingX code-server — demo 环境 values
|
||||||
|
# 测试版浏览器 IDE;镜像 mixingx/codeserver(mxcicd 构建,预装插件,不走 image-version.yaml 的 images 机制)。
|
||||||
|
# 密码为部署时随机生成(明文,家规同 postgres/redis);修改后 ArgoCD 自动滚动重启生效。
|
||||||
|
|
||||||
|
codeserver:
|
||||||
|
name: codeserver
|
||||||
|
replicas: 1
|
||||||
|
description: "浏览器版 VS Code(测试,demo)"
|
||||||
|
image:
|
||||||
|
repository: 192.168.1.119:8888/mixingx/codeserver
|
||||||
|
tag: v0.2.0
|
||||||
|
password: "4V21baEkh3C6jOLetFcgVD9mDF6uPs1S"
|
||||||
|
|
||||||
|
storage:
|
||||||
|
className: local-path
|
||||||
|
size: 5Gi
|
||||||
|
keep: true
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: traefik
|
||||||
|
host: codeserver.mixingx.local
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||||
@@ -2,6 +2,16 @@ edges:
|
|||||||
- id: demo
|
- id: demo
|
||||||
idWorkerId: 17
|
idWorkerId: 17
|
||||||
description: Demo Edge
|
description: Demo Edge
|
||||||
|
# ADS Router 本方身份:显式分配,重启不变,绝不从 Pod IP 推导。
|
||||||
|
# localNetId 第 4 字节与 idWorkerId 对齐便于记忆;列表内前 4 字节互异(10.200.0.17 / 10.200.0.18)。
|
||||||
|
adsRouter:
|
||||||
|
localNetId: "10.200.0.17.1.1"
|
||||||
|
# 运维占位:demo 集群节点出站地址,两 Edge 同出口(多 Edge 同出口验收场景);
|
||||||
|
# 上线前按现场 PLC 可回程的实际地址核实替换。
|
||||||
|
publicAddress: "192.168.1.173"
|
||||||
- id: demo-2
|
- id: demo-2
|
||||||
idWorkerId: 18
|
idWorkerId: 18
|
||||||
description: Demo Edge 2
|
description: Demo Edge 2
|
||||||
|
adsRouter:
|
||||||
|
localNetId: "10.200.0.18.1.1"
|
||||||
|
publicAddress: "192.168.1.173" # 同 demo:运维占位,两 Edge 同出口
|
||||||
@@ -4,50 +4,50 @@ timezone: Asia/Shanghai
|
|||||||
images:
|
images:
|
||||||
gateway:
|
gateway:
|
||||||
repository: gateway
|
repository: gateway
|
||||||
tag: develop-v.1.0.1-202608050744-6
|
tag: develop-v.1.0.1-202611170743-6
|
||||||
sso:
|
sso:
|
||||||
repository: sso
|
repository: sso
|
||||||
tag: develop-v.1.0.1-202609030134-47
|
tag: develop-v.1.0.1-202611170744-9
|
||||||
ssoWeb:
|
ssoWeb:
|
||||||
repository: sso-web
|
repository: sso-web
|
||||||
tag: develop-v.1.0.1-202609030134-47
|
tag: develop-v.1.0.1-202611170744-9
|
||||||
ultra:
|
ultra:
|
||||||
repository: ultra
|
repository: ultra
|
||||||
tag: develop-v.1.0.1-202609030137-44
|
tag: develop-v.1.0.1-202611170745-9
|
||||||
ultraWeb:
|
ultraWeb:
|
||||||
repository: ultra-web
|
repository: ultra-web
|
||||||
tag: develop-v.1.0.1-202609030137-44
|
tag: develop-v.1.0.1-202611170745-9
|
||||||
audit:
|
audit:
|
||||||
repository: audit
|
repository: audit
|
||||||
tag: develop-v.1.0.1-202608310641-11
|
tag: develop-v.1.0.1-202611170746-8
|
||||||
edge:
|
edge:
|
||||||
repository: edge
|
repository: edge
|
||||||
tag: develop-v.1.0.1-202608280807-46
|
tag: develop-v.1.0.1-202611170748-14
|
||||||
edgeWeb:
|
edgeWeb:
|
||||||
repository: edge-web
|
repository: edge-web
|
||||||
tag: develop-v.1.0.1-202608280807-46
|
tag: develop-v.1.0.1-202611170748-14
|
||||||
agent:
|
agent:
|
||||||
repository: agent
|
repository: agent
|
||||||
tag: develop-v.1.0.1-202609030136-94
|
tag: develop-v.1.0.1-202611170746-15
|
||||||
agentWeb:
|
agentWeb:
|
||||||
repository: agent-web
|
repository: agent-web
|
||||||
tag: develop-v.1.0.1-202609030136-94
|
tag: develop-v.1.0.1-202611170746-15
|
||||||
protocol:
|
protocol:
|
||||||
opcua:
|
opcua:
|
||||||
repository: opcua
|
repository: opcua
|
||||||
tag: develop-v.1.0.1-202608200840-21
|
tag: develop-v.1.0.1-202611030041-1
|
||||||
modbus:
|
modbus:
|
||||||
repository: modbus
|
repository: modbus
|
||||||
tag: develop-v.1.0.1-202608200840-21
|
tag: develop-v.1.0.1-202611030041-1
|
||||||
ads:
|
ads:
|
||||||
repository: ads
|
repository: ads
|
||||||
tag: develop-v.1.0.1-202608200840-21
|
tag: develop-v.1.0.1-202611030041-1
|
||||||
s7:
|
s7:
|
||||||
repository: s7
|
repository: s7
|
||||||
tag: develop-v.1.0.1-202608200840-21
|
tag: develop-v.1.0.1-202611030041-1
|
||||||
s7-diecast:
|
s7-diecast:
|
||||||
repository: s7-diecast
|
repository: s7-diecast
|
||||||
tag: develop-v.1.0.1-202608200840-21
|
tag: develop-v.1.0.1-202611030041-1
|
||||||
auditWeb:
|
auditWeb:
|
||||||
repository: audit-web
|
repository: audit-web
|
||||||
tag: develop-v.1.0.1-202608310641-11
|
tag: develop-v.1.0.1-202611170746-8
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
image:
|
||||||
|
tag: develop-v.1.0.1-202611170748-6
|
||||||
|
authToken: ''
|
||||||
|
corsOrigins: '*'
|
||||||
|
rollbackTimeoutSeconds: 60
|
||||||
|
k3sRestartOnIpChange: true
|
||||||
@@ -17,6 +17,7 @@ sharedInfra:
|
|||||||
username: postgres
|
username: postgres
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
|
idleInTransactionSessionTimeout: 60s
|
||||||
redis:
|
redis:
|
||||||
host: redis-service
|
host: redis-service
|
||||||
port: 6379
|
port: 6379
|
||||||
|
|||||||
@@ -3,3 +3,8 @@ edges:
|
|||||||
idWorkerId: 17
|
idWorkerId: 17
|
||||||
description: Dev Edge
|
description: Dev Edge
|
||||||
nodeLabel: node2
|
nodeLabel: node2
|
||||||
|
# ADS Router 本方身份,契约同 demo(本环境模板停用,仅维护契约);
|
||||||
|
# 第三字节取 1 与 demo 环境(10.200.0.*)区分作用域。
|
||||||
|
adsRouter:
|
||||||
|
localNetId: "10.200.1.17.1.1"
|
||||||
|
publicAddress: "192.168.1.173" # 运维占位,启用前按现场核实替换
|
||||||
Reference in new issue
Block a user