-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.js
34 lines (29 loc) · 863 Bytes
/
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
require('dotenv').config();
const FtpDeploy = require("ftp-deploy");
const ftpDeploy = new FtpDeploy();
var config = {
user: process.env.FTP_USER,
password: process.env.FTP_PASSWORD,
host: process.env.FTP_HOST,
port: 21,
localRoot: __dirname + "/out",
remoteRoot: "/",
include: ["*", "**/*"],
exclude: [],
deleteRemote: false,
forcePasv: true
};
ftpDeploy.on("uploaded", function(data) {
console.log(`Uploaded ${data.transferredFileCount}/${data.totalFilesCount} ${data.filename}`);
});
ftpDeploy.on("log", function(data) {
console.log('log', data);
});
ftpDeploy.on("upload-error", function(data) {
console.log(upload-error, data);
});
console.log("Let's deploy the website 😱")
ftpDeploy
.deploy(config)
.then(res => console.log("Deploy finished! 🤘"))
.catch(err => console.log(err));