forked from Strider-CD/strider-simple-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (25 loc) · 927 Bytes
/
index.js
File metadata and controls
32 lines (25 loc) · 927 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
29
30
31
32
var Runner = require('./lib/worker')
, loader = require('strider-extension-loader')
var create = function(emitter, opts, cb){
console.log(">>>>> RUNNER:: CREATE", arguments)
var runner = new Runner(emitter, opts)
runner.attach()
// TEMP - assume all the extensions are loaded. This
// will be replaced when we pass the extension config
// through in the run events.
var pth = require.main.paths
loader.initWorkerExtensions(pth, runner.buildContext({}, pth), function(){
console.log("!!!!! RUNNER CREATE>", arguments)
cb(null)
})
}
module.exports = {
// Strider worker requires:
// function(emitter, opts, cb) -> creates a 'runner' bound to the emitter
create: create,
// Must handle events:
// --> 'job.create' {enablePty : Boolean, repoConfig: {...}, extensionConfig: [...] }
// --> 'job.cancel' ?
// We expose these for other modules / unit testing
Runner : Runner
}