-
Notifications
You must be signed in to change notification settings - Fork 0
/
flightplan.js
37 lines (29 loc) · 951 Bytes
/
flightplan.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
var plan = require('flightplan');
plan.target('production', [
{
host: 'crosswind.io',
username: 'ubuntu',
privateKey: '/Users/jamildhanani/.ssh/crosswind.pem'
}
]
);
plan.local(function(local) {
local.log('Checking to see if there are any uncommitted changes');
local.exec('git diff --quiet');
local.log('Checking to see if there are any unpushed changes');
local.exec('git diff --quiet origin/master..HEAD');
local.exec('grunt');
local.exec('pm2 restart app.js');
});
plan.remote(function(remote) {
remote.with('cd /metal/', function() {
remote.log('Pull latest code from git');
remote.git('pull');
remote.log('Install dependencies');
remote.exec('npm install');
remote.log('Set environment file');
remote.exec('touch PRODUCTION');
remote.log('Restart application');
remote.exec('pm2 restart app.js');
});
});