@pisell/common 0.0.59 → 0.0.60
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/es/script/constants/index.js +2 -2
- package/es/script/release/release.js +2 -1
- package/es/script/uploadCode/index.js +1 -1
- package/es/script/utils/index.js +5 -2
- package/lib/script/constants/index.js +2 -2
- package/lib/script/release/release.js +2 -1
- package/lib/script/uploadCode/index.js +1 -1
- package/lib/script/utils/index.js +8 -2
- package/package.json +1 -1
|
@@ -26,11 +26,11 @@ var outPathMap = {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
var isSsrMap = {
|
|
29
|
-
my_pisel_shop:
|
|
29
|
+
my_pisel_shop: true,
|
|
30
30
|
admin: false,
|
|
31
31
|
my_pisel_pc_v2: true,
|
|
32
32
|
my_pisel_h5_v2: true,
|
|
33
|
-
pisell2_pages:
|
|
33
|
+
pisell2_pages: true
|
|
34
34
|
};
|
|
35
35
|
var checkPackages = ['@pisell/date-picker', '@pisell/lowcode-renderer', '@pisell/common', '@pisell/utils'];
|
|
36
36
|
|
|
@@ -122,7 +122,8 @@ var Release = /*#__PURE__*/function () {
|
|
|
122
122
|
fileName: "".concat(this.version),
|
|
123
123
|
isSSR: this.isSSR,
|
|
124
124
|
env: this.env,
|
|
125
|
-
branch: grayBranch
|
|
125
|
+
branch: grayBranch,
|
|
126
|
+
projectName: this.projectName
|
|
126
127
|
});
|
|
127
128
|
case 2:
|
|
128
129
|
return _context3.abrupt("return", _context3.sent);
|
package/es/script/utils/index.js
CHANGED
|
@@ -198,7 +198,10 @@ var releaseProject = function releaseProject(conn, _ref6) {
|
|
|
198
198
|
isSSR = _ref6.isSSR,
|
|
199
199
|
env = _ref6.env,
|
|
200
200
|
_ref6$branch = _ref6.branch,
|
|
201
|
-
branch = _ref6$branch === void 0 ? 'master' : _ref6$branch
|
|
201
|
+
branch = _ref6$branch === void 0 ? 'master' : _ref6$branch,
|
|
202
|
+
projectName = _ref6.projectName;
|
|
203
|
+
// 灰度项目的话重启目录不同 目前只有 my_pisel_shop和pisell2_pages走这个逻辑
|
|
204
|
+
var isGrayRestart = ['my_pisel_shop', 'pisell2_pages'].includes(projectName);
|
|
202
205
|
return new Promise(function (resolve, reject) {
|
|
203
206
|
conn.shell(function (err, stream) {
|
|
204
207
|
if (err) {
|
|
@@ -206,7 +209,7 @@ var releaseProject = function releaseProject(conn, _ref6) {
|
|
|
206
209
|
reject(err);
|
|
207
210
|
return;
|
|
208
211
|
}
|
|
209
|
-
stream.end(" ".concat(env === 'prod' ? 'sudo -i' : '', "\n cd ").concat(path, "\n cp -R -f pre-master next-master\n rm -rf pre-master\n \\cp -R -f ").concat(fileName, "/* next-master\n cp -R -f ").concat(fileName, " pre-master\n rm -rf ").concat(branch, "\n cp -R next-master ").concat(branch, "\n rm -rf next-master\n ").concat(isSSR ? 'pm2 restart server.js' : '', "\n exit\n ").concat(env === 'prod' ? 'exit' : '', "\n ") // 打开到path
|
|
212
|
+
stream.end(" ".concat(env === 'prod' ? 'sudo -i' : '', "\n cd ").concat(path, "\n cp -R -f pre-master next-master\n rm -rf pre-master\n \\cp -R -f ").concat(fileName, "/* next-master\n cp -R -f ").concat(fileName, " pre-master\n rm -rf ").concat(branch, "\n cp -R next-master ").concat(branch, "\n rm -rf next-master\n ").concat(isGrayRestart && isSSR ? "cd ../front_service\n pm2 restart ".concat(projectName, ".js\n ") : '', "\n ").concat(!isGrayRestart && isSSR ? 'pm2 restart server.js' : '', "\n exit\n ").concat(env === 'prod' ? 'exit' : '', "\n ") // 打开到path
|
|
210
213
|
// 复制pre-master到next-master
|
|
211
214
|
// 删除pre-master
|
|
212
215
|
// 复制1.0.0到next-master
|
|
@@ -53,11 +53,11 @@ var outPathMap = {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
var isSsrMap = {
|
|
56
|
-
my_pisel_shop:
|
|
56
|
+
my_pisel_shop: true,
|
|
57
57
|
admin: false,
|
|
58
58
|
my_pisel_pc_v2: true,
|
|
59
59
|
my_pisel_h5_v2: true,
|
|
60
|
-
pisell2_pages:
|
|
60
|
+
pisell2_pages: true
|
|
61
61
|
};
|
|
62
62
|
var checkPackages = [
|
|
63
63
|
"@pisell/date-picker",
|
|
@@ -185,7 +185,7 @@ async function init() {
|
|
|
185
185
|
console.log("开始发布");
|
|
186
186
|
const branch = await (0, import_utils.getGitCurrentBranch)();
|
|
187
187
|
let grayBranch = "master";
|
|
188
|
-
if (!import_constants.originBranch.includes(branch)) {
|
|
188
|
+
if (!import_constants.originBranch.includes(branch.trim())) {
|
|
189
189
|
grayBranch = branch;
|
|
190
190
|
}
|
|
191
191
|
await releaseInstance.release(grayBranch);
|
|
@@ -151,7 +151,10 @@ var serverUnpack = (conn, { path: path2, fileName, fullFileName, changelog, env
|
|
|
151
151
|
});
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
|
-
var releaseProject = (conn, { path: path2, fileName, isSSR, env, branch = "master" }) => {
|
|
154
|
+
var releaseProject = (conn, { path: path2, fileName, isSSR, env, branch = "master", projectName }) => {
|
|
155
|
+
const isGrayRestart = ["my_pisel_shop", "pisell2_pages"].includes(
|
|
156
|
+
projectName
|
|
157
|
+
);
|
|
155
158
|
return new Promise((resolve, reject) => {
|
|
156
159
|
conn.shell((err, stream) => {
|
|
157
160
|
if (err) {
|
|
@@ -169,7 +172,10 @@ var releaseProject = (conn, { path: path2, fileName, isSSR, env, branch = "maste
|
|
|
169
172
|
rm -rf ${branch}
|
|
170
173
|
cp -R next-master ${branch}
|
|
171
174
|
rm -rf next-master
|
|
172
|
-
${isSSR ?
|
|
175
|
+
${isGrayRestart && isSSR ? `cd ../front_service
|
|
176
|
+
pm2 restart ${projectName}.js
|
|
177
|
+
` : ""}
|
|
178
|
+
${!isGrayRestart && isSSR ? "pm2 restart server.js" : ""}
|
|
173
179
|
exit
|
|
174
180
|
${env === "prod" ? "exit" : ""}
|
|
175
181
|
`
|