0.0.5 • Published 5 years ago
@codersleague/procon v0.0.5
PROCON
Multi-process (and project) orchestrator for handling different development flows.
Configuration
Add procon.json
file or procon
property to package.json
and create your process flows configuration.
{
// Executors for different files. Used with app property in process configuration. Only node is there as default
"execMap": {
"node": ".js",
...
},
// Map for projects
"projects": {
"project-1-id": {
// Map of processes to orchestrate
"processes": {
"processId": {
// If should be started on init. Default: false
"runOnStart"?: true,
// Current working directory. Default: '.'
"cwd"?: string,
// Application file to run under executor from execMap. Either app or exec is required.
"app"?: string,
// Execution string e.g. 'echo Hello World!'. Will be splitted by spaces and first item inserted as executor and rest are args. Either app or exec is required.
"exec"?: string,
// Arguments for app or exec. If args are given in exec these will be appended with it.
"args"?: string[],
// If set to true stdout will be piped to Procon process. Default: false
"verbose"?: boolean,
// Debounce time for process restart in seconds. Handy if orchestrator will restart process depending on agressive stdout stream
"delay"?: number,
// Kill signal for process. For MAC and Linux. Default: SIGINT
"kill"?: string,
// Use spawn shell. Default: false
"shell"?: string | boolean,
// Use ipc in stdio. some prosecces not working if ipc pipe is open (e.g. exec "npm run whatever")
"ipc"?: boolean,
// Automatic restart on exit. Default: false
"sticky": boolean
}
},
// Array of orchestrator steps
"orchestrator": [
{
// Single or array of 'from' process describers to follow. Acts like or statement [match OR match OR match... ]
"from": [
{
"processId": string,
// Listen ipc message from process. Only reacts to full match.
"ipc": string,
// Listen stdout from process. Reacts if stdout message includes value.
"stdout": string,
// Listen stderr from process. Reacts if stderr message includes value.
"stderr": string,
// React to process event
"event": "start" | "exit" | "close"
},
...
],
// Single or array of 'to' process describers to direct. Will run wanted behaviour to all processes if minimum one match is found from 'from' property
"to": {
"processId": string,
// Sending ipc message to process
"ipc": string
// Process action
"action": "restart" | "kill"
}
}
]
},
"project-2-id": { ... }
}
}