@taole/deploy-helper 0.5.3 → 0.5.5

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.
Files changed (2) hide show
  1. package/index.mjs +18 -7
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -56,6 +56,14 @@ async function initConfigJson() {
56
56
  },
57
57
  "testSync": {
58
58
  "dist/index.html": "events/CHANGE_ME.htm"
59
+ },
60
+ "prodPipeline":{
61
+ "pipelines": [
62
+ {
63
+ "name": "OfficialSite OR SOMEOTHER",
64
+ "waitResult": true
65
+ }
66
+ ]
59
67
  }
60
68
  }`;
61
69
  fs.writeFileSync(configJsonPath, content, { encoding: "utf-8" });
@@ -73,14 +81,15 @@ async function getScpClient() {
73
81
  const scpClientConfig = {
74
82
  host: TEST_SERVER_HOST,
75
83
  username: 'root',
76
- tryKeyboard: true,
77
- }
78
- const sshKeyPath = join(homedir(), ".ssh/id_rsa");
79
- if (fs.existsSync(sshKeyPath)) {
80
- scpClientConfig.privateKey = fs.readFileSync(sshKeyPath, "utf-8");
81
- } else {
82
- log(`${sshKeyPath}不存在, 建议配置本机ssh免密登录, 参考地址:https://foochane.cn/article/2019061601.html`);
84
+ tryKeyboard: false,
85
+ password: 'tuwan123!@#',
83
86
  }
87
+ // const sshKeyPath = join(homedir(), ".ssh/id_rsa");
88
+ // if (fs.existsSync(sshKeyPath)) {
89
+ // scpClientConfig.privateKey = fs.readFileSync(sshKeyPath, "utf-8");
90
+ // } else {
91
+ // log(`${sshKeyPath}不存在, 建议配置本机ssh免密登录, 参考地址:https://foochane.cn/article/2019061601.html`);
92
+ // }
84
93
  scpClient = await Client(scpClientConfig);
85
94
  return scpClient;
86
95
  }
@@ -374,6 +383,7 @@ async function main() {
374
383
  try {
375
384
  await assetsGit.push();
376
385
  } catch (error) {
386
+ await assetsGit.pull();
377
387
  await assetsGit.push();
378
388
  }
379
389
  log(`assets push done.`);
@@ -383,6 +393,7 @@ async function main() {
383
393
  try {
384
394
  await entryGit.push();
385
395
  } catch (error) {
396
+ await entryGit.pull();
386
397
  await entryGit.push();
387
398
  }
388
399
  log(`entry push done.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",