Repository navigation
Expand file tree
/
Copy pathshipitfile.js
More file actions
71 lines (56 loc) · 1.71 KB
/
Copy pathshipitfile.js
File metadata and controls
71 lines (56 loc) · 1.71 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
var utils = require('shipit-utils');
shipit.initConfig({
default: {
workspace: '/tmp/demo',
deployTo: '/tmp/demo',
repositoryUrl: 'https://github.com/nmccartney/sailsUser',
ignores: ['.git', 'node_modules'],
rsync: ['--del'],
keepReleases: 2,
key: '$HOME/.ec2/gsg-keypair',
shallowClone: true
},
staging: {
servers: 'root@107.170.137.178'
}
});
// shipit.task('pwd', function () {
// return shipit.remote('pwd');
// });
shipit.task('install', function () {
return shipit.remote('cd ../tmp/demo/current; npm install ');;
});
// shipit.task('start', function () {
// return shipit.remote('cd ../tmp/demo/current; forever start index.js; forever -o out.log -e err.log index.js;');;
// });
// shipit.task('list', function () {
// return shipit.remote('cd ../tmp/demo/current; forever list');;
// });
// shipit.task('stop', function () {
// return shipit.remote('cd ../tmp/demo/current; forever stopall');;
// });
// shipit.task('restart',function(){
// shipit.log(require('chalk').green('Restarting server...') )
// var command = 'cd ../tmp/demo/current;'
// +"forever stopall;"
// +" forever start index.js;"
// return shipit.remote(command)
// .then(function(){
// shipit.log(require('chalk').green('Sever has restarted...') )
// shipit.emit('restarted');
// });
// })
// shipit.on('deploy:update',function(){
// utils.runTask('install');
// })
// shipit.on('deployed',function(){
// utils.runTask('restart');
// })
//bootstrap tasks
//install forever
shipit.task('forever', function () {
return shipit.remote('cd ../tmp/demo/current && npm install -g forever');
});
};