@veecode-platform/safira-cli
Version:
Generate a microservice project from your spec.
29 lines (28 loc) • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArgoOperations = void 0;
const tslib_1 = require("tslib");
const properties = tslib_1.__importStar(require("../properties.json"));
const child_process_1 = require("child_process");
class ArgoOperations {
constructor() { }
removeArgo(verbose) {
console.debug(`${properties.vkpr.command} argocd remove`);
const argoRemove = (0, child_process_1.exec)(`${properties.vkpr.command} argocd remove`);
argoRemove.stdout?.on("data", result => console.log(result));
}
installArgo(params) {
process.env.VKPR_ENV_ARGOCD_INGRESS_CLASS_NAME = "kong";
const commandParams = Object.keys(params).filter(key => typeof params[key] === "boolean" || Boolean(params[key])).map(key => `--${key}=${params[key]}`).join(" ");
console.debug(`${properties.vkpr.command} argocd install ${commandParams}`);
const argoInstall = (0, child_process_1.exec)(`${properties.vkpr.command} argocd install ${commandParams}`);
argoInstall.stdout?.on("data", result => console.log(result));
}
static get instance() {
if (!this._instance) {
this._instance = new this();
}
return this._instance;
}
}
exports.ArgoOperations = ArgoOperations;