UNPKG

@catladder/pipeline

Version:

Panter workflow for cloud CI/CD and DevOps

32 lines (31 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.contextIsStoppable = exports.getKubernetesNamespace = exports.getFullKubernetesClusterName = void 0; var types_1 = require("./types"); var getFullKubernetesClusterName = function (cluster) { if (cluster.type === "gcloud") { return "gke_".concat(cluster.projectId, "_").concat(cluster.region, "_").concat(cluster.name); } }; exports.getFullKubernetesClusterName = getFullKubernetesClusterName; var getKubernetesNamespace = function (config, env) { return "".concat(config.customerName, "-").concat(config.appName, "-").concat(env); }; exports.getKubernetesNamespace = getKubernetesNamespace; var contextIsStoppable = function (context) { var _a; var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config; if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) { return true; } if ((0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) { return true; } if ((0, types_1.isOfDeployType)(deployConfig, "custom") && deployConfig.stopScript) { return true; } return false; }; exports.contextIsStoppable = contextIsStoppable;