forked from conube/juce-scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshipitfile.js
75 lines (68 loc) · 1.69 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
require('shipit-shared')(shipit);
require('shipit-npm')(shipit);
shipit.initConfig({
default: {
workspace: '/tmp/deploy',
deployTo: '/deploy/juce-scraper',
repositoryUrl: 'https://github.com/conube/juce-scraper.git',
ignores: ['.git', 'node_modules'],
keepReleases: 2,
deleteOnRollback: false,
shallowClone: true,
shared: {
triggerEvent: false,
overwrite: true,
dirs: [
'node_modules',
{
path: 'node_modules',
overwrite: true
}
]
},
npm: {
remote: true,
triggerEvent: false
},
},
production: {
servers: 'user@server',
branch: 'master'
}
});
shipit.task('pwd', function () {
return shipit.remote('pwd');
});
shipit.task('nodev', function () {
return shipit.remote('node --version');
});
shipit.task('n', function () {
return shipit.remote('n --version');
});
shipit.task('whoami', function () {
return shipit.remote('whoami');
});
shipit.task('startOrRestart', function () {
var current = [shipit.config.deployTo, 'current'].join('/');
return shipit.remote('cd ' + current + '; pm2 startOrRestart server-prod.json');
});
shipit.task('deploy', function () {
return shipit.start(
'deploy:init',
'deploy:fetch',
'deploy:update',
'deploy:publish',
'deploy:clean',
'shared:prepare',
'shared:create-dirs',
'shared:set-permissions',
'shared:link',
'shared:end',
'npm:init',
'npm:install',
'startOrRestart'
);
});
};