-
Notifications
You must be signed in to change notification settings - Fork 0
/
shipitfile.js
48 lines (40 loc) · 1.38 KB
/
shipitfile.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
var pkg = require('./package.json');
var envmnt = require('./secrets.json');
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
shipit.initConfig({
default: {
workspace: '/tmp/forge-server-workspace',
deployTo: '/home/ec2-user/deploy/forge-server',
repositoryUrl: envmnt.repository.url,
ignores: ['.git', 'node_modules'],
keepReleases: 2,
deleteOnRollback: false,
key: envmnt.production.key_path,
branch: 'master'
},
production: {
servers: envmnt.production.user + '@' + envmnt.production.host
}
});
shipit.task('copy', function () {
shipit.remote('cp /home/ec2-user/deploy/forge-server/current/legacy/proxy.js /home/ec2-user/proxy.js');
});
shipit.task('restart', function () {
shipit.remote('sudo restart node');
shipit.remote('sudo restart forge-server');
shipit.remote('sudo restart forge-server-deleter');
});
// copy and replace new proxy.js
shipit.on('published', function () {
shipit.start('copy');
});
// restart all processes after deploy
shipit.on('deployed', function () {
shipit.start('restart');
});
// restart all processes after rollback
shipit.on('rollbacked', function () {
shipit.start('restart');
});
};