forked from prerender/prerender
-
Notifications
You must be signed in to change notification settings - Fork 1
/
shipitfile.js
53 lines (46 loc) · 1.36 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
49
50
51
52
53
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
require('shipit-shared')(shipit);
shipit.initConfig({
default: {
workspace: '/tmp/shipit_workspace',
deployTo: '/home/admin/apps/prerender',
repositoryUrl: 'git@github.com:fiverr/prerender.git',
ignores: ['.git', 'node_modules'],
branch: process.env.BRANCH || 'master',
keepReleases: 10,
shallowClone: true,
shared: {
dirs: [ 'node_modules', 'log', 'run' ],
}
},
fiverr03: {
servers: 'admin@fiverr03'
},
fiverr04: {
servers: 'admin@fiverr04'
}
});
function underRelease(cmd) {
return 'cd ' + shipit.config.deployTo + "/current " + ' && ' + cmd;
}
shipit.blTask('startAppStaging', function () {
shipit.remote(underRelease("./control.sh restart staging"));
});
shipit.blTask('startAppProduction', function () {
shipit.remote(underRelease("./control.sh restart production"));
});
shipit.blTask('deployStaging', function () {
shipit.start('startAppStaging');
});
shipit.blTask('deployProduction', function () {
shipit.start('startAppProduction');
});
shipit.on("cleaned", function() {
if (shipit.environment.indexOf("staging") > -1) {
shipit.start('deployStaging');
} else {
shipit.start('deployProduction');
}
});
};