浏览代码

更新配置

seimin 10 月之前
父节点
当前提交
19b5dec292
共有 1 个文件被更改,包括 9 次插入9 次删除
  1. 9 9
      upload/production.js

+ 9 - 9
upload/production.js

@@ -1,11 +1,11 @@
1
 const shell = require('shelljs')
1
 const shell = require('shelljs')
2
 const path = require('path');
2
 const path = require('path');
3
 const config = {
3
 const config = {
4
-  ip: "118.190.89.49", // ssh地址
4
+  ip: "47.113.226.223", // ssh地址
5
   username: "root", // ssh 用户名
5
   username: "root", // ssh 用户名
6
   port: 22,      //端口
6
   port: 22,      //端口
7
-  password: "dstech@123", // ssh 密码
8
-  path: '/home/itsm_v2_/web/pc', // 上传地址,删除地址
7
+  password: "DStech@123", // ssh 密码
8
+  path: '/home/itsm/project/html2/spreadSheet', // 上传地址,删除地址
9
   buildPath: '../dist/spreadSheet' // 本地打包后文件地址
9
   buildPath: '../dist/spreadSheet' // 本地打包后文件地址
10
 }
10
 }
11
 let Client = require('ssh2-sftp-client');
11
 let Client = require('ssh2-sftp-client');
@@ -35,16 +35,16 @@ function connectSSh() {
35
 function runTask() {
35
 function runTask() {
36
   //打包完成
36
   //打包完成
37
   console.log(`当前NodeJs版本是${process.version}`);
37
   console.log(`当前NodeJs版本是${process.version}`);
38
-  const isNodeVersionLt17 = parseInt(process.version) < 17;
39
-  const execStr = isNodeVersionLt17 ? 'npm run build' : 'npm run build:17';
38
+  const isNodeVersionLt17 = parseInt(process.version.slice(1)) < 17;
39
+  const execStr = isNodeVersionLt17 ? 'npm run build' : 'npm run build';
40
   if (shell.exec(execStr).code == 0) {
40
   if (shell.exec(execStr).code == 0) {
41
-    if (shell.exec(`find dist -name '*.js' -print0 | xargs -0 gzip -k`).code == 0) {
42
-      if (shell.exec(`find dist -name '*.css' -print0 | xargs -0 gzip -k`).code == 0) {
41
+    // if (shell.exec(`find dist -name '*.js' -print0 | xargs -0 gzip -k`).code == 0) {
42
+      // if (shell.exec(`find dist -name '*.css' -print0 | xargs -0 gzip -k`).code == 0) {
43
         console.log("-----打包成功-----");
43
         console.log("-----打包成功-----");
44
         //提交上传
44
         //提交上传
45
         connectSSh();
45
         connectSSh();
46
-      }
47
-    }
46
+      // }
47
+    // }
48
   }
48
   }
49
 }
49
 }
50
 runTask()
50
 runTask()