Upgrades people!
This commit is contained in:
parent
f84234150f
commit
8ad56e8d38
40 changed files with 483 additions and 379 deletions
|
@ -12,10 +12,10 @@ const ERR = "e";
|
|||
const OUT = "o";
|
||||
|
||||
export default class Executor {
|
||||
constructor(args, config, options = {}) {
|
||||
this.url = config.url(args) ?? process.env.QUALITEER_URL;
|
||||
this.jobId = config.jobId(args) ?? process.env.QUALITEER_JOB_ID;
|
||||
this.command = config.command(args) ?? process.env.QUALITEER_COMMAND;
|
||||
constructor(config, payload) {
|
||||
this.url = config.url(payload) ?? process.env.QUALITEER_URL;
|
||||
this.jobId = config.jobId(payload) ?? process.env.QUALITEER_JOB_ID;
|
||||
this.command = config.command(payload) ?? process.env.QUALITEER_COMMAND;
|
||||
this.mode = modes.EXEC;
|
||||
|
||||
// Internal Buffer
|
||||
|
@ -24,10 +24,10 @@ export default class Executor {
|
|||
this.buf[OUT] = "";
|
||||
|
||||
// Methods
|
||||
this.spawn = options.spawn ?? this.spawn.bind(this);
|
||||
this.report = options.report ?? this.report.bind(this);
|
||||
this.onProcClose = options.onProcClose ?? this.onProcClose.bind(this);
|
||||
this.onClose = options.onClose ?? this.onClose.bind(this);
|
||||
this.spawn = this.spawn.bind(this);
|
||||
this.report = this.report.bind(this);
|
||||
this.onProcClose = this.onProcClose.bind(this);
|
||||
this.onClose = this.onClose.bind(this);
|
||||
}
|
||||
|
||||
spawn() {
|
||||
|
|
|
@ -54,29 +54,32 @@ export default class Initiator {
|
|||
onCreate = onCreate ?? this.onCreate.bind(this);
|
||||
onPipelineTrigger =
|
||||
onPipelineTrigger ??
|
||||
((trigger) => {
|
||||
console.log("job trg:", trigger);
|
||||
const testName = trigger.pipelineTriggers;
|
||||
const pipelineData = trigger.pipelineData;
|
||||
const pipelineTriggers = trigger.newPipelineTriggers;
|
||||
const jobReq = {
|
||||
...jobRequest,
|
||||
testName,
|
||||
pipelineData,
|
||||
pipelineTriggers,
|
||||
};
|
||||
setTimeout(
|
||||
() =>
|
||||
this.newPipelineJob(
|
||||
jobReq,
|
||||
onLog,
|
||||
onClose,
|
||||
onCreate,
|
||||
onPipelineTrigger,
|
||||
onPipelineClose
|
||||
),
|
||||
trigger.pipelineDelay
|
||||
);
|
||||
((pipeline) => {
|
||||
console.log("job trg:", pipeline);
|
||||
const { triggers } = pipeline;
|
||||
if (!Object.keys(triggers).length) onPipelineClose();
|
||||
// For each trigger
|
||||
for (var testName in triggers) {
|
||||
const delay = triggers[testName].__testDelay ?? 0;
|
||||
delete triggers[testName].__testDelay;
|
||||
const jobReq = {
|
||||
...jobRequest,
|
||||
pipeline: { ...pipeline, triggers: triggers[testName] },
|
||||
testName,
|
||||
};
|
||||
setTimeout(
|
||||
() =>
|
||||
this.newPipelineJob(
|
||||
jobReq,
|
||||
onLog,
|
||||
onClose,
|
||||
onCreate,
|
||||
onPipelineTrigger,
|
||||
onPipelineClose
|
||||
),
|
||||
delay
|
||||
);
|
||||
}
|
||||
});
|
||||
onPipelineClose = onPipelineClose ?? this.onPipelineClose.bind(this);
|
||||
this.sk = mgr.socket("/");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue