forked from w3f/polkadot-deployer
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.js
executable file
·57 lines (44 loc) · 1.54 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env node
const process = require('process');
const program = require('commander');
const version = require('./lib/version');
const list = require('./lib/actions/list');
const create = require('./lib/actions/create');
const destroy = require('./lib/actions/destroy');
const redeploy = require('./lib/actions/redeploy');
const benchmark = require('./lib/actions/benchmark');
program
.version(version.show());
program
.command('list')
.description('Shows the clusters already deployed.')
.action(list.do);
program
.command('create')
.description('Deploys a new cluster.')
.option('-c, --config [path]', 'path to config file')
.option('--verbose', 'Output extra info.')
.action(create.do);
program
.command('destroy [name]')
.description('Deletes a deployment.')
.option('--verbose', 'Output extra info.')
.action(destroy.do);
program
.command('redeploy [name]')
.description('Recreates a deployment on an existing cluster.')
.option('--verbose', 'Output extra info.')
.action(redeploy.do);
program
.command('benchmark')
.description('Creates deployments and runs benchmarks on them.')
.option('-c, --config [filePath]', 'path to config file')
.option('-o, --output [directoryPath]', 'path to output data directory')
.option('--verbose', 'Output extra info.')
.action(benchmark.do);
program.allowUnknownOption(false);
const parsed = program.parse(process.argv);
if (!(parsed.args && parsed.args.length > 0 && (typeof (parsed.args[0] === 'object')))) {
console.log(parsed.args.length);
program.outputHelp();
}