-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.js
42 lines (34 loc) · 901 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
35
36
37
38
39
40
var yargs = require('yargs').argv;
var rsync = require('rsyncwrapper').rsync;
var secrets = require('./secrets.json');
try
{
var server = secrets.servers[yargs.server];
var rsyncDest = server.user+'@'+server.host+':'+server.path;
console.log("Deploying to " + server.host + "\n");
rsync({
ssh: true,
src: './www/',
dest: rsyncDest,
recursive: true,
syncDest: true,
args: ['--verbose'],
exclude: ['.git', '.DS_Store'],
onStdout: function(data) {
console.log(data.toString());
}
}, function(error, stdout, stderr, cmd) {
if (error) {
console.log(error.message);
} else {
console.log('Deployed to ' + rsyncDest);
process.exit();
return;
}
});
}
catch (e)
{
console.log('No server found');
process.exit();
}