@enspirit/emb
Version:
A replacement for our Makefile-for-monorepos
23 lines (22 loc) • 849 B
JavaScript
import { Args } from '@oclif/core';
import { getContext, KubernetesCommand } from '../../index.js';
import { PodsRestartOperation } from '../../../kubernetes/index.js';
export default class KRestartCommand extends KubernetesCommand {
static description = 'Restart pods of an instance.';
static examples = ['<%= config.bin %> <%= command.id %>'];
static args = {
deployment: Args.string({
name: 'deployment',
description: 'The deployment(s) to restart',
}),
};
static strict = false;
async run() {
const { flags, argv } = await this.parse(KRestartCommand);
const { monorepo } = getContext();
await monorepo.run(new PodsRestartOperation(), {
namespace: flags.namespace,
deployments: argv.length > 0 ? argv : undefined,
});
}
}