-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathworker.js
More file actions
28 lines (27 loc) · 825 Bytes
/
worker.js
File metadata and controls
28 lines (27 loc) · 825 Bytes
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
const git = require('strider-git/lib');
module.exports = {
init: function (userConfig, config, job, context, cb) {
var account,
err = new Error('Invalid heroku configuration. Account not found');
if (!userConfig || !config || !config.app || !config.app.account)
return cb(err);
for (var i = 0; i < userConfig.accounts.length; i++) {
if (userConfig.accounts[i].id === config.app.account) {
account = userConfig.accounts[i];
break;
}
}
if (!account) return cb(err);
cb(null, {
deploy: function (context, done) {
var cmd =
'git push -f ' +
config.app.git_url +
' ' +
context.branch +
':master';
git.gitaneCmd(cmd, context.dataDir, account.privkey, context, done);
},
});
},
};