dispatch-spawn
v1.0.2
Published
Spawn an existing command via a dispatch server using fleet
Downloads
21
Readme
Dispatch Spawn
Execute fleet-spawn in a given git repo
Installation
npm install -S dispatch-spawn
Usage
To spawn a command, pass all the required parameters to the dispatch-spawn module
var inspect = require('eyespect').inspector();
var dispatchSpawn = require('dispatch-spawn')
var repoDir = '/path/to/checked/out/repo'
var command = 'node startServer.js' // command to spawn
var host = 'localhost' // fleet hub host
var port = 4002 // fleet hub port
var secret = 'foo_secret' // fleet hub secret
var data = {
repoDir: repoDir,
host: host,
port: port,
secret: secret,
command: command
}
dispatchSpawn(data, function (err) {
if (err) {
console.log(err.stack)
delete err.stack
inspect(err, 'error spawning command')
return
}
inspect('command spawned correctly')
})