-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy_dev.js
41 lines (35 loc) · 1.18 KB
/
deploy_dev.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
// **** ftp-deploy config file
const sftp = require("node-sftp-deploy-i");
/**
* * login_prefs should be an object with props user and password. Remember to not include file in repo!
* * exports.login_prefs = { user: "myUser", password: "mypassword123"}
*/
let login_prefs = require("./login_prefs");
login_prefs = login_prefs.login_prefs;
console.log("deploy_dev_nb");
// console.log("login_prefs = ", login_prefs);
// to upload html files after all others
// const sortingFunction = function (a, b) {
// return path.extname(a.path).toLowerCase() === '.html' ? 1 : -1;
// };
sftp({
host: "cpanel76.proisp.no",
port: "22",
user: login_prefs.user,
pass: login_prefs.password,
remotePath: "/home/doublfkx/public_html/ndla_tidslinje",
sourcePath: "./dist/",
// includePattern: /.*\.(js|css|html)$/, // optional, upload only js css and html files
// sort: sortingFunction, // optional
cacheFile: "sftp-cache.json", // optional
})
.then(function() {
console.log("deploy successful");
})
.catch(function(error) {
console.log("deploy error: ", error);
});
// Support Promise
// sftp(sftpConfig).then(function(){
// //Success Callback
// });