firmament-bash
Version:
Firmament module for interpreting commands in JSON files using bash
54 lines • 2.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const inversify_config_1 = require("../../inversify.config");
const processCommandJson = inversify_config_1.default.get('ProcessCommandJson');
const commandUtil = inversify_config_1.default.get('CommandUtil');
const scriptPath = '/home/jreeme/src/firmament-bash/command-json/valid.json';
const errorScriptPath = '/home/jreeme/src/firmament-bash/command-json/valid-error.json';
const sudoScriptPath = '/home/jreeme/src/firmament-bash/command-json/valid-sudo.json';
const pipeScriptPath = '/home/jreeme/src/firmament-bash/command-json/pipe-00.json';
const networkScriptPath = 'https://raw.githubusercontent.com/jreeme/firmament-bash/master/command-json/firmament-dev-00.json';
const remoteCatalogGetter = inversify_config_1.default.get('RemoteCatalogGetter');
const broScriptPath = '/home/jreeme/bro/bro4.json';
const commandCatalogUrl = '/home/jreeme/src/firmament-bash/command-json/commandCatalog.json';
const touchRemotely = {
description: "touch remotely, say hello",
suppressOutput: false,
suppressDiagnostics: false,
suppressPreAndPostSpawnMessages: true,
outputColor: "",
remoteHost: "192.168.104.69",
remoteUser: "jreeme",
remoteSshKeyPath: "/home/jreeme/.ssh/id_rsa",
useSudo: false,
workingDirectory: ".",
command: "touch",
args: [
"/tmp/hello"
]
};
const testExecutionGraph = {
description: "Test touch remote server",
options: {
"displayExecutionGraphDescription": true
},
asynchronousCommands: [],
serialSynchronizedCommands: []
};
for (let i = 0; i < 10; ++i) {
const tr0 = Object.assign({}, touchRemotely);
tr0.args = [
`/tmp/hello-s-${i}`
];
testExecutionGraph.serialSynchronizedCommands.push(tr0);
const tr1 = Object.assign({}, touchRemotely);
tr1.args = [
`/tmp/hello-a-${i}`
];
testExecutionGraph.asynchronousCommands.push(tr1);
}
processCommandJson.processExecutionGraph(testExecutionGraph, (err, result) => {
commandUtil.processExitWithError(err, 'OK');
});
//# sourceMappingURL=manual-test.js.map