-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
deploy.js
51 lines (39 loc) · 1.38 KB
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const util = require("util");
const pkg = require("./package.json");
const exec = util.promisify(require("child_process").exec);
const argv = require("yargs").options({
b: {
alias: "beta",
describe: "密码",
type: "boolean",
default: false,
},
}).argv;
const beta = argv.beta;
const fullFileName = `${pkg.name}-v${pkg.version}${beta ? "-beta" : ""}.tar.gz`;
const fileName = `${pkg.name}${beta ? "-beta" : ""}.tar.gz`;
(async function () {
try {
console.log("上传到 nas");
// await exec(
// `scp -P 5022 dist/network-rc.tar.gz itiwll@192.168.50.2:/volume1/web/network-rc/download/${fileName}`
// );
// await exec(
// `scp -P 5022 dist/network-rc.tar.gz itiwll@192.168.50.2:/volume1/web/network-rc/download/${fullFileName}`
// );
console.log("上传 一键安装脚本");
await exec(
`scp -P 29168 ./install.sh root@download.esonwong.com:/www/download/network-rc/install.sh`
);
console.log(`上传 ${fileName} 到 download.esonwong.com`);
await exec(
`scp -P 29168 dist/network-rc.tar.gz root@download.esonwong.com:/www/download/network-rc/${fileName}`
);
console.log(`上传 ${fullFileName} 到 download.esonwong.com`);
await exec(
`scp -P 29168 dist/network-rc.tar.gz root@download.esonwong.com:/www/download/network-rc/${fullFileName}`
);
} catch (e) {
console.error(e);
}
})();