@catladder/cli 0.0.0-main-582c181c → 0.0.0-main-39609fd6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js +1 -2
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -1
- package/dist/bundles/catenv/index.js +257 -88
- package/dist/bundles/cli/index.js +258 -90
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/apps/cli/commands/project/commandMigrateHelm3.ts +3 -2
|
@@ -84,8 +84,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
84
84
|
return [3 /*break*/, 5];
|
|
85
85
|
case 5: return [4 /*yield*/, (0, getProjectConfig_1.getEnvironment)(env, componentName)];
|
|
86
86
|
case 6:
|
|
87
|
-
releaseName = (_c.sent()).
|
|
88
|
-
.RELEASE_NAME;
|
|
87
|
+
releaseName = (_c.sent()).fullName;
|
|
89
88
|
this.log("helm release name: ".concat(releaseName));
|
|
90
89
|
this.log("");
|
|
91
90
|
this.log("migrating now... 😼. This may take a moment");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandMigrateHelm3.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandMigrateHelm3.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA6C;AAE7C,wEAG6C;AAC7C,6CAAiD;AAEjD,2DAA2D;AAE3D;;;GAGG;AACH,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CACN,sCAAsC,EACtC,6CAA6C,CAC9C,CAAA;qBACA,YAAY,CAAA;gBACV,qBAAM,IAAA,kCAAgB,GAAE,EAAA;oBAN7B,sBAAA,cAMI,CAAC,SAAwB,CAAC,CAAC,MAAM,CAC/B,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,C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AI,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;oCACnE,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;oCACrC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;;;;;;iBAEhB,CAAC,EAAA;;;KAAA,EAAC"}
|
|
@@ -39822,68 +39822,12 @@ exports.readConfigSync = readConfigSync;
|
|
|
39822
39822
|
|
|
39823
39823
|
exports.__esModule = true;
|
|
39824
39824
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
39825
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
39825
|
+
exports.PIPELINE_IMAGE_TAG = "main-39609fd6" || 0;
|
|
39826
39826
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
39827
39827
|
|
|
39828
39828
|
/***/ }),
|
|
39829
39829
|
|
|
39830
|
-
/***/
|
|
39831
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
39832
|
-
|
|
39833
|
-
"use strict";
|
|
39834
|
-
|
|
39835
|
-
|
|
39836
|
-
var __assign = this && this.__assign || function () {
|
|
39837
|
-
__assign = Object.assign || function (t) {
|
|
39838
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
39839
|
-
s = arguments[i];
|
|
39840
|
-
|
|
39841
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
39842
|
-
}
|
|
39843
|
-
|
|
39844
|
-
return t;
|
|
39845
|
-
};
|
|
39846
|
-
|
|
39847
|
-
return __assign.apply(this, arguments);
|
|
39848
|
-
};
|
|
39849
|
-
|
|
39850
|
-
var __importDefault = this && this.__importDefault || function (mod) {
|
|
39851
|
-
return mod && mod.__esModule ? mod : {
|
|
39852
|
-
"default": mod
|
|
39853
|
-
};
|
|
39854
|
-
};
|
|
39855
|
-
|
|
39856
|
-
exports.__esModule = true;
|
|
39857
|
-
exports.getLabels = void 0;
|
|
39858
|
-
|
|
39859
|
-
var slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
39860
|
-
|
|
39861
|
-
var sanitize = function (value) {
|
|
39862
|
-
if (!value) return value; //"The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed."
|
|
39863
|
-
// slugify should do the job
|
|
39864
|
-
|
|
39865
|
-
return (0, slugify_1["default"])(value).toLowerCase();
|
|
39866
|
-
};
|
|
39867
|
-
|
|
39868
|
-
var getLabels = function (context) {
|
|
39869
|
-
var _a, _b, _c;
|
|
39870
|
-
|
|
39871
|
-
var labels = __assign({
|
|
39872
|
-
"customer-name": sanitize(context.fullConfig.customerName),
|
|
39873
|
-
"app-name": sanitize(context.fullConfig.appName),
|
|
39874
|
-
"env-type": sanitize(context.environment.envType),
|
|
39875
|
-
"env-name": sanitize(context.environment.shortName),
|
|
39876
|
-
"build-type": sanitize((_a = context.componentConfig.build) === null || _a === void 0 ? void 0 : _a.type)
|
|
39877
|
-
}, (_c = (_b = context.fullConfig.meta) === null || _b === void 0 ? void 0 : _b.labels) !== null && _c !== void 0 ? _c : {});
|
|
39878
|
-
|
|
39879
|
-
return labels;
|
|
39880
|
-
};
|
|
39881
|
-
|
|
39882
|
-
exports.getLabels = getLabels;
|
|
39883
|
-
|
|
39884
|
-
/***/ }),
|
|
39885
|
-
|
|
39886
|
-
/***/ 2041:
|
|
39830
|
+
/***/ 740:
|
|
39887
39831
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
39888
39832
|
|
|
39889
39833
|
"use strict";
|
|
@@ -40086,14 +40030,12 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
40086
40030
|
};
|
|
40087
40031
|
|
|
40088
40032
|
exports.__esModule = true;
|
|
40089
|
-
exports.
|
|
40033
|
+
exports.getEnvironment = exports.getSecretVarNameForContext = exports.getSecretVarName = void 0;
|
|
40090
40034
|
|
|
40091
40035
|
var lodash_1 = __nccwpck_require__(3255);
|
|
40092
40036
|
|
|
40093
40037
|
var slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
40094
40038
|
|
|
40095
|
-
var build_1 = __nccwpck_require__(3760);
|
|
40096
|
-
|
|
40097
40039
|
var deploy_1 = __nccwpck_require__(223);
|
|
40098
40040
|
|
|
40099
40041
|
var types_1 = __nccwpck_require__(3109);
|
|
@@ -40134,7 +40076,7 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
|
|
|
40134
40076
|
}
|
|
40135
40077
|
|
|
40136
40078
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
40137
|
-
var defaultConfig, envConfig, mergedConfig, envType, basePredefinedVariables,
|
|
40079
|
+
var defaultConfig, envConfig, mergedConfig, envType, basePredefinedVariables, gitlabEnvironmentName, environmentSlug, predefinedVariables, host, url, fullName, devLocalConfig, port, componentSlug, envInUrl, domainCanonical, HOST_CANONICAL, KUBE_APP_NAME_PREFIX, KUBE_APP_NAME, KUBE_NAMESPACE, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegasyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
|
|
40138
40080
|
|
|
40139
40081
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
40140
40082
|
|
|
@@ -40165,8 +40107,9 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
|
|
|
40165
40107
|
APP_DIR: mergedConfig.dir,
|
|
40166
40108
|
ENV_TYPE: envType
|
|
40167
40109
|
};
|
|
40168
|
-
|
|
40110
|
+
gitlabEnvironmentName = envType === "review" && commitInfo ? "".concat(env, "/").concat(commitInfo.refName, "/").concat(componentName) : "".concat(env, "/").concat(componentName);
|
|
40169
40111
|
environmentSlug = envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug, "-").concat(componentName) : "".concat(env, "-").concat(componentName);
|
|
40112
|
+
fullName = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
|
|
40170
40113
|
|
|
40171
40114
|
if (envType === "local") {
|
|
40172
40115
|
devLocalConfig = mergedConfig;
|
|
@@ -40179,25 +40122,23 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
|
|
|
40179
40122
|
PORT: port.toString()
|
|
40180
40123
|
};
|
|
40181
40124
|
} else {
|
|
40182
|
-
RELEASE_NAME = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
|
|
40183
40125
|
componentSlug = (0, slugify_1["default"])(componentName);
|
|
40184
40126
|
envInUrl = envType === "review" && commitInfo ? "".concat(commitInfo.reviewSlug, ".").concat(env) : env;
|
|
40185
40127
|
domainCanonical = (mergedConfig === null || mergedConfig === void 0 ? void 0 : mergedConfig.deploy) && (mergedConfig === null || mergedConfig === void 0 ? void 0 : mergedConfig.deploy.type) === "kubernetes" && ((_e = mergedConfig.deploy.cluster) === null || _e === void 0 ? void 0 : _e.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
|
|
40186
40128
|
config.domainCanonical || "panter.cloud";
|
|
40187
|
-
HOST_CANONICAL = (0, types_1.isOfDeployType)(mergedConfig.deploy, "kubernetes") ? "".concat(componentSlug, ".").concat(envInUrl, ".").concat(config.appName, ".").concat(config.customerName, ".").concat(domainCanonical) : (0, types_1.isOfDeployType)(mergedConfig.deploy, "google-cloudrun") ?
|
|
40129
|
+
HOST_CANONICAL = (0, types_1.isOfDeployType)(mergedConfig.deploy, "kubernetes") ? "".concat(componentSlug, ".").concat(envInUrl, ".").concat(config.appName, ".").concat(config.customerName, ".").concat(domainCanonical) : (0, types_1.isOfDeployType)(mergedConfig.deploy, "google-cloudrun") ? fullName.toLowerCase() + "-" + process.env[(0, exports.getSecretVarName)(env, componentName, deploy_1.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)] : "";
|
|
40188
40130
|
host = (_f = mergedConfig === null || mergedConfig === void 0 ? void 0 : mergedConfig.host) !== null && _f !== void 0 ? _f : HOST_CANONICAL;
|
|
40189
|
-
|
|
40131
|
+
url = "https://".concat(host);
|
|
40190
40132
|
KUBE_APP_NAME_PREFIX = envType === "review" && commitInfo ? "".concat(commitInfo.reviewSlug, "-") : "";
|
|
40191
40133
|
KUBE_APP_NAME = "".concat(KUBE_APP_NAME_PREFIX).concat(componentName);
|
|
40192
40134
|
KUBE_NAMESPACE = (0, deploy_1.getKubernetesNamespace)(config, env);
|
|
40193
40135
|
predefinedVariables = __assign(__assign({}, basePredefinedVariables), {
|
|
40194
40136
|
HOST_CANONICAL: HOST_CANONICAL,
|
|
40195
40137
|
HOST: host,
|
|
40196
|
-
ROOT_URL:
|
|
40138
|
+
ROOT_URL: url,
|
|
40197
40139
|
KUBE_NAMESPACE: KUBE_NAMESPACE,
|
|
40198
40140
|
KUBE_APP_NAME: KUBE_APP_NAME,
|
|
40199
|
-
KUBE_APP_NAME_PREFIX: KUBE_APP_NAME_PREFIX
|
|
40200
|
-
RELEASE_NAME: RELEASE_NAME
|
|
40141
|
+
KUBE_APP_NAME_PREFIX: KUBE_APP_NAME_PREFIX
|
|
40201
40142
|
});
|
|
40202
40143
|
}
|
|
40203
40144
|
|
|
@@ -40247,10 +40188,14 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
|
|
|
40247
40188
|
, {
|
|
40248
40189
|
envType: envType,
|
|
40249
40190
|
host: host,
|
|
40250
|
-
|
|
40191
|
+
url: url,
|
|
40192
|
+
gitlabEnvironment: {
|
|
40193
|
+
name: gitlabEnvironmentName,
|
|
40194
|
+
url: url
|
|
40195
|
+
},
|
|
40196
|
+
fullName: fullName,
|
|
40251
40197
|
slug: environmentSlug,
|
|
40252
40198
|
shortName: env,
|
|
40253
|
-
url: predefinedVariables.ROOT_URL,
|
|
40254
40199
|
envVars: envVars,
|
|
40255
40200
|
secretEnvVarKeys: secretEnvVarKeys
|
|
40256
40201
|
}];
|
|
@@ -40261,6 +40206,241 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
|
|
|
40261
40206
|
|
|
40262
40207
|
exports.getEnvironment = getEnvironment;
|
|
40263
40208
|
|
|
40209
|
+
/***/ }),
|
|
40210
|
+
|
|
40211
|
+
/***/ 486:
|
|
40212
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
40213
|
+
|
|
40214
|
+
"use strict";
|
|
40215
|
+
|
|
40216
|
+
|
|
40217
|
+
var __assign = this && this.__assign || function () {
|
|
40218
|
+
__assign = Object.assign || function (t) {
|
|
40219
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40220
|
+
s = arguments[i];
|
|
40221
|
+
|
|
40222
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
40223
|
+
}
|
|
40224
|
+
|
|
40225
|
+
return t;
|
|
40226
|
+
};
|
|
40227
|
+
|
|
40228
|
+
return __assign.apply(this, arguments);
|
|
40229
|
+
};
|
|
40230
|
+
|
|
40231
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
40232
|
+
return mod && mod.__esModule ? mod : {
|
|
40233
|
+
"default": mod
|
|
40234
|
+
};
|
|
40235
|
+
};
|
|
40236
|
+
|
|
40237
|
+
exports.__esModule = true;
|
|
40238
|
+
exports.getLabels = void 0;
|
|
40239
|
+
|
|
40240
|
+
var slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
40241
|
+
|
|
40242
|
+
var sanitize = function (value) {
|
|
40243
|
+
if (!value) return value; //"The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed."
|
|
40244
|
+
// slugify should do the job
|
|
40245
|
+
|
|
40246
|
+
return (0, slugify_1["default"])(value).toLowerCase();
|
|
40247
|
+
};
|
|
40248
|
+
|
|
40249
|
+
var getLabels = function (context) {
|
|
40250
|
+
var _a, _b, _c;
|
|
40251
|
+
|
|
40252
|
+
var labels = __assign({
|
|
40253
|
+
"customer-name": sanitize(context.fullConfig.customerName),
|
|
40254
|
+
"app-name": sanitize(context.fullConfig.appName),
|
|
40255
|
+
"env-type": sanitize(context.environment.envType),
|
|
40256
|
+
"env-name": sanitize(context.environment.shortName),
|
|
40257
|
+
"build-type": sanitize((_a = context.componentConfig.build) === null || _a === void 0 ? void 0 : _a.type)
|
|
40258
|
+
}, (_c = (_b = context.fullConfig.meta) === null || _b === void 0 ? void 0 : _b.labels) !== null && _c !== void 0 ? _c : {});
|
|
40259
|
+
|
|
40260
|
+
return labels;
|
|
40261
|
+
};
|
|
40262
|
+
|
|
40263
|
+
exports.getLabels = getLabels;
|
|
40264
|
+
|
|
40265
|
+
/***/ }),
|
|
40266
|
+
|
|
40267
|
+
/***/ 2041:
|
|
40268
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
40269
|
+
|
|
40270
|
+
"use strict";
|
|
40271
|
+
|
|
40272
|
+
|
|
40273
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
40274
|
+
if (k2 === undefined) k2 = k;
|
|
40275
|
+
Object.defineProperty(o, k2, {
|
|
40276
|
+
enumerable: true,
|
|
40277
|
+
get: function () {
|
|
40278
|
+
return m[k];
|
|
40279
|
+
}
|
|
40280
|
+
});
|
|
40281
|
+
} : function (o, m, k, k2) {
|
|
40282
|
+
if (k2 === undefined) k2 = k;
|
|
40283
|
+
o[k2] = m[k];
|
|
40284
|
+
});
|
|
40285
|
+
|
|
40286
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
40287
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
40288
|
+
};
|
|
40289
|
+
|
|
40290
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
40291
|
+
function adopt(value) {
|
|
40292
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
40293
|
+
resolve(value);
|
|
40294
|
+
});
|
|
40295
|
+
}
|
|
40296
|
+
|
|
40297
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
40298
|
+
function fulfilled(value) {
|
|
40299
|
+
try {
|
|
40300
|
+
step(generator.next(value));
|
|
40301
|
+
} catch (e) {
|
|
40302
|
+
reject(e);
|
|
40303
|
+
}
|
|
40304
|
+
}
|
|
40305
|
+
|
|
40306
|
+
function rejected(value) {
|
|
40307
|
+
try {
|
|
40308
|
+
step(generator["throw"](value));
|
|
40309
|
+
} catch (e) {
|
|
40310
|
+
reject(e);
|
|
40311
|
+
}
|
|
40312
|
+
}
|
|
40313
|
+
|
|
40314
|
+
function step(result) {
|
|
40315
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
40316
|
+
}
|
|
40317
|
+
|
|
40318
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
40319
|
+
});
|
|
40320
|
+
};
|
|
40321
|
+
|
|
40322
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
40323
|
+
var _ = {
|
|
40324
|
+
label: 0,
|
|
40325
|
+
sent: function () {
|
|
40326
|
+
if (t[0] & 1) throw t[1];
|
|
40327
|
+
return t[1];
|
|
40328
|
+
},
|
|
40329
|
+
trys: [],
|
|
40330
|
+
ops: []
|
|
40331
|
+
},
|
|
40332
|
+
f,
|
|
40333
|
+
y,
|
|
40334
|
+
t,
|
|
40335
|
+
g;
|
|
40336
|
+
return g = {
|
|
40337
|
+
next: verb(0),
|
|
40338
|
+
"throw": verb(1),
|
|
40339
|
+
"return": verb(2)
|
|
40340
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
40341
|
+
return this;
|
|
40342
|
+
}), g;
|
|
40343
|
+
|
|
40344
|
+
function verb(n) {
|
|
40345
|
+
return function (v) {
|
|
40346
|
+
return step([n, v]);
|
|
40347
|
+
};
|
|
40348
|
+
}
|
|
40349
|
+
|
|
40350
|
+
function step(op) {
|
|
40351
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40352
|
+
|
|
40353
|
+
while (_) try {
|
|
40354
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
40355
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
40356
|
+
|
|
40357
|
+
switch (op[0]) {
|
|
40358
|
+
case 0:
|
|
40359
|
+
case 1:
|
|
40360
|
+
t = op;
|
|
40361
|
+
break;
|
|
40362
|
+
|
|
40363
|
+
case 4:
|
|
40364
|
+
_.label++;
|
|
40365
|
+
return {
|
|
40366
|
+
value: op[1],
|
|
40367
|
+
done: false
|
|
40368
|
+
};
|
|
40369
|
+
|
|
40370
|
+
case 5:
|
|
40371
|
+
_.label++;
|
|
40372
|
+
y = op[1];
|
|
40373
|
+
op = [0];
|
|
40374
|
+
continue;
|
|
40375
|
+
|
|
40376
|
+
case 7:
|
|
40377
|
+
op = _.ops.pop();
|
|
40378
|
+
|
|
40379
|
+
_.trys.pop();
|
|
40380
|
+
|
|
40381
|
+
continue;
|
|
40382
|
+
|
|
40383
|
+
default:
|
|
40384
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
40385
|
+
_ = 0;
|
|
40386
|
+
continue;
|
|
40387
|
+
}
|
|
40388
|
+
|
|
40389
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
40390
|
+
_.label = op[1];
|
|
40391
|
+
break;
|
|
40392
|
+
}
|
|
40393
|
+
|
|
40394
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
40395
|
+
_.label = t[1];
|
|
40396
|
+
t = op;
|
|
40397
|
+
break;
|
|
40398
|
+
}
|
|
40399
|
+
|
|
40400
|
+
if (t && _.label < t[2]) {
|
|
40401
|
+
_.label = t[2];
|
|
40402
|
+
|
|
40403
|
+
_.ops.push(op);
|
|
40404
|
+
|
|
40405
|
+
break;
|
|
40406
|
+
}
|
|
40407
|
+
|
|
40408
|
+
if (t[2]) _.ops.pop();
|
|
40409
|
+
|
|
40410
|
+
_.trys.pop();
|
|
40411
|
+
|
|
40412
|
+
continue;
|
|
40413
|
+
}
|
|
40414
|
+
|
|
40415
|
+
op = body.call(thisArg, _);
|
|
40416
|
+
} catch (e) {
|
|
40417
|
+
op = [6, e];
|
|
40418
|
+
y = 0;
|
|
40419
|
+
} finally {
|
|
40420
|
+
f = t = 0;
|
|
40421
|
+
}
|
|
40422
|
+
|
|
40423
|
+
if (op[0] & 5) throw op[1];
|
|
40424
|
+
return {
|
|
40425
|
+
value: op[0] ? op[1] : void 0,
|
|
40426
|
+
done: true
|
|
40427
|
+
};
|
|
40428
|
+
}
|
|
40429
|
+
};
|
|
40430
|
+
|
|
40431
|
+
exports.__esModule = true;
|
|
40432
|
+
exports.createContext = void 0;
|
|
40433
|
+
|
|
40434
|
+
var build_1 = __nccwpck_require__(3760);
|
|
40435
|
+
|
|
40436
|
+
var deploy_1 = __nccwpck_require__(223);
|
|
40437
|
+
|
|
40438
|
+
var utils_1 = __nccwpck_require__(7461);
|
|
40439
|
+
|
|
40440
|
+
var getEnvironment_1 = __nccwpck_require__(740);
|
|
40441
|
+
|
|
40442
|
+
__exportStar(__nccwpck_require__(740), exports);
|
|
40443
|
+
|
|
40264
40444
|
var createContext = function (config, componentName, env, commitInfo, packageManagerInfo) {
|
|
40265
40445
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
40266
40446
|
var rawConfig, envConfig, componentConfigWithoutDefaults, defaults, componentConfig;
|
|
@@ -40299,7 +40479,7 @@ var createContext = function (config, componentName, env, commitInfo, packageMan
|
|
|
40299
40479
|
};
|
|
40300
40480
|
return [4
|
|
40301
40481
|
/*yield*/
|
|
40302
|
-
, (0,
|
|
40482
|
+
, (0, getEnvironment_1.getEnvironment)(config, componentName, env, commitInfo)];
|
|
40303
40483
|
|
|
40304
40484
|
case 1:
|
|
40305
40485
|
return [2
|
|
@@ -40718,10 +40898,6 @@ var DEPLOY_RUNNER_VARIABLES = {
|
|
|
40718
40898
|
var getBaseDeploymentJob = function (context) {
|
|
40719
40899
|
var _a, _b, _c;
|
|
40720
40900
|
|
|
40721
|
-
var environment = {
|
|
40722
|
-
name: context.environment.fullName,
|
|
40723
|
-
url: context.environment.url
|
|
40724
|
-
};
|
|
40725
40901
|
var hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
40726
40902
|
var isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
40727
40903
|
var autoStop = context.environment.envType === "review" ? "2 week" : context.environment.envType === "dev" ? "4 weeks" : undefined; // if auto or manual is configured explicitly, use that
|
|
@@ -40759,7 +40935,7 @@ var getBaseDeploymentJob = function (context) {
|
|
|
40759
40935
|
allow_failure: whenDeploy === "manual" ? true : false,
|
|
40760
40936
|
stage: "deploy",
|
|
40761
40937
|
variables: __assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}),
|
|
40762
|
-
environment: __assign(__assign({}, environment), isStoppable ? {
|
|
40938
|
+
environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
|
|
40763
40939
|
on_stop: exports.STOP_JOB_NAME,
|
|
40764
40940
|
auto_stop_in: autoStop
|
|
40765
40941
|
} : {})
|
|
@@ -40769,10 +40945,6 @@ var getBaseDeploymentJob = function (context) {
|
|
|
40769
40945
|
exports.getBaseDeploymentJob = getBaseDeploymentJob;
|
|
40770
40946
|
|
|
40771
40947
|
var getBaseDeploymentStopJob = function (context) {
|
|
40772
|
-
var environment = {
|
|
40773
|
-
name: context.environment.fullName,
|
|
40774
|
-
url: context.environment.url
|
|
40775
|
-
};
|
|
40776
40948
|
return {
|
|
40777
40949
|
name: exports.STOP_JOB_NAME,
|
|
40778
40950
|
envMode: "stagePerEnv",
|
|
@@ -40789,7 +40961,7 @@ var getBaseDeploymentStopJob = function (context) {
|
|
|
40789
40961
|
GIT_STRATEGY: "none"
|
|
40790
40962
|
}),
|
|
40791
40963
|
stage: "stop",
|
|
40792
|
-
environment: __assign(__assign({}, environment), {
|
|
40964
|
+
environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
|
|
40793
40965
|
action: "stop"
|
|
40794
40966
|
})
|
|
40795
40967
|
};
|
|
@@ -40798,10 +40970,6 @@ var getBaseDeploymentStopJob = function (context) {
|
|
|
40798
40970
|
exports.getBaseDeploymentStopJob = getBaseDeploymentStopJob;
|
|
40799
40971
|
|
|
40800
40972
|
var getBaseRollbackJob = function (context) {
|
|
40801
|
-
var environment = {
|
|
40802
|
-
name: context.environment.fullName,
|
|
40803
|
-
url: context.environment.url
|
|
40804
|
-
};
|
|
40805
40973
|
return {
|
|
40806
40974
|
name: exports.ROLLBACK_JOB_NAME,
|
|
40807
40975
|
envMode: "stagePerEnv",
|
|
@@ -40814,7 +40982,7 @@ var getBaseRollbackJob = function (context) {
|
|
|
40814
40982
|
GIT_STRATEGY: "none"
|
|
40815
40983
|
}),
|
|
40816
40984
|
stage: "rollback",
|
|
40817
|
-
environment: __assign(__assign({}, environment), {
|
|
40985
|
+
environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
|
|
40818
40986
|
action: "access"
|
|
40819
40987
|
})
|
|
40820
40988
|
};
|
|
@@ -40906,7 +41074,7 @@ var createDeployJob = function (context) {
|
|
|
40906
41074
|
var pushImageToArtifactsRegistry = __spreadArray(__spreadArray([docker_1.gitlabDockerLogin], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), ["gcloud auth configure-docker ".concat(deployConfig.region, "-docker.pkg.dev"), "docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG ".concat(gcloudImageName), "docker push ".concat(gcloudImageName)], false);
|
|
40907
41075
|
|
|
40908
41076
|
var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, _1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
|
|
40909
|
-
var serviceName = context.environment.
|
|
41077
|
+
var serviceName = context.environment.fullName;
|
|
40910
41078
|
var labelsString = Object.entries((0, getLabels_1.getLabels)(context)).map(function (_a) {
|
|
40911
41079
|
var _b = __read(_a, 2),
|
|
40912
41080
|
key = _b[0],
|
|
@@ -41388,6 +41556,7 @@ var createKubernetesDeployJobs = function (context) {
|
|
|
41388
41556
|
var shared = {
|
|
41389
41557
|
image: (0, runner_1.getRunnerImage)("kubernetes"),
|
|
41390
41558
|
variables: __assign(__assign({}, context.environment.envVars), {
|
|
41559
|
+
RELEASE_NAME: context.environment.fullName,
|
|
41391
41560
|
HELM_EXPERIMENTAL_OCI: "1",
|
|
41392
41561
|
KUBE_DOCKER_IMAGE_PULL_SECRET: "gitlab-registry-".concat(context.componentName),
|
|
41393
41562
|
KUBE_VALUES: (0, js_yaml_1.dump)(kubeValues, {
|