fhrons-pc-next 25.0.1 → 25.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +2 -0
- package/.eslintrc.js +277 -0
- package/.svnignore +23 -0
- package/.vscode/settings.json +17 -0
- package/.vscode/tasks.json +12 -0
- package/deploy/Jenkinsfile +79 -0
- package/deploy/deploy.yaml +88 -0
- package/deploy/init.sh +89 -0
- package/fhrons-pc-next-25.0.0.tgz +0 -0
- package/index.js +116 -0
- package/inject-env-plugin.js +29 -0
- package/package.json +1 -4
- package/packages/areaMobile/index.js +5 -0
- package/packages/areaMobile/index.vue +185 -0
- package/packages/commonAudio/index.js +5 -0
- package/packages/commonAudio/index.vue +254 -0
- package/packages/commonAudioRow/index.js +5 -0
- package/packages/commonAudioRow/index.vue +205 -0
- package/packages/commonEcharts/index.js +5 -0
- package/packages/commonEcharts/index.vue +37 -0
- package/packages/commonForm/index.js +5 -0
- package/packages/commonForm/index.vue +256 -0
- package/packages/commonNoData/index.js +5 -0
- package/packages/commonNoData/index.vue +150 -0
- package/packages/commonPagination/index.js +5 -0
- package/packages/commonPagination/index.vue +89 -0
- package/packages/commonTable/index.js +5 -0
- package/packages/commonTable/index.vue +534 -0
- package/packages/customDialog/index.js +31 -0
- package/packages/customDialog/index.vue +88 -0
- package/packages/datePicker/index.js +5 -0
- package/packages/datePicker/index.vue +237 -0
- package/packages/editTable/index.js +5 -0
- package/packages/editTable/index.vue +294 -0
- package/packages/elImageViewer/index.js +5 -0
- package/packages/elImageViewer/index.vue +305 -0
- package/packages/error/index.js +5 -0
- package/packages/error/index.vue +27 -0
- package/packages/errorPage/index.js +5 -0
- package/packages/errorPage/index.vue +25 -0
- package/packages/fhDateRangePicker/index.js +5 -0
- package/packages/fhDateRangePicker/index.vue +170 -0
- package/packages/fhDialog/index.js +5 -0
- package/packages/fhDialog/index.vue +119 -0
- package/packages/fhImage/index.js +5 -0
- package/packages/fhImage/index.vue +62 -0
- package/packages/fhPresetImage/index.js +5 -0
- package/packages/fhPresetImage/index.vue +39 -0
- package/packages/fhSensorsFilter/index.js +5 -0
- package/packages/fhSensorsFilter/index.vue +211 -0
- package/packages/fhSensorsFilter/mixins/fhSensorsFilterMixin.js +246 -0
- package/packages/fhTable/index.js +5 -0
- package/packages/fhTable/index.vue +210 -0
- package/packages/fhTransfer/index.js +5 -0
- package/packages/fhTransfer/index.vue +520 -0
- package/packages/fhWebHeader/index.js +5 -0
- package/packages/fhWebHeader/index.vue +1199 -0
- package/packages/fhWebHeader/parts/SwitchLogin.vue +243 -0
- package/packages/fhWebLogin/index.js +5 -0
- package/packages/fhWebLogin/index.vue +681 -0
- package/packages/fhWebLogin/parts/ResetPwd.vue +289 -0
- package/packages/fhWebLogin/parts/loginMixins.js +265 -0
- package/packages/fhWebLogin/parts/style.less +53 -0
- package/packages/fhWebMain/index.js +5 -0
- package/packages/fhWebMain/index.vue +241 -0
- package/packages/filterQuery/index.js +5 -0
- package/packages/filterQuery/index.vue +322 -0
- package/packages/iframeTemplate/index.js +5 -0
- package/packages/iframeTemplate/index.vue +57 -0
- package/packages/lazyPdfViewer/index.js +5 -0
- package/packages/lazyPdfViewer/index.vue +229 -0
- package/packages/menuEdit/index.js +5 -0
- package/packages/menuEdit/index.vue +247 -0
- package/packages/menuTree/index.js +5 -0
- package/packages/menuTree/index.vue +96 -0
- package/packages/mindMap/index.js +5 -0
- package/packages/mindMap/index.vue +48 -0
- package/packages/noMenu/index.js +5 -0
- package/packages/noMenu/index.vue +11 -0
- package/packages/notFound/index.js +5 -0
- package/packages/notFound/index.vue +17 -0
- package/packages/orgTree/index.js +5 -0
- package/packages/orgTree/index.vue +91 -0
- package/packages/pdfViewer/index.js +5 -0
- package/packages/pdfViewer/index.vue +487 -0
- package/packages/resetPwd/index.js +5 -0
- package/packages/resetPwd/index.vue +349 -0
- package/packages/richTextEditor/index.js +5 -0
- package/packages/richTextEditor/index.vue +256 -0
- package/packages/routeLoading/index.js +5 -0
- package/packages/routeLoading/index.vue +16 -0
- package/packages/secondTabs/index.js +5 -0
- package/packages/secondTabs/index.vue +94 -0
- package/packages/siderMenu/index.js +5 -0
- package/packages/siderMenu/index.vue +102 -0
- package/packages/tooltipOver/index.js +5 -0
- package/packages/tooltipOver/index.vue +118 -0
- package/packages/treeSelect/index.js +5 -0
- package/packages/treeSelect/index.vue +371 -0
- package/packages/uploadFile/index.js +5 -0
- package/packages/uploadFile/index.vue +633 -0
- package/packages/vdomEditTable/index.js +7 -0
- package/packages/vdomEditTable/index.vue +439 -0
- package/packages/vdomEditTable/vdomEditTable.jsx +704 -0
- package/packages/verify/Verify/VerifyPoints.vue +246 -0
- package/packages/verify/Verify/VerifySlide.vue +348 -0
- package/packages/verify/api/index.js +21 -0
- package/packages/verify/index.js +5 -0
- package/packages/verify/index.vue +428 -0
- package/packages/verify/utils/ase.js +11 -0
- package/packages/verify/utils/axios.js +31 -0
- package/packages/verify/utils/util.js +36 -0
- package/packages/verifyCode/index.js +5 -0
- package/packages/verifyCode/index.vue +170 -0
- package/packages/webIframePage/index.js +5 -0
- package/packages/webIframePage/index.vue +96 -0
- package/plugins/css/adaptive.scss +168 -0
- package/plugins/css/commonGlobal.scss +2778 -0
- package/plugins/css/commonStatic.scss +1018 -0
- package/plugins/css/index.js +3 -0
- package/plugins/img/login_bg.jpg +0 -0
- package/plugins/img/logo.png +0 -0
- package/plugins/lang/en_US.js +320 -0
- package/plugins/lang/es_ES.js +313 -0
- package/plugins/lang/index.js +238 -0
- package/plugins/lang/lib/dom.js +227 -0
- package/plugins/lang/lib/en.js +126 -0
- package/plugins/lang/lib/es.js +125 -0
- package/plugins/lang/lib/format.js +54 -0
- package/plugins/lang/lib/index.js +63 -0
- package/plugins/lang/lib/pt.js +126 -0
- package/plugins/lang/lib/types.js +52 -0
- package/plugins/lang/lib/util.js +270 -0
- package/plugins/lang/lib/zh-CN.js +126 -0
- package/plugins/lang/lib/zh-TW.js +126 -0
- package/plugins/lang/pt_PT.js +312 -0
- package/plugins/lang/zh_CN.js +321 -0
- package/plugins/lang/zh_T.js +316 -0
- package/plugins/mixins/calculateTableHeightMixin.js +106 -0
- package/plugins/mixins/commonFuncMixin.js +98 -0
- package/plugins/mixins/emitter.js +38 -0
- package/plugins/mixins/handleEchartMixin.js +80 -0
- package/plugins/mixins/handleHeaderMixin.js +476 -0
- package/plugins/mixins/handleStorageMixin.js +40 -0
- package/plugins/mixins/index.js +8 -0
- package/plugins/mixins/queryTableMixin.js +98 -0
- package/plugins/tool/appInfo.js +51 -0
- package/plugins/tool/commonRequest.js +133 -0
- package/plugins/tool/encrypt.js +20 -0
- package/plugins/tool/fhsensors.js +60 -0
- package/plugins/tool/floatTools.js +102 -0
- package/plugins/tool/func.js +524 -0
- package/plugins/tool/headerInfo.js +24 -0
- package/plugins/tool/lazyLoadView.js +22 -0
- package/plugins/tool/monitor.js +38 -0
- package/plugins/tool/pickerOptions.js +77 -0
- package/plugins/tool/preventReClick.js +17 -0
- package/plugins/tool/reqDataCache.js +25 -0
- package/plugins/tool/route.js +246 -0
- package/plugins/tool/screen.js +16 -0
- package/plugins/tool/secret.js +28 -0
- package/plugins/tool/sensors.js +90 -0
- package/plugins/tool/sensorsFun.js +9 -0
- package/plugins/tool/sesnsor_request.js +98 -0
- package/plugins/tool/sm4.js +681 -0
- package/plugins/tool/storage.js +221 -0
- package/plugins/tool/upload.js +36 -0
- package/plugins/tool/validate.js +228 -0
- package/plugins/vantLang/index.js +191 -0
- package/plugins/vantLang/lib/en-US.js +95 -0
- package/plugins/vantLang/lib/es-ES.js +95 -0
- package/plugins/vantLang/lib/pt-PT.js +96 -0
- package/plugins/vantLang/lib/zh-CN.js +96 -0
- package/plugins/vantLang/lib/zh-HK.js +96 -0
package/.browserslistrc
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parserOptions: {
|
|
4
|
+
parser: 'babel-eslint',
|
|
5
|
+
sourceType: 'module'
|
|
6
|
+
},
|
|
7
|
+
env: {
|
|
8
|
+
browser: true,
|
|
9
|
+
node: true,
|
|
10
|
+
es6: true
|
|
11
|
+
},
|
|
12
|
+
extends: ['plugin:vue/recommended', 'eslint:recommended'],
|
|
13
|
+
globals: {
|
|
14
|
+
tinymce: 'readonly',
|
|
15
|
+
pdfjsLib: 'readonly'
|
|
16
|
+
},
|
|
17
|
+
// add your custom rules here
|
|
18
|
+
//it is base on https://github.com/vuejs/eslint-config-vue
|
|
19
|
+
rules: {
|
|
20
|
+
'vue/max-attributes-per-line': [
|
|
21
|
+
2,
|
|
22
|
+
{
|
|
23
|
+
singleline: 10,
|
|
24
|
+
multiline: {
|
|
25
|
+
max: 1,
|
|
26
|
+
allowFirstLine: false
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
'vue/html-indent': ['error', 4],
|
|
31
|
+
'vue/singleline-html-element-content-newline': 'off',
|
|
32
|
+
'vue/multiline-html-element-content-newline': 'off',
|
|
33
|
+
'vue/name-property-casing': ['error', 'PascalCase'],
|
|
34
|
+
'vue/no-v-html': 'off',
|
|
35
|
+
'accessor-pairs': 2,
|
|
36
|
+
'arrow-spacing': [
|
|
37
|
+
2,
|
|
38
|
+
{
|
|
39
|
+
before: true,
|
|
40
|
+
after: true
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
'block-spacing': [2, 'always'],
|
|
44
|
+
'brace-style': [
|
|
45
|
+
2,
|
|
46
|
+
'1tbs',
|
|
47
|
+
{
|
|
48
|
+
allowSingleLine: true
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
camelcase: [
|
|
52
|
+
0,
|
|
53
|
+
{
|
|
54
|
+
properties: 'always'
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
'comma-dangle': [2, 'never'],
|
|
58
|
+
'comma-spacing': [
|
|
59
|
+
2,
|
|
60
|
+
{
|
|
61
|
+
before: false,
|
|
62
|
+
after: true
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
'comma-style': [2, 'last'],
|
|
66
|
+
'constructor-super': 2,
|
|
67
|
+
curly: [2, 'multi-line'],
|
|
68
|
+
'dot-location': [2, 'property'],
|
|
69
|
+
'eol-last': 2,
|
|
70
|
+
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
|
71
|
+
'generator-star-spacing': [
|
|
72
|
+
2,
|
|
73
|
+
{
|
|
74
|
+
before: true,
|
|
75
|
+
after: true
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
ecmaFeatures: 'off',
|
|
79
|
+
'handle-callback-err': [2, '^(err|error)$'],
|
|
80
|
+
indent: [
|
|
81
|
+
2,
|
|
82
|
+
4,
|
|
83
|
+
{
|
|
84
|
+
SwitchCase: 1,
|
|
85
|
+
ObjectExpression: 1,
|
|
86
|
+
ArrayExpression: 1
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
'jsx-quotes': [2, 'prefer-single'],
|
|
90
|
+
'key-spacing': [
|
|
91
|
+
2,
|
|
92
|
+
{
|
|
93
|
+
beforeColon: false,
|
|
94
|
+
afterColon: true
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
'keyword-spacing': [
|
|
98
|
+
2,
|
|
99
|
+
{
|
|
100
|
+
before: true,
|
|
101
|
+
after: true
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
'new-cap': [
|
|
105
|
+
2,
|
|
106
|
+
{
|
|
107
|
+
newIsCap: true,
|
|
108
|
+
capIsNew: false
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
'new-parens': 2,
|
|
112
|
+
'no-array-constructor': 2,
|
|
113
|
+
'no-caller': 2,
|
|
114
|
+
'no-console': 'off',
|
|
115
|
+
'no-class-assign': 2,
|
|
116
|
+
'no-cond-assign': 2,
|
|
117
|
+
'no-const-assign': 2,
|
|
118
|
+
'no-control-regex': 0,
|
|
119
|
+
'no-delete-var': 2,
|
|
120
|
+
'no-dupe-args': 2,
|
|
121
|
+
'no-dupe-class-members': 2,
|
|
122
|
+
'no-dupe-keys': 2,
|
|
123
|
+
'no-duplicate-case': 2,
|
|
124
|
+
'no-empty-character-class': 2,
|
|
125
|
+
// 如果if语句里面有return,后面不能跟else语句
|
|
126
|
+
'no-else-return': 2,
|
|
127
|
+
'no-empty-pattern': 2,
|
|
128
|
+
'no-eval': 2,
|
|
129
|
+
'no-ex-assign': 2,
|
|
130
|
+
'no-extend-native': 0,
|
|
131
|
+
'no-extra-bind': 2,
|
|
132
|
+
'no-extra-boolean-cast': 2,
|
|
133
|
+
'no-extra-parens': [2, 'functions'],
|
|
134
|
+
'no-fallthrough': 2,
|
|
135
|
+
'no-floating-decimal': 2,
|
|
136
|
+
'no-func-assign': 2,
|
|
137
|
+
'no-implied-eval': 2,
|
|
138
|
+
'no-inner-declarations': [2, 'functions'],
|
|
139
|
+
'no-invalid-regexp': 2,
|
|
140
|
+
'no-irregular-whitespace': 2,
|
|
141
|
+
'no-iterator': 2,
|
|
142
|
+
'no-label-var': 2,
|
|
143
|
+
'no-var': 0,
|
|
144
|
+
'no-labels': [
|
|
145
|
+
2,
|
|
146
|
+
{
|
|
147
|
+
allowLoop: false,
|
|
148
|
+
allowSwitch: false
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
'no-lone-blocks': 2,
|
|
152
|
+
'no-mixed-spaces-and-tabs': 2,
|
|
153
|
+
'no-multi-spaces': 2,
|
|
154
|
+
'no-multi-str': 2,
|
|
155
|
+
'no-multiple-empty-lines': [
|
|
156
|
+
2,
|
|
157
|
+
{
|
|
158
|
+
max: 1
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
'no-native-reassign': 2,
|
|
162
|
+
'no-negated-in-lhs': 2,
|
|
163
|
+
'no-new-object': 2,
|
|
164
|
+
'no-new-require': 2,
|
|
165
|
+
'no-new-symbol': 2,
|
|
166
|
+
'no-new-wrappers': 2,
|
|
167
|
+
'no-obj-calls': 2,
|
|
168
|
+
'no-octal': 2,
|
|
169
|
+
'no-octal-escape': 2,
|
|
170
|
+
'no-path-concat': 2,
|
|
171
|
+
'no-proto': 2,
|
|
172
|
+
'no-redeclare': 2,
|
|
173
|
+
'no-regex-spaces': 2,
|
|
174
|
+
'no-return-assign': [2, 'except-parens'],
|
|
175
|
+
'no-self-assign': 2,
|
|
176
|
+
'no-self-compare': 2,
|
|
177
|
+
'no-sequences': 2,
|
|
178
|
+
'no-shadow-restricted-names': 2,
|
|
179
|
+
'no-spaced-func': 2,
|
|
180
|
+
'no-sparse-arrays': 2,
|
|
181
|
+
'no-this-before-super': 2,
|
|
182
|
+
'no-throw-literal': 2,
|
|
183
|
+
'no-trailing-spaces': 2,
|
|
184
|
+
'no-undef': 2,
|
|
185
|
+
'no-undef-init': 2,
|
|
186
|
+
'no-unexpected-multiline': 2,
|
|
187
|
+
'no-unmodified-loop-condition': 2,
|
|
188
|
+
'no-unneeded-ternary': [
|
|
189
|
+
2,
|
|
190
|
+
{
|
|
191
|
+
defaultAssignment: false
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
'no-unreachable': 2,
|
|
195
|
+
'no-unsafe-finally': 2,
|
|
196
|
+
'no-unused-vars': [
|
|
197
|
+
2,
|
|
198
|
+
{
|
|
199
|
+
vars: 'all',
|
|
200
|
+
args: 'none'
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
'no-useless-call': 2,
|
|
204
|
+
'no-useless-computed-key': 2,
|
|
205
|
+
'no-useless-constructor': 2,
|
|
206
|
+
'no-useless-escape': 0,
|
|
207
|
+
'no-whitespace-before-property': 2,
|
|
208
|
+
'no-with': 2,
|
|
209
|
+
'one-var': [
|
|
210
|
+
2,
|
|
211
|
+
{
|
|
212
|
+
initialized: 'never'
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
'operator-linebreak': [
|
|
216
|
+
2,
|
|
217
|
+
'after',
|
|
218
|
+
{
|
|
219
|
+
overrides: {
|
|
220
|
+
'?': 'before',
|
|
221
|
+
':': 'before'
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
'padded-blocks': [2, 'never'],
|
|
226
|
+
quotes: [
|
|
227
|
+
2,
|
|
228
|
+
'single',
|
|
229
|
+
{
|
|
230
|
+
avoidEscape: true,
|
|
231
|
+
allowTemplateLiterals: true
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
semi: [2, 'always'],
|
|
235
|
+
'semi-spacing': [
|
|
236
|
+
2,
|
|
237
|
+
{
|
|
238
|
+
before: false,
|
|
239
|
+
after: true
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
'space-before-blocks': [2, 'always'],
|
|
243
|
+
'space-before-function-paren': [2, 'never'],
|
|
244
|
+
'space-in-parens': [2, 'never'],
|
|
245
|
+
'space-infix-ops': 2,
|
|
246
|
+
'space-unary-ops': [
|
|
247
|
+
2,
|
|
248
|
+
{
|
|
249
|
+
words: true,
|
|
250
|
+
nonwords: false
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
'spaced-comment': [
|
|
254
|
+
2,
|
|
255
|
+
'always',
|
|
256
|
+
{
|
|
257
|
+
markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
'template-curly-spacing': [2, 'never'],
|
|
261
|
+
'use-isnan': 2,
|
|
262
|
+
'valid-typeof': 2,
|
|
263
|
+
'wrap-iife': [2, 'any'],
|
|
264
|
+
'yield-star-spacing': [2, 'both'],
|
|
265
|
+
yoda: [2, 'never'],
|
|
266
|
+
'prefer-const': 2,
|
|
267
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
|
268
|
+
'object-curly-spacing': [
|
|
269
|
+
2,
|
|
270
|
+
'always',
|
|
271
|
+
{
|
|
272
|
+
objectsInObjects: false
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
'array-bracket-spacing': [2, 'never']
|
|
276
|
+
}
|
|
277
|
+
};
|
package/.svnignore
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
node_modules
|
|
3
|
+
/dist
|
|
4
|
+
package-lock.json
|
|
5
|
+
testlzj.js
|
|
6
|
+
# local env files
|
|
7
|
+
.env.local
|
|
8
|
+
.env.*.local
|
|
9
|
+
|
|
10
|
+
# Log files
|
|
11
|
+
npm-debug.log*
|
|
12
|
+
yarn-debug.log*
|
|
13
|
+
yarn-error.log*
|
|
14
|
+
|
|
15
|
+
# Editor directories and files
|
|
16
|
+
.idea
|
|
17
|
+
.vscode
|
|
18
|
+
*.suo
|
|
19
|
+
*.ntvs*
|
|
20
|
+
*.njsproj
|
|
21
|
+
*.sln
|
|
22
|
+
*.sw?
|
|
23
|
+
/deploy
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"i18n-ally.localesPaths": [
|
|
3
|
+
"src/lang",
|
|
4
|
+
"public/static/backup/tinymce/langs",
|
|
5
|
+
"public/static/backup/tinymce/plugins/powerpaste/langs"
|
|
6
|
+
],
|
|
7
|
+
"i18n-easy.localesPaths": [
|
|
8
|
+
"plugins/lang",
|
|
9
|
+
"src/lang",
|
|
10
|
+
"src/locales",
|
|
11
|
+
"public/static/backup/tinymce/langs",
|
|
12
|
+
"public/static/backup/tinymce/plugins/powerpaste/langs"
|
|
13
|
+
],
|
|
14
|
+
"vue-i18n.i18nPaths": "plugins/lang,src/lang,src/locales,public/static/backup/tinymce/langs,public/static/backup/tinymce/plugins/powerpaste/langs",
|
|
15
|
+
"i18n-ally.keystyle": "nested",
|
|
16
|
+
"i18n-easy.keystyle": "nested"
|
|
17
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
podTemplate(
|
|
2
|
+
containers: [
|
|
3
|
+
containerTemplate(
|
|
4
|
+
name: 'node',
|
|
5
|
+
image: 'harbor.k8s.io/jnlp/node-slave:10.16.4',
|
|
6
|
+
ttyEnabled: true,
|
|
7
|
+
command: 'cat',
|
|
8
|
+
resourceRequestMemory: '500Mi',
|
|
9
|
+
resourceLimitMemory: '2Gi',
|
|
10
|
+
runAsUser: "1000",
|
|
11
|
+
runAsGroup: "1000"
|
|
12
|
+
),
|
|
13
|
+
containerTemplate(
|
|
14
|
+
name: 'docker',
|
|
15
|
+
image: 'harbor.k8s.io/library/docker:18.09.9',
|
|
16
|
+
ttyEnabled: true,
|
|
17
|
+
command: 'cat'
|
|
18
|
+
)
|
|
19
|
+
],
|
|
20
|
+
envVars: [
|
|
21
|
+
envVar(key: 'TZ', value: 'Asia/Shanghai'),
|
|
22
|
+
envVar(key: 'DEPLOY_NAMESPACE', value: 'sti'),
|
|
23
|
+
envVar(key: 'DEPLOY_PROJECT', value: 'slopeweb'),
|
|
24
|
+
envVar(key: 'DEPLOY_BRANCH', value: 'develop'),
|
|
25
|
+
envVar(key: 'HARBOR_HOSTNAME', value: 'harbor.k8s.io'),
|
|
26
|
+
envVar(key: 'MODULE_PATH', value: '.'),
|
|
27
|
+
envVar(key: 'DEPLOY_ENV', value: 'test'),
|
|
28
|
+
envVar(key: 'CODE_SCAN', value: 'False'),
|
|
29
|
+
envVar(key: 'BACKEND_HOST', value: 'http://192.9.102.59:30705/'),
|
|
30
|
+
envVar(key: 'CONTAINER_PORT', value: '8080'),
|
|
31
|
+
envVar(key: 'NPM_REPOSITORY', value: 'http://192.9.102.59:30002/repository/npm-group/'),
|
|
32
|
+
secretEnvVar(key: 'HARBOR_USER', secretName: 'harbor-jenkins-secret', secretKey: 'user'),
|
|
33
|
+
secretEnvVar(key: 'HARBOR_PASSWORD', secretName: 'harbor-jenkins-secret', secretKey: 'password'),
|
|
34
|
+
],
|
|
35
|
+
volumes: [
|
|
36
|
+
emptyDirVolume(mountPath: '/deploy', memory: false),
|
|
37
|
+
configMapVolume(mountPath: '/root/.kube', configMapName: 'kubectl-config'),
|
|
38
|
+
persistentVolumeClaim(mountPath: '/home/jenkins/agent/workspace', claimName: 'cephfs-git-pvc', readOnly: false),
|
|
39
|
+
persistentVolumeClaim(mountPath: '/node', claimName: 'cephfs-node-pvc', readOnly: false),
|
|
40
|
+
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'),
|
|
41
|
+
hostPathVolume(mountPath: '/usr/bin/kubectl', hostPath: '/usr/bin/kubectl'),
|
|
42
|
+
hostPathVolume(mountPath: '/etc/docker/certs.d/harbor.k8s.io', hostPath: '/etc/docker/certs.d/harbor.k8s.io')
|
|
43
|
+
]) {
|
|
44
|
+
|
|
45
|
+
node(POD_LABEL) {
|
|
46
|
+
try{
|
|
47
|
+
stage('Build'){
|
|
48
|
+
container('node') {
|
|
49
|
+
stage('Checkout') {
|
|
50
|
+
git branch: 'dev', credentialsId: 'gitlab-dc', url: 'http://192.9.102.124:81/chenxiaobin/szsti_slopeweb.git'
|
|
51
|
+
}
|
|
52
|
+
stage('Init') {
|
|
53
|
+
sh 'chmod +x $MODULE_PATH/deploy/init.sh'
|
|
54
|
+
sh '$MODULE_PATH/deploy/init.sh'
|
|
55
|
+
}
|
|
56
|
+
stage('Build') {
|
|
57
|
+
sh 'npm config set registry ${NPM_REPOSITORY}'
|
|
58
|
+
sh 'npm install && npm run build'
|
|
59
|
+
sh 'rm -rf /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/html'
|
|
60
|
+
sh 'mv dist /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/html'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
stage('Deploy'){
|
|
65
|
+
container('docker') {
|
|
66
|
+
stage('Image') {
|
|
67
|
+
sh '/deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/docker.sh'
|
|
68
|
+
}
|
|
69
|
+
stage('Deploy') {
|
|
70
|
+
sh 'kubectl apply -f /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/deploy.yaml'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}catch(Exception e) {
|
|
75
|
+
println e
|
|
76
|
+
error("fond error during get failure node.")
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
labels:
|
|
6
|
+
web: sti-slopeweb-develop
|
|
7
|
+
name: sti-slopeweb-develop
|
|
8
|
+
namespace: sti
|
|
9
|
+
spec:
|
|
10
|
+
replicas: 1
|
|
11
|
+
selector:
|
|
12
|
+
matchLabels:
|
|
13
|
+
web: sti-slopeweb-develop
|
|
14
|
+
template:
|
|
15
|
+
metadata:
|
|
16
|
+
labels:
|
|
17
|
+
web: sti-slopeweb-develop
|
|
18
|
+
spec:
|
|
19
|
+
containers:
|
|
20
|
+
- env:
|
|
21
|
+
- name: JAVA_OPTS
|
|
22
|
+
value: -Duser.timezone=Asia/Shanghai
|
|
23
|
+
image: harbor.k8s.io/sti/slopeweb-develop:$DEPLOY_TAG
|
|
24
|
+
imagePullPolicy: IfNotPresent
|
|
25
|
+
livenessProbe:
|
|
26
|
+
httpGet:
|
|
27
|
+
path: /
|
|
28
|
+
port: 8080
|
|
29
|
+
scheme: HTTP
|
|
30
|
+
initialDelaySeconds: 30
|
|
31
|
+
periodSeconds: 30
|
|
32
|
+
timeoutSeconds: 10
|
|
33
|
+
name: sti-slopeweb-develop
|
|
34
|
+
ports:
|
|
35
|
+
- containerPort: 8080
|
|
36
|
+
readinessProbe:
|
|
37
|
+
httpGet:
|
|
38
|
+
path: /
|
|
39
|
+
port: 8080
|
|
40
|
+
scheme: HTTP
|
|
41
|
+
initialDelaySeconds: 30
|
|
42
|
+
periodSeconds: 30
|
|
43
|
+
timeoutSeconds: 10
|
|
44
|
+
resources:
|
|
45
|
+
limits:
|
|
46
|
+
cpu: 1
|
|
47
|
+
memory: 1Gi
|
|
48
|
+
requests:
|
|
49
|
+
cpu: 0.2
|
|
50
|
+
memory: 200Mi
|
|
51
|
+
imagePullSecrets:
|
|
52
|
+
- name: registry-secret
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
apiVersion: v1
|
|
56
|
+
kind: Service
|
|
57
|
+
metadata:
|
|
58
|
+
name: sti-slopeweb-develop-service
|
|
59
|
+
namespace: sti
|
|
60
|
+
spec:
|
|
61
|
+
sessionAffinity: ClientIP
|
|
62
|
+
sessionAffinityConfig:
|
|
63
|
+
clientIP:
|
|
64
|
+
timeoutSeconds: 3600
|
|
65
|
+
type: NodePort
|
|
66
|
+
selector:
|
|
67
|
+
web: sti-slopeweb-develop
|
|
68
|
+
ports:
|
|
69
|
+
- port: 8080
|
|
70
|
+
targetPort: 8080
|
|
71
|
+
protocol: TCP
|
|
72
|
+
nodePort: 30706
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
apiVersion: extensions/v1beta1
|
|
76
|
+
kind: Ingress
|
|
77
|
+
metadata:
|
|
78
|
+
name: sti-slopeweb-develop-ingress
|
|
79
|
+
namespace: sti
|
|
80
|
+
spec:
|
|
81
|
+
rules:
|
|
82
|
+
- host: slopeweb.sti.k8s.io
|
|
83
|
+
http:
|
|
84
|
+
paths:
|
|
85
|
+
- path: /
|
|
86
|
+
backend:
|
|
87
|
+
serviceName: sti-slopeweb-develop-service
|
|
88
|
+
servicePort: 8080
|
package/deploy/init.sh
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -xe
|
|
3
|
+
echo "Init..."
|
|
4
|
+
mkdir -p /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH
|
|
5
|
+
cp $MODULE_PATH/deploy/deploy.yaml /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH
|
|
6
|
+
cp $MODULE_PATH/deploy/dockerfile /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH
|
|
7
|
+
|
|
8
|
+
echo "Get git commit."
|
|
9
|
+
TAG=`echo "$RANDOM$(date +%N%t)" | md5sum | cut -c 15-22`
|
|
10
|
+
sed -i 's/$DEPLOY_TAG/'`echo ${TAG}`'/g' /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/deploy.yaml
|
|
11
|
+
if [ -e $MODULE_PATH/src/main/resources/application.yml ];then
|
|
12
|
+
echo "Change env"
|
|
13
|
+
sed -i 's/active: .*/active: '`echo $DEPLOY_ENV`'/g' $MODULE_PATH/src/main/resources/application.yml
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
echo "Create sonar script."
|
|
17
|
+
if [ "`echo $CODE_SCAN | grep True`" != "" ]; then
|
|
18
|
+
cat > /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/scan.sh <<EOF
|
|
19
|
+
#!/bin/sh
|
|
20
|
+
set -e
|
|
21
|
+
echo `date`
|
|
22
|
+
if [ "`echo date | grep CST`" != "" ]; then
|
|
23
|
+
if [ "`date +%H%M%S`" -gt "020000" ] && [ "050000" -gt "`date +%H%M%S`" ]; then
|
|
24
|
+
echo "Execute code scanning for timezone CST."
|
|
25
|
+
if [ "`env | grep GRADLE_HOME`" != "" ]; then
|
|
26
|
+
gradle sonarqube
|
|
27
|
+
elif [ "`env | grep MAVEN_HOME`" != "" ]; then
|
|
28
|
+
mvn sonar:sonar -Dmaven.test.skip=true
|
|
29
|
+
else
|
|
30
|
+
echo "Skiped code scanning for timezone CST."
|
|
31
|
+
fi
|
|
32
|
+
else
|
|
33
|
+
if [ "`date +%H%M%S`" -gt "180000" ] && [ "210000" -gt "`date +%H%M%S`" ]; then
|
|
34
|
+
echo "Execute code scanning for timezone not CST."
|
|
35
|
+
if [ "`env | grep GRADLE_HOME`" != "" ]; then
|
|
36
|
+
gradle sonarqube
|
|
37
|
+
elif [ "`env | grep MAVEN_HOME`" != "" ]; then
|
|
38
|
+
mvn sonar:sonar -Dmaven.test.skip=true
|
|
39
|
+
else
|
|
40
|
+
echo "Skiped code scanning for timezone not CST."
|
|
41
|
+
fi
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
EOF
|
|
45
|
+
else
|
|
46
|
+
cat > /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/scan.sh <<EOF
|
|
47
|
+
#!/bin/sh
|
|
48
|
+
set -e
|
|
49
|
+
echo "Scan is off, skiped code scanning."
|
|
50
|
+
EOF
|
|
51
|
+
fi
|
|
52
|
+
chmod +x /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/scan.sh
|
|
53
|
+
|
|
54
|
+
if [ $BACKEND_HOST ]; then
|
|
55
|
+
echo "Change node nginx proxy"
|
|
56
|
+
cat > /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/default.conf <<EOF
|
|
57
|
+
server {
|
|
58
|
+
listen $CONTAINER_PORT;
|
|
59
|
+
server_name localhost;
|
|
60
|
+
location / {
|
|
61
|
+
root /usr/share/nginx/html;
|
|
62
|
+
index index.html index.htm;
|
|
63
|
+
}
|
|
64
|
+
location /api/ {
|
|
65
|
+
proxy_pass $BACKEND_HOST;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
error_page 500 502 503 504 /50x.html;
|
|
69
|
+
location = /50x.html {
|
|
70
|
+
root /usr/share/nginx/html;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
EOF
|
|
74
|
+
sed -i '6 i\ try_files $uri $uri/ @router;' /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/default.conf
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
echo "Create docker script."
|
|
78
|
+
cat > /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/docker.sh <<EOF
|
|
79
|
+
#!/bin/sh
|
|
80
|
+
set -e
|
|
81
|
+
echo "Login docker registry."
|
|
82
|
+
docker login $HARBOR_HOSTNAME -u $HARBOR_USER -p $HARBOR_PASSWORD
|
|
83
|
+
echo "Build image."
|
|
84
|
+
docker build -t $HARBOR_HOSTNAME/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT-$DEPLOY_BRANCH:${TAG} /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH
|
|
85
|
+
echo "Push image to docker registry."
|
|
86
|
+
docker push $HARBOR_HOSTNAME/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT-$DEPLOY_BRANCH:${TAG}
|
|
87
|
+
EOF
|
|
88
|
+
chmod +x /deploy/$DEPLOY_NAMESPACE/$DEPLOY_PROJECT/$DEPLOY_BRANCH/docker.sh
|
|
89
|
+
|
|
Binary file
|