-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshipitfile.js
49 lines (40 loc) · 1.52 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
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
let program = require('commander');
program
.option('-r, --revision <rev>', 'Branch, commit or tag')
.parse(process.argv);
shipit.initConfig({
default: {
workspace: '/tmp/github-monitor',
deployTo: '/usr/local/share/bchd/health-dashboard',
repositoryUrl: '[email protected]:BaltimoreCity/bchd-health-dashboard.git',
ignores: ['.git', 'node_modules'],
keepReleases: 2,
deleteOnRollback: false,
shallowClone: true
},
staging: {
branch: (program.revision || 'develop')
}
});
shipit.on('published', function() {
shipit.remote('cd ' + shipit.releasePath + ' && npm install');
});
shipit.task('stop-app', function() {
return shipit.remote("sudo systemctl stop healthdashboard.service")
})
shipit.task('start-app', function() {
return shipit.remote('sudo systemctl daemon-reload && sudo systemctl restart healthdashboard.service');
});
// ingest the db and populate typeahead
shipit.task('ingest-db', function() {
var command = ['cd /usr/local/share/bchd/health-dashboard/current'];
command.push('node ./scripts/ingest/ingest-death-records.js scripts/ingest/ocme-2017-09-11.csv 0');
command.push('cd ./scripts/mongo-load && sh load-data-into-mongo.sh & cd ../../');
return shipit.remote(command.join(' && '));
});
shipit.task('dropdb', function() {
return shipit.remote('cd /usr/local/share/bchd/health-dashboard/current && npm run dropdb');
});
};