@veecode-platform/safira-cli
Version:
Generate a microservice project from your spec.
39 lines (38 loc) • 1.72 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.VkprKongOperations = void 0;
const tslib_1 = require("tslib");
const child_process_1 = require("child_process");
const properties = tslib_1.__importStar(require("../properties.json"));
const install_vkpr_1 = require("./install-vkpr");
const command_execute_1 = require("../command/command-execute");
class VkprKongOperations {
async deploy(options) {
const flags = ["--dry_run=false"];
if (options.domain)
flags.push(`--domain=${options.domain}`);
if (options.secure)
flags.push(`--secure=${options.secure}`);
if (options.mode)
flags.push(`--kong_mode=${options.mode}`);
if (options.license)
flags.push(`--license=${options.license}`);
if (options.HA)
flags.push(`--HA=${options.HA}`);
if (options.rbacPassword)
flags.push(`--rbac_password=${options.rbacPassword}`);
if (options.kongPlane)
flags.push(`--kong_plane=${options.kongPlane}`);
if (options.kongTelemetryUrl)
flags.push(`--kong_telemetry_url=${options.kongTelemetryUrl}`);
if (options.kongCpUrl)
flags.push(`--kong_cp_url=${options.kongCpUrl}`);
await install_vkpr_1.InstallVkpr.instance.install();
await command_execute_1.CommandExecute.instance.runInteractive(`${properties.vkpr.command} kong install ${flags.join(" ")}`);
}
remove() {
const kongInstall = (0, child_process_1.exec)(`${properties.vkpr.command} kong remove`);
kongInstall.stdout?.on("data", result => console.log(result));
}
}
exports.VkprKongOperations = VkprKongOperations;