UNPKG

@veecode-platform/safira-cli

Version:

Generate a microservice project from your spec.

60 lines (59 loc) 2.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const core_1 = require("@oclif/core"); const inquirer_1 = tslib_1.__importDefault(require("inquirer")); const color_1 = tslib_1.__importDefault(require("@oclif/color")); const argocd_operations_1 = require("../../vkpr/argocd-operations"); const constants_1 = require("../../utils/commands/constants"); class ArgocdInstall extends core_1.Command { async run() { const { args, flags } = await this.parse(ArgocdInstall); const answers = await inquirer_1.default.prompt([ { type: "input", name: "domain", message: "Type the Argo domain", default: "localhost", }, { type: "list", name: "secure", message: "Secure?", choices: constants_1.yesNoList, default: "yes", }, { type: "list", name: "HA", message: "High Availability instance?", choices: constants_1.yesNoList, default: "no", }, ]); try { argocd_operations_1.ArgoOperations.instance.installArgo({ HA: (flags.HA || answers.HA) === "yes", default: flags.default === "yes", domain: flags.domain || answers.domain, secure: (flags.secure || answers.secure) === "yes", verbose: flags.verbose === "yes", }); } catch (error) { this.log(color_1.default.red(error.message)); } } } exports.default = ArgocdInstall; ArgocdInstall.hidden = true; ArgocdInstall.description = "Install the ArgoCD in the Kubernetes cluster"; ArgocdInstall.flags = { help: core_1.Flags.help({ char: "h" }), HA: core_1.Flags.string({ description: "High Availability instance", options: constants_1.yesNoList }), default: core_1.Flags.string({ description: "Use to automatically fill inputs with default value provided on config.json", options: constants_1.yesNoList }), domain: core_1.Flags.string({ description: "Domain", default: "localhost" }), secure: core_1.Flags.string({ description: "Secure", options: constants_1.yesNoList }), verbose: core_1.Flags.string({ char: "a", description: "Verbose mode (All). Indicate to a formula that it should show log messages in more detail", options: constants_1.yesNoList }), }; ArgocdInstall.args = [];