@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
80 lines (79 loc) • 2.45 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.execTakeDown = exports.takedownEnvironment = exports.takedownApp = exports.takedownProject = void 0;
const log_1 = require("diginext-utils/dist/xconsole/log");
const yargs_1 = __importDefault(require("yargs"));
/**
* Take down the whole project & all of its apps
* @example
* dx down project
* @param {InputOptions} options
*/
const takedownProject = async (options) => {
// TODO: Implement take down an app from a cluster
};
exports.takedownProject = takedownProject;
/**
* Take down the whole app & all of its environments
* @example
* dx down app
* dx down app <app-slug>
* @param {InputOptions} options
*/
const takedownApp = async (options) => {
// TODO: Implement take down an app from a cluster
};
exports.takedownApp = takedownApp;
/**
* Take down the whole app & all of its environments
* @example
* dx down
* dx down --prod
* dx down --env=canary
* @param {InputOptions} options
*/
const takedownEnvironment = async (options) => {
// TODO: Implement take down an app from a cluster
};
exports.takedownEnvironment = takedownEnvironment;
async function execTakeDown(options) {
// TODO: implement take down app deployment
const { secondAction, name, input } = options;
switch (secondAction) {
// take down the whole project & all of its apps
case "project":
try {
(0, log_1.logWarn)(`This feature is under development`);
}
catch (e) {
(0, log_1.logError)(e);
}
break;
// take down the whole app & all of its environments
case "app":
try {
(0, log_1.logWarn)(`This feature is under development`);
}
catch (e) {
(0, log_1.logError)(e);
}
break;
// take down a specific environment:
case undefined:
try {
(0, log_1.logWarn)(`This feature is under development`);
}
catch (e) {
(0, log_1.logError)(e);
}
break;
// show help
default:
yargs_1.default.showHelp();
break;
}
}
exports.execTakeDown = execTakeDown;