2022-07-18 21:43:10 +00:00
|
|
|
import { INFO, ERR, OK, VERB } from "../../util/logging.js";
|
|
|
|
import cp from "node:child_process";
|
|
|
|
|
|
|
|
const jobStr = process.argv.slice(2)[0];
|
|
|
|
const job = JSON.parse(jobStr);
|
|
|
|
const { command } = job.spec.template.spec.containers[0];
|
|
|
|
INFO("EXEC", "Internal Executor Starting!");
|
|
|
|
cp.exec(command, (error, stdout, stderr) => {
|
|
|
|
if (error) ERR("EXEC", error);
|
2022-08-09 04:29:10 +00:00
|
|
|
//if (stdout) VERB("EXEC-STDOUT", stdout);
|
|
|
|
//if (stderr) VERB("EXEC-STDERR", stderr);
|
2022-07-18 21:43:10 +00:00
|
|
|
OK("EXEC", "Internal Executor Finished!");
|
|
|
|
process.exit(error ? 1 : 0);
|
|
|
|
});
|