UNPKG

@catladder/cli

Version:

Panter cli tool for cloud CI/CD and DevOps

56 lines 2.79 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.KUBERNETES_DEPLOY_TYPE = void 0; const slugify_1 = __importDefault(require("slugify")); const __1 = require(".."); const BashExpression_1 = require("../../bash/BashExpression"); const additionalSecretKeys_1 = require("./additionalSecretKeys"); const deployJob_1 = require("./deployJob"); __exportStar(require("./cloudSql"), exports); exports.KUBERNETES_DEPLOY_TYPE = { jobs: deployJob_1.createKubernetesDeployJobs, defaults: () => ({}), additionalSecretKeys: additionalSecretKeys_1.additionalKubernetesSecretKeys, getAdditionalEnvVars: ({ componentName, fullConfig, deployConfigRaw, env, reviewSlug, envType, }) => { var _a; const KUBE_APP_NAME_PREFIX = envType === "review" && reviewSlug ? reviewSlug.concat("-") : ""; const KUBE_APP_NAME = KUBE_APP_NAME_PREFIX.concat(componentName); const KUBE_NAMESPACE = (0, __1.getKubernetesNamespace)(fullConfig, env); const componentSlug = (0, slugify_1.default)(componentName); const domainCanonical = (deployConfigRaw && ((_a = deployConfigRaw.cluster) === null || _a === void 0 ? void 0 : _a.domainCanonical)) || // for convenience, we allow clusters to define a canonical domain, because a cluster has a fixed ip and you will usually have a domain pointing to that cluster fullConfig.domainCanonical || "panter.cloud"; const HOSTNAME_INTERNAL = (0, BashExpression_1.joinBashExpressions)([ componentSlug, ...(envType === "review" && reviewSlug ? [reviewSlug] : []), env, fullConfig.appName, fullConfig.customerName, domainCanonical, ], "."); // default for kubernetes and rest return { KUBE_NAMESPACE, KUBE_APP_NAME, KUBE_APP_NAME_PREFIX, HOSTNAME_INTERNAL, }; }, }; //# sourceMappingURL=index.js.map