forked from Phala-Network/open-node-deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·80 lines (65 loc) · 2.56 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env node
const process = require('process');
const program = require('commander');
const benchmark = require('./lib/actions/benchmark');
const create = require('./lib/actions/create');
const destroy = require('./lib/actions/destroy');
const getConfig = require('./lib/actions/getconfig');
const list = require('./lib/actions/list');
const projectCreate = require('./lib/actions/project/create');
const redeploy = require('./lib/actions/redeploy');
const version = require('./lib/version');
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('-d, --data [path]', 'Path to data directory.')
.option('--verbose', 'Output extra info.')
.option('--update', 'Rerun deployment actions if the cluster already exists.')
.option('--skip-infra', 'Skip creating infra.')
.option('--skip-deps', 'Skip installing dependencies.')
.action(create.do);
program
.command('destroy [name]')
.description('Deletes a deployment.')
.option('-c, --config [path]', 'Path to config file.')
.option('-d, --data [path]', 'Path to data directory.')
.option('--verbose', 'Output extra info.')
.action(destroy.do);
program
.command('redeploy [name]')
.description('Recreates a deployment on an existing cluster.')
.option('-d, --data [path]', 'Path to data directory.')
.option('--verbose', 'Output extra info.')
.action(redeploy.do);
program
.command('getConfig')
.description('Downloads configuration files for an existing remote deployment.')
.option('-c, --config [path]', 'Path to config file.')
.option('-d, --data [path]', 'Path to data directory.')
.option('--verbose', 'Output extra info.')
.action(getConfig.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
.command('project-create')
.description('Create polkadot-deployer projects.')
.option('-p, --path [path]', 'Path to project directory.')
.option('--verbose', 'Output extra info')
.action(projectCreate.do);
program.allowUnknownOption(false);
const parsed = program.parse(process.argv);
if (! parsed || !(parsed.args && parsed.args.length > 0 && (typeof (parsed.args[0] === 'object')))) {
program.outputHelp();
}