@pisell/common 0.0.28 → 0.0.30
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.
|
@@ -65,7 +65,7 @@ var ignoreName = ['master', '.git', 'pre-master'];
|
|
|
65
65
|
*/
|
|
66
66
|
var getVersionList = /*#__PURE__*/function () {
|
|
67
67
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
68
|
-
var env, project, config, host, projectName, versionList;
|
|
68
|
+
var env, project, config, port, host, projectName, versionList;
|
|
69
69
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
70
70
|
while (1) switch (_context.prev = _context.next) {
|
|
71
71
|
case 0:
|
|
@@ -74,17 +74,17 @@ var getVersionList = /*#__PURE__*/function () {
|
|
|
74
74
|
return getServerConfig();
|
|
75
75
|
case 3:
|
|
76
76
|
config = _context.sent;
|
|
77
|
+
port = 3600;
|
|
77
78
|
host = config[env].host;
|
|
78
79
|
if (env === 'release') {
|
|
79
80
|
host = config.cn[env].host;
|
|
81
|
+
} else if (env === 'prod') {
|
|
82
|
+
host = config.prod3.host;
|
|
83
|
+
port = 9008;
|
|
80
84
|
}
|
|
81
|
-
projectName = project.fileName;
|
|
82
|
-
if (projectName === 'my_pisel_shop' && env === 'prod') {
|
|
83
|
-
projectName = 'mypisel_shop';
|
|
84
|
-
}
|
|
85
|
-
// 域名
|
|
85
|
+
projectName = project.fileName; // 域名 端口
|
|
86
86
|
_context.next = 10;
|
|
87
|
-
return fetch("http://".concat(host, ":
|
|
87
|
+
return fetch("http://".concat(host, ":").concat(port, "/version?projectName=").concat(projectName)).then(function (res) {
|
|
88
88
|
return res.json();
|
|
89
89
|
});
|
|
90
90
|
case 10:
|
|
@@ -221,13 +221,17 @@ function _init() {
|
|
|
221
221
|
}]
|
|
222
222
|
});
|
|
223
223
|
case 70:
|
|
224
|
-
|
|
224
|
+
if (!(res.project.fileName === 'my_pisel_shop')) {
|
|
225
|
+
_context.next = 73;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
_context.next = 73;
|
|
225
229
|
return updateVersion({
|
|
226
230
|
version: version,
|
|
227
231
|
changelog: res.changelog
|
|
228
232
|
}, res.env);
|
|
229
|
-
case
|
|
230
|
-
_context.next =
|
|
233
|
+
case 73:
|
|
234
|
+
_context.next = 75;
|
|
231
235
|
return sendWebhook({
|
|
232
236
|
title: "".concat(res.project.fileName, " ").concat(res.env, "\u73AF\u5883").concat(res.is_release ? '上传并发布' : '上传', "\u6210\u529F"),
|
|
233
237
|
content: [{
|
|
@@ -241,9 +245,9 @@ function _init() {
|
|
|
241
245
|
value: version || ''
|
|
242
246
|
}]
|
|
243
247
|
});
|
|
244
|
-
case 74:
|
|
245
|
-
uploadCode.deleteLocalZip();
|
|
246
248
|
case 75:
|
|
249
|
+
uploadCode.deleteLocalZip();
|
|
250
|
+
case 76:
|
|
247
251
|
case "end":
|
|
248
252
|
return _context.stop();
|
|
249
253
|
}
|
|
@@ -80,16 +80,17 @@ var inquirerResult = (versionList) => {
|
|
|
80
80
|
var ignoreName = ["master", ".git", "pre-master"];
|
|
81
81
|
var getVersionList = async ({ env, project }) => {
|
|
82
82
|
const config = await (0, import_utils.getServerConfig)();
|
|
83
|
+
let port = 3600;
|
|
83
84
|
let host = config[env].host;
|
|
84
85
|
if (env === "release") {
|
|
85
86
|
host = config.cn[env].host;
|
|
87
|
+
} else if (env === "prod") {
|
|
88
|
+
host = config.prod3.host;
|
|
89
|
+
port = 9008;
|
|
86
90
|
}
|
|
87
91
|
let projectName = project.fileName;
|
|
88
|
-
if (projectName === "my_pisel_shop" && env === "prod") {
|
|
89
|
-
projectName = "mypisel_shop";
|
|
90
|
-
}
|
|
91
92
|
const versionList = await fetch(
|
|
92
|
-
`http://${host}
|
|
93
|
+
`http://${host}:${port}/version?projectName=${projectName}`
|
|
93
94
|
).then((res) => res.json());
|
|
94
95
|
return (0, import_utils.versionSort)(versionList.filter((item) => !ignoreName.includes(item)));
|
|
95
96
|
};
|
|
@@ -178,13 +178,15 @@ async function init() {
|
|
|
178
178
|
]
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
181
|
+
if (res.project.fileName === "my_pisel_shop") {
|
|
182
|
+
await updateVersion(
|
|
183
|
+
{
|
|
184
|
+
version,
|
|
185
|
+
changelog: res.changelog
|
|
186
|
+
},
|
|
187
|
+
res.env
|
|
188
|
+
);
|
|
189
|
+
}
|
|
188
190
|
await (0, import_utils.sendWebhook)({
|
|
189
191
|
title: `${res.project.fileName} ${res.env}环境${res.is_release ? "上传并发布" : "上传"}成功`,
|
|
190
192
|
content: [
|