@winner-fed/winner-deploy 2.0.9 → 2.0.13
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/README.md +5 -1
- package/package.json +1 -1
- package/src/genZipPackage.js +3 -2
- package/src/see.js +3 -2
- package/src/winner-deploy.js +21 -4
- package/templates/see/1.x/deploy.xml +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## python 版本脚本兼容性问题
|
|
4
4
|
python2 对应 template/1.x
|
|
5
5
|
|
|
6
|
+
## 功能接口说明
|
|
6
7
|
```javscript
|
|
7
8
|
/**
|
|
8
9
|
* 生成 see 平台部署包
|
|
@@ -37,9 +38,12 @@ python2 对应 template/1.x
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
}
|
|
41
|
+
* @param copyFiles {Array<string>} 不包含在 manifest.json 配置的文件,直接拷贝到 see 包里。文件路径是相对于项目根目录的路径+文件名,比如 dist/子包/version.js,那么 copyFiles: ['version.js']
|
|
42
|
+
* @param description {string} 发布包说明
|
|
43
|
+
* @param seePackageName {string} see发布物的包名,也就是 zip 包的命名,默认为 `${system}-${name}-${version}`
|
|
40
44
|
* @param cb {function} 回调函数,用于处理在组装 see 包后,压缩成 zip 包前可以自定义执行的动作
|
|
41
45
|
*/
|
|
42
|
-
exports.generateSeePackageZip = function generateSeePackageZip({system, type, name, appType, version, configName, templateFunc, variablesFunc}, cb) {
|
|
46
|
+
exports.generateSeePackageZip = function generateSeePackageZip({system, type, name, appType, version, configName, templateFunc, variablesFunc, copyFiles, description}, cb) {
|
|
43
47
|
...
|
|
44
48
|
}
|
|
45
49
|
```
|
package/package.json
CHANGED
package/src/genZipPackage.js
CHANGED
|
@@ -49,7 +49,7 @@ function genZipPackage (zipPackageName, cb) {
|
|
|
49
49
|
* @param handler
|
|
50
50
|
*/
|
|
51
51
|
exports.genSeePackage = function genSeePackage (seePackageName, options, handler) {
|
|
52
|
-
let { system, type, name, appType, version, template, variables, configName: configFileName } = options
|
|
52
|
+
let { system, type, name, appType, version, template, variables, configName: configFileName, description } = options
|
|
53
53
|
fs.ensureDirSync(tmp)
|
|
54
54
|
fs.ensureDirSync(`${tmp}/scripts`)
|
|
55
55
|
fs.outputFileSync(`./${tmp}/scripts/${name}/utils.py`, genScripts('utils'))
|
|
@@ -81,7 +81,8 @@ exports.genSeePackage = function genSeePackage (seePackageName, options, handler
|
|
|
81
81
|
appType,
|
|
82
82
|
version,
|
|
83
83
|
configFileName,
|
|
84
|
-
variables
|
|
84
|
+
variables,
|
|
85
|
+
description
|
|
85
86
|
}))
|
|
86
87
|
|
|
87
88
|
if (handler) {
|
package/src/see.js
CHANGED
|
@@ -5,7 +5,7 @@ const xml = require('xml')
|
|
|
5
5
|
const babel = require('@babel/core')
|
|
6
6
|
const { unEscapeForXML } = require('./utils')
|
|
7
7
|
|
|
8
|
-
exports.genDeployXml = function genDeployXml ({ system, type, name, appType, version, configFileName = 'config.local', variables = [] }) {
|
|
8
|
+
exports.genDeployXml = function genDeployXml ({ system, type, name, appType, version, configFileName = 'config.local', variables = [], description }) {
|
|
9
9
|
const template = fs.readFileSync(path.resolve(__dirname, `../templates/see/1.x/deploy.xml`))
|
|
10
10
|
|
|
11
11
|
return tpl(template)({
|
|
@@ -24,7 +24,8 @@ exports.genDeployXml = function genDeployXml ({ system, type, name, appType, ver
|
|
|
24
24
|
return unEscapeForXML(`${xmlVariable}`)
|
|
25
25
|
})
|
|
26
26
|
.join('\n ')
|
|
27
|
-
})()
|
|
27
|
+
})(),
|
|
28
|
+
description
|
|
28
29
|
})
|
|
29
30
|
}
|
|
30
31
|
|
package/src/winner-deploy.js
CHANGED
|
@@ -63,6 +63,9 @@ function genManifest (type, name) {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
* @param copyFiles {Array<string>} 不包含在 manifest.json 配置的文件,直接拷贝到 see 包里。文件路径是相对于项目根目录的路径+文件名,比如 dist/子包/version.js,那么 copyFiles: ['version.js']
|
|
67
|
+
* @param description {string} 发布包说明
|
|
68
|
+
* @param seePackageName {string} see发布物的包名,也就是 zip 包的命名,默认为 `${system}-${name}-${version}`
|
|
66
69
|
* @param cb {function} 回调函数,用于处理在组装 see 包后,压缩成 zip 包前可以自定义执行的动作
|
|
67
70
|
*/
|
|
68
71
|
exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
@@ -73,7 +76,10 @@ exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
|
73
76
|
version,
|
|
74
77
|
configName,
|
|
75
78
|
templateFunc,
|
|
76
|
-
variablesFunc
|
|
79
|
+
variablesFunc,
|
|
80
|
+
copyFiles,
|
|
81
|
+
description,
|
|
82
|
+
seePackageName
|
|
77
83
|
}, cb) {
|
|
78
84
|
if (!name || !version) {
|
|
79
85
|
throw new Error('应用名称和应用版本不能缺失~')
|
|
@@ -106,7 +112,7 @@ exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
genSeePackage(
|
|
109
|
-
`${system}-${name}-${version}`,
|
|
115
|
+
seePackageName || `${system}-${name}-${version}`,
|
|
110
116
|
{
|
|
111
117
|
system,
|
|
112
118
|
type,
|
|
@@ -115,7 +121,8 @@ exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
|
115
121
|
version,
|
|
116
122
|
configName,
|
|
117
123
|
template: (templateFunc)(),
|
|
118
|
-
variables: (variablesFunc)()
|
|
124
|
+
variables: (variablesFunc)(),
|
|
125
|
+
description
|
|
119
126
|
},
|
|
120
127
|
done => {
|
|
121
128
|
const { manifest, manifestJson } = genManifest(type, name)
|
|
@@ -134,8 +141,18 @@ exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
|
134
141
|
manifestJson
|
|
135
142
|
)
|
|
136
143
|
|
|
144
|
+
// 不包含在 manifest.json 配置的文件,直接拷贝到 see 包里
|
|
145
|
+
if (Array.isArray(copyFiles) && copyFiles.length) {
|
|
146
|
+
copyFiles.forEach((file) => {
|
|
147
|
+
// 1. 首先先确保文件目录存在,否则创建
|
|
148
|
+
fs.ensureFileSync(`./tmp/source/${name}/${file}`)
|
|
149
|
+
// 2. 然后进行拷贝
|
|
150
|
+
fs.copyFileSync(`./dist/${name}/${file}`, `./tmp/source/${name}/${file}`)
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
137
154
|
// 自定义执行的操作
|
|
138
|
-
typeof cb === 'function' && cb()
|
|
155
|
+
typeof cb === 'function' && cb()
|
|
139
156
|
|
|
140
157
|
done()
|
|
141
158
|
console.log()
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<systemType describe="系统类型">${ system }</systemType>
|
|
6
6
|
<appName describe="发布物名称">${ name }</appName>
|
|
7
7
|
<appType describe="发布物类型">${ appType }</appType>
|
|
8
|
-
<appDescribe describe="发布包说明"
|
|
8
|
+
<appDescribe describe="发布包说明">${ description }</appDescribe>
|
|
9
9
|
<version describe="发布包版本">${ version }</version>
|
|
10
10
|
<group describe="应用分组">${ type }</group>
|
|
11
11
|
<packInEffect describe="影响的主包(只有补丁需要配置,填写主包的版本号)"></packInEffect>
|