@secretstartups/workshop 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +54 -6
- package/dist/app.module.js +6 -0
- package/dist/app.module.js.map +1 -1
- package/dist/auth/commands/logout.command.js +5 -0
- package/dist/auth/commands/logout.command.js.map +1 -1
- package/dist/auth/commands/status.command.js +6 -0
- package/dist/auth/commands/status.command.js.map +1 -1
- package/dist/cluster/commands/cluster-create.command.d.ts +4 -0
- package/dist/cluster/commands/cluster-create.command.js +26 -1
- package/dist/cluster/commands/cluster-create.command.js.map +1 -1
- package/dist/common/config/cli-config.service.d.ts +2 -0
- package/dist/common/config/cli-config.service.js +16 -1
- package/dist/common/config/cli-config.service.js.map +1 -1
- package/dist/drift/drift-api.d.ts +70 -0
- package/dist/drift/drift-api.js +67 -0
- package/dist/drift/drift-api.js.map +1 -0
- package/dist/drift/drift.commands.d.ts +43 -0
- package/dist/drift/drift.commands.js +294 -0
- package/dist/drift/drift.commands.js.map +1 -0
- package/dist/drift/drift.module.d.ts +2 -0
- package/dist/drift/drift.module.js +20 -0
- package/dist/drift/drift.module.js.map +1 -0
- package/dist/runbooks/runbooks.commands.d.ts +69 -0
- package/dist/runbooks/runbooks.commands.js +272 -0
- package/dist/runbooks/runbooks.commands.js.map +1 -0
- package/dist/runners/commands/groups.commands.d.ts +55 -0
- package/dist/runners/commands/groups.commands.js +260 -0
- package/dist/runners/commands/groups.commands.js.map +1 -0
- package/dist/runners/commands/install.commands.d.ts +36 -0
- package/dist/runners/commands/install.commands.js +192 -0
- package/dist/runners/commands/install.commands.js.map +1 -0
- package/dist/runners/commands/jobs.commands.d.ts +38 -0
- package/dist/runners/commands/jobs.commands.js +206 -0
- package/dist/runners/commands/jobs.commands.js.map +1 -0
- package/dist/runners/runners-api.d.ts +94 -0
- package/dist/runners/runners-api.js +110 -0
- package/dist/runners/runners-api.js.map +1 -0
- package/dist/runners/runners.module.d.ts +6 -0
- package/dist/runners/runners.module.js +58 -0
- package/dist/runners/runners.module.js.map +1 -0
- package/dist/service/commands/service-build.command.d.ts +29 -0
- package/dist/service/commands/service-build.command.js +148 -0
- package/dist/service/commands/service-build.command.js.map +1 -0
- package/dist/service/commands/service.command.js +5 -0
- package/dist/service/commands/service.command.js.map +1 -1
- package/dist/service/service.module.js +3 -0
- package/dist/service/service.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RunbooksModule = exports.RunbooksRootCommand = exports.RunbooksRejectCommand = exports.RunbooksApproveCommand = exports.RunbooksRunsCommand = exports.RunbooksRunCommand = exports.RunbooksListCommand = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const nest_commander_1 = require("nest-commander");
|
|
15
|
+
const prompts_1 = require("@inquirer/prompts");
|
|
16
|
+
const api_service_1 = require("../common/api/api.service");
|
|
17
|
+
const output_service_1 = require("../common/output/output.service");
|
|
18
|
+
const cli_config_service_1 = require("../common/config/cli-config.service");
|
|
19
|
+
const runners_api_1 = require("../runners/runners-api");
|
|
20
|
+
let RunbooksCommand = class RunbooksCommand extends nest_commander_1.CommandRunner {
|
|
21
|
+
constructor(api, output, config) {
|
|
22
|
+
super();
|
|
23
|
+
this.api = api;
|
|
24
|
+
this.output = output;
|
|
25
|
+
this.config = config;
|
|
26
|
+
}
|
|
27
|
+
base(options) {
|
|
28
|
+
const orgId = options.org ?? this.config.getCurrentOrgId();
|
|
29
|
+
if (!orgId)
|
|
30
|
+
throw new Error('No organization selected. Run `workshop org use <id>` or pass --org <id>.');
|
|
31
|
+
return `/organizations/${orgId}/runbooks`;
|
|
32
|
+
}
|
|
33
|
+
unwrap(response) {
|
|
34
|
+
if (response && typeof response === 'object' && 'success' in response) {
|
|
35
|
+
if (!response.success)
|
|
36
|
+
throw new Error(response.message || 'Request failed');
|
|
37
|
+
return response.data;
|
|
38
|
+
}
|
|
39
|
+
return response;
|
|
40
|
+
}
|
|
41
|
+
async follow(options, run) {
|
|
42
|
+
const runners = new runners_api_1.RunnersApi(this.api, this.config, options.org);
|
|
43
|
+
await runners.followLogs(run.definition.groupId, run.jobId);
|
|
44
|
+
let job = await runners.getJob(run.definition.groupId, run.jobId);
|
|
45
|
+
for (let i = 0; i < 10 && !runners_api_1.TERMINAL.includes(job.status); i++) {
|
|
46
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
47
|
+
job = await runners.getJob(run.definition.groupId, run.jobId);
|
|
48
|
+
}
|
|
49
|
+
const ok = job.status === 'succeeded';
|
|
50
|
+
console.error(ok ? '\n✓ run succeeded' : `\n✗ run ${job.status}${job.error ? `: ${job.error.message}` : ''}`);
|
|
51
|
+
process.exit(ok ? 0 : 1);
|
|
52
|
+
}
|
|
53
|
+
printRuns(runs) {
|
|
54
|
+
this.output.table(['Run', 'Runbook', 'Status', 'Trigger', 'Requested'], runs.map((r) => [r.id, r.runbookName, statusOf(r), r.trigger, (0, runners_api_1.ago)(r.createdAt)]));
|
|
55
|
+
}
|
|
56
|
+
parseOrg(val) {
|
|
57
|
+
return val;
|
|
58
|
+
}
|
|
59
|
+
parseJson() {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, nest_commander_1.Option)({ flags: '--org <orgId>', description: 'Organization ID (defaults to the active one)' }),
|
|
65
|
+
__metadata("design:type", Function),
|
|
66
|
+
__metadata("design:paramtypes", [String]),
|
|
67
|
+
__metadata("design:returntype", void 0)
|
|
68
|
+
], RunbooksCommand.prototype, "parseOrg", null);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, nest_commander_1.Option)({ flags: '--json', description: 'Output as JSON' }),
|
|
71
|
+
__metadata("design:type", Function),
|
|
72
|
+
__metadata("design:paramtypes", []),
|
|
73
|
+
__metadata("design:returntype", void 0)
|
|
74
|
+
], RunbooksCommand.prototype, "parseJson", null);
|
|
75
|
+
RunbooksCommand = __decorate([
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
__metadata("design:paramtypes", [api_service_1.ApiService,
|
|
78
|
+
output_service_1.OutputService,
|
|
79
|
+
cli_config_service_1.CliConfigService])
|
|
80
|
+
], RunbooksCommand);
|
|
81
|
+
let RunbooksListCommand = class RunbooksListCommand extends RunbooksCommand {
|
|
82
|
+
async run(_args, options) {
|
|
83
|
+
try {
|
|
84
|
+
const runbooks = this.unwrap(await this.api.get(this.base(options)));
|
|
85
|
+
if (options.json)
|
|
86
|
+
return this.output.json(runbooks);
|
|
87
|
+
this.output.table(['ID', 'Name', 'Inputs', 'Schedule', 'Approval'], runbooks.map((r) => [
|
|
88
|
+
r.id,
|
|
89
|
+
r.name,
|
|
90
|
+
r.inputs.map((i) => `${i.name}${i.required ? '*' : ''}`).join(' ') || '—',
|
|
91
|
+
r.scheduleEnabled ? r.schedule : 'manual',
|
|
92
|
+
r.requiresApproval ? 'required' : '—',
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
this.output.error(err.message);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
exports.RunbooksListCommand = RunbooksListCommand;
|
|
101
|
+
exports.RunbooksListCommand = RunbooksListCommand = __decorate([
|
|
102
|
+
(0, nest_commander_1.SubCommand)({ name: 'list', description: 'List runbooks' })
|
|
103
|
+
], RunbooksListCommand);
|
|
104
|
+
let RunbooksRunCommand = class RunbooksRunCommand extends RunbooksCommand {
|
|
105
|
+
async run([runbookId], options) {
|
|
106
|
+
let run;
|
|
107
|
+
try {
|
|
108
|
+
const runbook = this.unwrap(await this.api.get(`${this.base(options)}/${runbookId}`));
|
|
109
|
+
const inputs = {};
|
|
110
|
+
for (const pair of options.input ?? []) {
|
|
111
|
+
const at = pair.indexOf('=');
|
|
112
|
+
if (at < 1)
|
|
113
|
+
return this.output.error(`--input expects name=value, got "${pair}"`);
|
|
114
|
+
inputs[pair.slice(0, at)] = pair.slice(at + 1);
|
|
115
|
+
}
|
|
116
|
+
for (const def of runbook.inputs) {
|
|
117
|
+
if (def.type === 'secret' && def.required && inputs[def.name] === undefined) {
|
|
118
|
+
if (!process.stdin.isTTY)
|
|
119
|
+
return this.output.error(`Secret input "${def.name}" is required; run interactively to be prompted`);
|
|
120
|
+
inputs[def.name] = await (0, prompts_1.password)({ message: `${def.name}:`, mask: '•' });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
run = this.unwrap(await this.api.post(`${this.base(options)}/${runbookId}/runs`, { inputs }));
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
return this.output.error(err.message);
|
|
127
|
+
}
|
|
128
|
+
if (options.json && !options.follow)
|
|
129
|
+
return this.output.json(run);
|
|
130
|
+
if (run.status === 'awaiting_approval') {
|
|
131
|
+
this.output.success(`Run ${run.id} requested; it waits for someone else to approve it.`);
|
|
132
|
+
return this.output.info(`They can approve it with: workshop runbooks approve ${run.id}`);
|
|
133
|
+
}
|
|
134
|
+
if (!options.follow) {
|
|
135
|
+
return this.output.success(`Run ${run.id} started. Follow it with: workshop runners jobs logs ${run.definition.groupId} ${run.jobId}`);
|
|
136
|
+
}
|
|
137
|
+
await this.follow(options, run);
|
|
138
|
+
}
|
|
139
|
+
parseInput(val, previous = []) {
|
|
140
|
+
return [...previous, val];
|
|
141
|
+
}
|
|
142
|
+
parseFollow() {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
exports.RunbooksRunCommand = RunbooksRunCommand;
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, nest_commander_1.Option)({ flags: '-i, --input <name=value>', description: 'Input value (repeatable)' }),
|
|
149
|
+
__metadata("design:type", Function),
|
|
150
|
+
__metadata("design:paramtypes", [String, Array]),
|
|
151
|
+
__metadata("design:returntype", void 0)
|
|
152
|
+
], RunbooksRunCommand.prototype, "parseInput", null);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, nest_commander_1.Option)({ flags: '--follow', description: 'Stream the log and exit with the result (0 succeeded, 1 otherwise)' }),
|
|
155
|
+
__metadata("design:type", Function),
|
|
156
|
+
__metadata("design:paramtypes", []),
|
|
157
|
+
__metadata("design:returntype", void 0)
|
|
158
|
+
], RunbooksRunCommand.prototype, "parseFollow", null);
|
|
159
|
+
exports.RunbooksRunCommand = RunbooksRunCommand = __decorate([
|
|
160
|
+
(0, nest_commander_1.SubCommand)({
|
|
161
|
+
name: 'run',
|
|
162
|
+
arguments: '<runbookId>',
|
|
163
|
+
description: 'Run a runbook: --input name=value (repeatable). Secret inputs not given are prompted for. --follow streams the log',
|
|
164
|
+
})
|
|
165
|
+
], RunbooksRunCommand);
|
|
166
|
+
let RunbooksRunsCommand = class RunbooksRunsCommand extends RunbooksCommand {
|
|
167
|
+
async run([runbookId], options) {
|
|
168
|
+
try {
|
|
169
|
+
const url = runbookId ? `${this.base(options)}/${runbookId}/runs` : `${this.base(options)}/runs`;
|
|
170
|
+
const runs = this.unwrap(await this.api.get(url, !runbookId && options.status ? { status: options.status } : undefined));
|
|
171
|
+
if (options.json)
|
|
172
|
+
return this.output.json(runs);
|
|
173
|
+
this.printRuns(runs);
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
this.output.error(err.message);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
parseStatus(val) {
|
|
180
|
+
return val;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
exports.RunbooksRunsCommand = RunbooksRunsCommand;
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, nest_commander_1.Option)({ flags: '--status <list>', description: 'Comma-separated, e.g. awaiting_approval' }),
|
|
186
|
+
__metadata("design:type", Function),
|
|
187
|
+
__metadata("design:paramtypes", [String]),
|
|
188
|
+
__metadata("design:returntype", void 0)
|
|
189
|
+
], RunbooksRunsCommand.prototype, "parseStatus", null);
|
|
190
|
+
exports.RunbooksRunsCommand = RunbooksRunsCommand = __decorate([
|
|
191
|
+
(0, nest_commander_1.SubCommand)({ name: 'runs', arguments: '[runbookId]', description: 'Recent runs (of one runbook, or all); --status awaiting_approval' })
|
|
192
|
+
], RunbooksRunsCommand);
|
|
193
|
+
class DecideCommand extends RunbooksCommand {
|
|
194
|
+
async run([runId], options) {
|
|
195
|
+
try {
|
|
196
|
+
const run = this.unwrap(await this.api.post(`${this.base(options)}/runs/${runId}/${this.action}`, options.reason ? { reason: options.reason } : {}));
|
|
197
|
+
if (options.json)
|
|
198
|
+
return this.output.json(run);
|
|
199
|
+
this.output.success(this.action === 'approve' ? `Approved; run ${run.id} is starting.` : `Rejected run ${run.id}.`);
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
this.output.error(err.message);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
parseReason(val) {
|
|
206
|
+
return val;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
__decorate([
|
|
210
|
+
(0, nest_commander_1.Option)({ flags: '--reason <text>', description: 'Why (kept with the decision)' }),
|
|
211
|
+
__metadata("design:type", Function),
|
|
212
|
+
__metadata("design:paramtypes", [String]),
|
|
213
|
+
__metadata("design:returntype", void 0)
|
|
214
|
+
], DecideCommand.prototype, "parseReason", null);
|
|
215
|
+
let RunbooksApproveCommand = class RunbooksApproveCommand extends DecideCommand {
|
|
216
|
+
constructor() {
|
|
217
|
+
super(...arguments);
|
|
218
|
+
this.action = 'approve';
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
exports.RunbooksApproveCommand = RunbooksApproveCommand;
|
|
222
|
+
exports.RunbooksApproveCommand = RunbooksApproveCommand = __decorate([
|
|
223
|
+
(0, nest_commander_1.SubCommand)({ name: 'approve', arguments: '<runId>', description: "Approve a run awaiting approval (not your own)" })
|
|
224
|
+
], RunbooksApproveCommand);
|
|
225
|
+
let RunbooksRejectCommand = class RunbooksRejectCommand extends DecideCommand {
|
|
226
|
+
constructor() {
|
|
227
|
+
super(...arguments);
|
|
228
|
+
this.action = 'reject';
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
exports.RunbooksRejectCommand = RunbooksRejectCommand;
|
|
232
|
+
exports.RunbooksRejectCommand = RunbooksRejectCommand = __decorate([
|
|
233
|
+
(0, nest_commander_1.SubCommand)({ name: 'reject', arguments: '<runId>', description: 'Reject a run awaiting approval' })
|
|
234
|
+
], RunbooksRejectCommand);
|
|
235
|
+
let RunbooksRootCommand = class RunbooksRootCommand extends nest_commander_1.CommandRunner {
|
|
236
|
+
async run() {
|
|
237
|
+
console.log('Usage: workshop runbooks <subcommand>\n');
|
|
238
|
+
console.log(' list List runbooks');
|
|
239
|
+
console.log(' run <id> -i name=value [--follow] Run one (secrets are prompted for)');
|
|
240
|
+
console.log(' runs [<id>] [--status <s>] Recent runs');
|
|
241
|
+
console.log(' approve <runId> | reject <runId> Decide a run awaiting approval');
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
exports.RunbooksRootCommand = RunbooksRootCommand;
|
|
245
|
+
exports.RunbooksRootCommand = RunbooksRootCommand = __decorate([
|
|
246
|
+
(0, nest_commander_1.Command)({
|
|
247
|
+
name: 'runbooks',
|
|
248
|
+
description: 'Saved operations that run on your runner groups',
|
|
249
|
+
subCommands: [RunbooksListCommand, RunbooksRunCommand, RunbooksRunsCommand, RunbooksApproveCommand, RunbooksRejectCommand],
|
|
250
|
+
})
|
|
251
|
+
], RunbooksRootCommand);
|
|
252
|
+
let RunbooksModule = class RunbooksModule {
|
|
253
|
+
};
|
|
254
|
+
exports.RunbooksModule = RunbooksModule;
|
|
255
|
+
exports.RunbooksModule = RunbooksModule = __decorate([
|
|
256
|
+
(0, common_1.Module)({
|
|
257
|
+
providers: [
|
|
258
|
+
RunbooksRootCommand,
|
|
259
|
+
RunbooksListCommand,
|
|
260
|
+
RunbooksRunCommand,
|
|
261
|
+
RunbooksRunsCommand,
|
|
262
|
+
RunbooksApproveCommand,
|
|
263
|
+
RunbooksRejectCommand,
|
|
264
|
+
],
|
|
265
|
+
})
|
|
266
|
+
], RunbooksModule);
|
|
267
|
+
function statusOf(run) {
|
|
268
|
+
if (run.status !== 'started')
|
|
269
|
+
return run.status.replace('_', ' ');
|
|
270
|
+
return run.job?.status ?? 'queued';
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=runbooks.commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runbooks.commands.js","sourceRoot":"","sources":["../../src/runbooks/runbooks.commands.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAoD;AACpD,mDAA4E;AAC5E,+CAA6C;AAC7C,2DAAuD;AACvD,oEAAgE;AAChE,4EAAuE;AACvE,wDAAmE;AAyCnE,IACe,eAAe,GAD9B,MACe,eAAgB,SAAQ,8BAAa;IAClD,YACqB,GAAe,EACf,MAAqB,EACrB,MAAwB;QAE3C,KAAK,EAAE,CAAC;QAJW,QAAG,GAAH,GAAG,CAAY;QACf,WAAM,GAAN,MAAM,CAAe;QACrB,WAAM,GAAN,MAAM,CAAkB;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,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,iDAAiD;QAC9D,WAAW,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;KAC3H,CAAC;GACW,mBAAmB,CAQ/B;AAYM,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAV1B,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,mBAAmB;YACnB,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,sBAAsB;YACtB,qBAAqB;SACtB;KACF,CAAC;GACW,cAAc,CAAG;AAE9B,SAAS,QAAQ,CAAC,GAAQ;IACxB,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClE,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,IAAI,QAAQ,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { ApiService } from '../../common/api/api.service';
|
|
3
|
+
import { OutputService } from '../../common/output/output.service';
|
|
4
|
+
import { CliConfigService } from '../../common/config/cli-config.service';
|
|
5
|
+
import { RunnersApi } from '../runners-api';
|
|
6
|
+
interface CommonOptions {
|
|
7
|
+
org?: string;
|
|
8
|
+
json?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare abstract class RunnersCommand extends CommandRunner {
|
|
11
|
+
protected readonly api: ApiService;
|
|
12
|
+
protected readonly output: OutputService;
|
|
13
|
+
protected readonly config: CliConfigService;
|
|
14
|
+
constructor(api: ApiService, output: OutputService, config: CliConfigService);
|
|
15
|
+
protected client(options: CommonOptions): RunnersApi;
|
|
16
|
+
parseOrg(val: string): string;
|
|
17
|
+
parseJson(): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class GroupsListCommand extends RunnersCommand {
|
|
20
|
+
run(_args: string[], options: CommonOptions): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
interface GroupsCreateOptions extends CommonOptions {
|
|
23
|
+
description?: string;
|
|
24
|
+
maxConcurrency?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare class GroupsCreateCommand extends RunnersCommand {
|
|
27
|
+
run([name]: string[], options: GroupsCreateOptions): Promise<void>;
|
|
28
|
+
parseDescription(val: string): string;
|
|
29
|
+
parseMax(val: string): number;
|
|
30
|
+
}
|
|
31
|
+
export declare class GroupsDeleteCommand extends RunnersCommand {
|
|
32
|
+
run([groupId]: string[], options: CommonOptions): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export declare class GroupsSetDefaultCommand extends RunnersCommand {
|
|
35
|
+
run([groupId]: string[], options: CommonOptions): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
interface GroupsUpdateOptions extends CommonOptions {
|
|
38
|
+
name?: string;
|
|
39
|
+
hosted?: boolean;
|
|
40
|
+
maxConcurrency?: number;
|
|
41
|
+
}
|
|
42
|
+
export declare class GroupsUpdateCommand extends RunnersCommand {
|
|
43
|
+
run([groupId]: string[], options: GroupsUpdateOptions): Promise<void>;
|
|
44
|
+
parseName(val: string): string;
|
|
45
|
+
parseHosted(): boolean;
|
|
46
|
+
parseNoHosted(): boolean;
|
|
47
|
+
parseMax(val: string): number;
|
|
48
|
+
}
|
|
49
|
+
export declare class GroupsCommand extends CommandRunner {
|
|
50
|
+
run(): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export declare class RunnersListCommand extends RunnersCommand {
|
|
53
|
+
run([groupId]: string[], options: CommonOptions): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
export { RunnersCommand };
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RunnersCommand = exports.RunnersListCommand = exports.GroupsCommand = exports.GroupsUpdateCommand = exports.GroupsSetDefaultCommand = exports.GroupsDeleteCommand = exports.GroupsCreateCommand = exports.GroupsListCommand = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const nest_commander_1 = require("nest-commander");
|
|
15
|
+
const api_service_1 = require("../../common/api/api.service");
|
|
16
|
+
const output_service_1 = require("../../common/output/output.service");
|
|
17
|
+
const cli_config_service_1 = require("../../common/config/cli-config.service");
|
|
18
|
+
const runners_api_1 = require("../runners-api");
|
|
19
|
+
let RunnersCommand = class RunnersCommand extends nest_commander_1.CommandRunner {
|
|
20
|
+
constructor(api, output, config) {
|
|
21
|
+
super();
|
|
22
|
+
this.api = api;
|
|
23
|
+
this.output = output;
|
|
24
|
+
this.config = config;
|
|
25
|
+
}
|
|
26
|
+
client(options) {
|
|
27
|
+
return new runners_api_1.RunnersApi(this.api, this.config, options.org);
|
|
28
|
+
}
|
|
29
|
+
parseOrg(val) {
|
|
30
|
+
return val;
|
|
31
|
+
}
|
|
32
|
+
parseJson() {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.RunnersCommand = RunnersCommand;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, nest_commander_1.Option)({ flags: '--org <orgId>', description: 'Organization ID (defaults to the active one)' }),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", [String]),
|
|
41
|
+
__metadata("design:returntype", void 0)
|
|
42
|
+
], RunnersCommand.prototype, "parseOrg", null);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, nest_commander_1.Option)({ flags: '--json', description: 'Output as JSON' }),
|
|
45
|
+
__metadata("design:type", Function),
|
|
46
|
+
__metadata("design:paramtypes", []),
|
|
47
|
+
__metadata("design:returntype", void 0)
|
|
48
|
+
], RunnersCommand.prototype, "parseJson", null);
|
|
49
|
+
exports.RunnersCommand = RunnersCommand = __decorate([
|
|
50
|
+
(0, common_1.Injectable)(),
|
|
51
|
+
__metadata("design:paramtypes", [api_service_1.ApiService,
|
|
52
|
+
output_service_1.OutputService,
|
|
53
|
+
cli_config_service_1.CliConfigService])
|
|
54
|
+
], RunnersCommand);
|
|
55
|
+
let GroupsListCommand = class GroupsListCommand extends RunnersCommand {
|
|
56
|
+
async run(_args, options) {
|
|
57
|
+
try {
|
|
58
|
+
const groups = await this.client(options).listGroups();
|
|
59
|
+
if (options.json)
|
|
60
|
+
return this.output.json(groups);
|
|
61
|
+
this.output.table(['ID', 'Name', 'Default', 'Hosted', 'Runners online', 'Concurrency', 'Status'], groups.map((p) => [
|
|
62
|
+
p.id,
|
|
63
|
+
p.name,
|
|
64
|
+
p.isDefault ? 'yes' : '',
|
|
65
|
+
p.useHostedRunners ? 'yes' : 'no',
|
|
66
|
+
`${p.onlineRunnerCount ?? 0} / ${p.runnerCount ?? 0}`,
|
|
67
|
+
p.maxConcurrency > 0 ? `max ${p.maxConcurrency}` : 'per runner',
|
|
68
|
+
p.enabled ? 'enabled' : 'disabled',
|
|
69
|
+
]));
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
this.output.error(err.message);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.GroupsListCommand = GroupsListCommand;
|
|
77
|
+
exports.GroupsListCommand = GroupsListCommand = __decorate([
|
|
78
|
+
(0, nest_commander_1.SubCommand)({ name: 'list', description: 'List runner groups' })
|
|
79
|
+
], GroupsListCommand);
|
|
80
|
+
let GroupsCreateCommand = class GroupsCreateCommand extends RunnersCommand {
|
|
81
|
+
async run([name], options) {
|
|
82
|
+
try {
|
|
83
|
+
const group = await this.client(options).createGroup({
|
|
84
|
+
name,
|
|
85
|
+
description: options.description,
|
|
86
|
+
maxConcurrency: options.maxConcurrency,
|
|
87
|
+
});
|
|
88
|
+
if (options.json)
|
|
89
|
+
return this.output.json(group);
|
|
90
|
+
this.output.success(`Created runner group ${group.name} (${group.id})`);
|
|
91
|
+
this.output.info(`Install a runner into a cluster with: workshop runners install ${group.id}`);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
this.output.error(err.message);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
parseDescription(val) {
|
|
98
|
+
return val;
|
|
99
|
+
}
|
|
100
|
+
parseMax(val) {
|
|
101
|
+
return parseInt(val, 10);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
exports.GroupsCreateCommand = GroupsCreateCommand;
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, nest_commander_1.Option)({ flags: '--description <text>', description: 'Group description' }),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [String]),
|
|
109
|
+
__metadata("design:returntype", void 0)
|
|
110
|
+
], GroupsCreateCommand.prototype, "parseDescription", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, nest_commander_1.Option)({ flags: '--max-concurrency <n>', description: 'Most jobs at once across the group (0 = no limit)' }),
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", [String]),
|
|
115
|
+
__metadata("design:returntype", void 0)
|
|
116
|
+
], GroupsCreateCommand.prototype, "parseMax", null);
|
|
117
|
+
exports.GroupsCreateCommand = GroupsCreateCommand = __decorate([
|
|
118
|
+
(0, nest_commander_1.SubCommand)({ name: 'create', arguments: '<name>', description: 'Create a runner group' })
|
|
119
|
+
], GroupsCreateCommand);
|
|
120
|
+
let GroupsDeleteCommand = class GroupsDeleteCommand extends RunnersCommand {
|
|
121
|
+
async run([groupId], options) {
|
|
122
|
+
try {
|
|
123
|
+
await this.client(options).deleteGroup(groupId);
|
|
124
|
+
this.output.success('Runner group deleted. Remove its runners from their clusters with: helm uninstall workshop-runner -n workshop-runner && kubectl -n workshop-runner delete secret workshop-runner-credentials');
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
this.output.error(err.message);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
exports.GroupsDeleteCommand = GroupsDeleteCommand;
|
|
132
|
+
exports.GroupsDeleteCommand = GroupsDeleteCommand = __decorate([
|
|
133
|
+
(0, nest_commander_1.SubCommand)({ name: 'delete', arguments: '<groupId>', description: 'Delete a runner group' })
|
|
134
|
+
], GroupsDeleteCommand);
|
|
135
|
+
let GroupsSetDefaultCommand = class GroupsSetDefaultCommand extends RunnersCommand {
|
|
136
|
+
async run([groupId], options) {
|
|
137
|
+
try {
|
|
138
|
+
const group = await this.client(options).setDefault(groupId);
|
|
139
|
+
if (options.json)
|
|
140
|
+
return this.output.json(group);
|
|
141
|
+
this.output.success(`${group.name} is now the default runner group.`);
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
this.output.error(err.message);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
exports.GroupsSetDefaultCommand = GroupsSetDefaultCommand;
|
|
149
|
+
exports.GroupsSetDefaultCommand = GroupsSetDefaultCommand = __decorate([
|
|
150
|
+
(0, nest_commander_1.SubCommand)({
|
|
151
|
+
name: 'set-default',
|
|
152
|
+
arguments: '<groupId>',
|
|
153
|
+
description: 'Run work on this group when none is chosen',
|
|
154
|
+
})
|
|
155
|
+
], GroupsSetDefaultCommand);
|
|
156
|
+
let GroupsUpdateCommand = class GroupsUpdateCommand extends RunnersCommand {
|
|
157
|
+
async run([groupId], options) {
|
|
158
|
+
const input = {
|
|
159
|
+
...(options.name !== undefined ? { name: options.name } : {}),
|
|
160
|
+
...(options.hosted !== undefined ? { useHostedRunners: options.hosted } : {}),
|
|
161
|
+
...(options.maxConcurrency !== undefined ? { maxConcurrency: options.maxConcurrency } : {}),
|
|
162
|
+
};
|
|
163
|
+
if (Object.keys(input).length === 0) {
|
|
164
|
+
return this.output.error('Nothing to change. Pass --name, --hosted, --no-hosted or --max-concurrency.');
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
const group = await this.client(options).updateGroup(groupId, input);
|
|
168
|
+
if (options.json)
|
|
169
|
+
return this.output.json(group);
|
|
170
|
+
this.output.success(`Updated ${group.name}.`);
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
this.output.error(err.message);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
parseName(val) {
|
|
177
|
+
return val;
|
|
178
|
+
}
|
|
179
|
+
parseHosted() {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
parseNoHosted() {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
parseMax(val) {
|
|
186
|
+
return parseInt(val, 10);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
exports.GroupsUpdateCommand = GroupsUpdateCommand;
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, nest_commander_1.Option)({ flags: '--name <name>', description: 'New name (not for the Default group)' }),
|
|
192
|
+
__metadata("design:type", Function),
|
|
193
|
+
__metadata("design:paramtypes", [String]),
|
|
194
|
+
__metadata("design:returntype", void 0)
|
|
195
|
+
], GroupsUpdateCommand.prototype, "parseName", null);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, nest_commander_1.Option)({ flags: '--hosted', description: "Also run this group's jobs on Workshop-hosted runners" }),
|
|
198
|
+
__metadata("design:type", Function),
|
|
199
|
+
__metadata("design:paramtypes", []),
|
|
200
|
+
__metadata("design:returntype", void 0)
|
|
201
|
+
], GroupsUpdateCommand.prototype, "parseHosted", null);
|
|
202
|
+
__decorate([
|
|
203
|
+
(0, nest_commander_1.Option)({ flags: '--no-hosted', description: 'Run only on your own runners' }),
|
|
204
|
+
__metadata("design:type", Function),
|
|
205
|
+
__metadata("design:paramtypes", []),
|
|
206
|
+
__metadata("design:returntype", void 0)
|
|
207
|
+
], GroupsUpdateCommand.prototype, "parseNoHosted", null);
|
|
208
|
+
__decorate([
|
|
209
|
+
(0, nest_commander_1.Option)({ flags: '--max-concurrency <n>', description: 'Most jobs at once across the group (0 = no limit)' }),
|
|
210
|
+
__metadata("design:type", Function),
|
|
211
|
+
__metadata("design:paramtypes", [String]),
|
|
212
|
+
__metadata("design:returntype", void 0)
|
|
213
|
+
], GroupsUpdateCommand.prototype, "parseMax", null);
|
|
214
|
+
exports.GroupsUpdateCommand = GroupsUpdateCommand = __decorate([
|
|
215
|
+
(0, nest_commander_1.SubCommand)({ name: 'update', arguments: '<groupId>', description: 'Update a runner group' })
|
|
216
|
+
], GroupsUpdateCommand);
|
|
217
|
+
let GroupsCommand = class GroupsCommand extends nest_commander_1.CommandRunner {
|
|
218
|
+
async run() {
|
|
219
|
+
console.log('Usage: workshop runners groups <subcommand>\n');
|
|
220
|
+
console.log(' list List runner groups');
|
|
221
|
+
console.log(' create <name> Create a runner group');
|
|
222
|
+
console.log(' delete <groupId> Delete a runner group');
|
|
223
|
+
console.log(' set-default <groupId> Run work on this group when none is chosen');
|
|
224
|
+
console.log(' update <groupId> [--hosted|--no-hosted] [--name] [--max-concurrency]');
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
exports.GroupsCommand = GroupsCommand;
|
|
228
|
+
exports.GroupsCommand = GroupsCommand = __decorate([
|
|
229
|
+
(0, nest_commander_1.SubCommand)({
|
|
230
|
+
name: 'groups',
|
|
231
|
+
description: 'Manage runner groups',
|
|
232
|
+
subCommands: [GroupsListCommand, GroupsCreateCommand, GroupsDeleteCommand, GroupsSetDefaultCommand, GroupsUpdateCommand],
|
|
233
|
+
})
|
|
234
|
+
], GroupsCommand);
|
|
235
|
+
let RunnersListCommand = class RunnersListCommand extends RunnersCommand {
|
|
236
|
+
async run([groupId], options) {
|
|
237
|
+
try {
|
|
238
|
+
const runners = await this.client(options).listRunners(groupId);
|
|
239
|
+
if (options.json)
|
|
240
|
+
return this.output.json(runners);
|
|
241
|
+
this.output.table(['ID', 'Name', 'Status', 'Jobs', 'Profiles', 'Version', 'Last seen'], runners.map((r) => [
|
|
242
|
+
r.id,
|
|
243
|
+
r.name,
|
|
244
|
+
r.status,
|
|
245
|
+
`${r.runningJobs} / ${r.capacity}`,
|
|
246
|
+
r.serviceAccountProfiles.join(','),
|
|
247
|
+
r.version,
|
|
248
|
+
(0, runners_api_1.ago)(r.lastHeartbeatAt),
|
|
249
|
+
]));
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
this.output.error(err.message);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
exports.RunnersListCommand = RunnersListCommand;
|
|
257
|
+
exports.RunnersListCommand = RunnersListCommand = __decorate([
|
|
258
|
+
(0, nest_commander_1.SubCommand)({ name: 'list', arguments: '<groupId>', description: 'List the runners in a group' })
|
|
259
|
+
], RunnersListCommand);
|
|
260
|
+
//# sourceMappingURL=groups.commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups.commands.js","sourceRoot":"","sources":["../../../src/runners/commands/groups.commands.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mDAAmE;AACnE,8DAA0D;AAC1D,uEAAmE;AACnE,+EAA0E;AAC1E,gDAAiD;AAQjD,IACe,cAAc,GAD7B,MACe,cAAe,SAAQ,8BAAa;IACjD,YACqB,GAAe,EACf,MAAqB,EACrB,MAA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CAAC,GAAG,CAAC,CAAC,OAAO,CAAW,EAAE,OAAsB;QACnD,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAChE,IAAI,OAAO,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,EACpE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBACjB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,MAAM;gBACR,GAAG,CAAC,CAAC,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAE;gBAClC,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC;gBAClC,CAAC,CAAC,OAAO;gBACT,IAAA,iBAAG,EAAC,CAAC,CAAC,eAAe,CAAC;aACvB,CAAC,CACH,CAAC;QACJ,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CACF,CAAA;AArBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,2BAAU,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GACpF,kBAAkB,CAqB9B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { RunnersCommand } from './groups.commands';
|
|
3
|
+
interface TokenOptions {
|
|
4
|
+
org?: string;
|
|
5
|
+
json?: boolean;
|
|
6
|
+
description?: string;
|
|
7
|
+
expiresHours?: number;
|
|
8
|
+
unlimited?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class TokenCreateCommand extends RunnersCommand {
|
|
11
|
+
run([groupId]: string[], options: TokenOptions): Promise<void>;
|
|
12
|
+
parseDescription(val: string): string;
|
|
13
|
+
parseExpires(val: string): number;
|
|
14
|
+
parseUnlimited(): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class RunnerTokenCommand extends CommandRunner {
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
interface InstallOptions {
|
|
20
|
+
org?: string;
|
|
21
|
+
json?: boolean;
|
|
22
|
+
namespace?: string;
|
|
23
|
+
release?: string;
|
|
24
|
+
capacity?: number;
|
|
25
|
+
values?: string;
|
|
26
|
+
print?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare class RunnerInstallCommand extends RunnersCommand {
|
|
29
|
+
run([groupId]: string[], options: InstallOptions): Promise<void>;
|
|
30
|
+
parseNamespace(val: string): string;
|
|
31
|
+
parseRelease(val: string): string;
|
|
32
|
+
parseCapacity(val: string): number;
|
|
33
|
+
parseValues(val: string): string;
|
|
34
|
+
parsePrint(): boolean;
|
|
35
|
+
}
|
|
36
|
+
export {};
|