@veecode-platform/safira-cli
Version:
Generate a microservice project from your spec.
39 lines (38 loc) • 1.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
const safira_base_command_1 = require("../../../command-base/safira-base-command");
const operation_1 = require("../../../configmap/operation");
const color_1 = tslib_1.__importDefault(require("@oclif/color"));
const commands_1 = require("../../../kubectl/commands");
class ProjectConfigmapApply extends safira_base_command_1.SafiraBaseCommand {
async run() {
const { args, flags } = await this.parse(safira_base_command_1.SafiraBaseCommand);
const configFileList = operation_1.ConfigMapOperation.instance.list(false);
const answers = await inquirer_1.default.prompt([
{
when: configFileList.length > 0,
type: "list",
name: "configmap",
message: "Select k8s configmap",
choices: configFileList,
},
]);
const fullPath = operation_1.ConfigMapOperation.instance.findByFileName(answers.configmap);
try {
commands_1.KubernetesApply.instance.command([fullPath]);
}
catch (error) {
this.error(color_1.default.red(error.message));
}
}
}
exports.default = ProjectConfigmapApply;
ProjectConfigmapApply.hidden = true;
ProjectConfigmapApply.description = "Apply configmap to you k8s cluster";
ProjectConfigmapApply.examples = [
"<%= config.bin %> <%= command.id %>",
];
ProjectConfigmapApply.flags = {};
ProjectConfigmapApply.args = [];