@catladder/cli 0.0.0-main-414c8270 → 0.0.0-main-0acdca98
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/catenv/catenv.js +2 -2
- package/dist/apps/catenv/catenv.js.map +1 -1
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +1 -1
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -1
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +14 -11
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +36 -11
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/apps/cli/commands/project/commandEnvVars.js +1 -1
- package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -1
- package/dist/bundles/catenv/index.js +339 -62
- package/dist/bundles/cli/index.js +389 -84
- package/dist/config/getProjectConfig.d.ts +8 -1
- package/dist/config/getProjectConfig.js +45 -6
- package/dist/config/getProjectConfig.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/gitlab.d.ts +4 -4
- package/dist/utils/gitlab.js.map +1 -1
- package/package.json +2 -2
- package/src/apps/catenv/catenv.ts +6 -3
- package/src/apps/cli/commands/mongodb/projectMongoPortForward.ts +5 -2
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +18 -12
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +26 -7
- package/src/apps/cli/commands/project/commandEnvVars.ts +5 -2
- package/src/config/getProjectConfig.ts +30 -6
- package/src/utils/gitlab.ts +4 -4
|
@@ -91,7 +91,7 @@ var getAllVariablesToPrint = function (config, choice) { return __awaiter(void 0
|
|
|
91
91
|
currentComponent = _a;
|
|
92
92
|
variables = {};
|
|
93
93
|
if (!currentComponent) return [3 /*break*/, 5];
|
|
94
|
-
return [4 /*yield*/, (0, getProjectConfig_1.
|
|
94
|
+
return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(null, env, currentComponent)];
|
|
95
95
|
case 4:
|
|
96
96
|
variables = _d.sent();
|
|
97
97
|
return [3 /*break*/, 7];
|
|
@@ -99,7 +99,7 @@ var getAllVariablesToPrint = function (config, choice) { return __awaiter(void 0
|
|
|
99
99
|
var subappvars, _a;
|
|
100
100
|
return __generator(this, function (_b) {
|
|
101
101
|
switch (_b.label) {
|
|
102
|
-
case 0: return [4 /*yield*/, (0, getProjectConfig_1.
|
|
102
|
+
case 0: return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(null, env, componentName)];
|
|
103
103
|
case 1:
|
|
104
104
|
subappvars = _b.sent();
|
|
105
105
|
_a = [{}];
|
|
@@ -176,6 +176,17 @@ var choice = process.argv[2] ? (0, parseChoice_1.parseChoice)(process.argv[2]) :
|
|
|
176
176
|
|
|
177
177
|
"use strict";
|
|
178
178
|
|
|
179
|
+
var __assign = (this && this.__assign) || function () {
|
|
180
|
+
__assign = Object.assign || function(t) {
|
|
181
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
182
|
+
s = arguments[i];
|
|
183
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
184
|
+
t[p] = s[p];
|
|
185
|
+
}
|
|
186
|
+
return t;
|
|
187
|
+
};
|
|
188
|
+
return __assign.apply(this, arguments);
|
|
189
|
+
};
|
|
179
190
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
180
191
|
if (k2 === undefined) k2 = k;
|
|
181
192
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -220,7 +231,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
220
231
|
}
|
|
221
232
|
};
|
|
222
233
|
exports.__esModule = true;
|
|
223
|
-
exports.
|
|
234
|
+
exports.getJobOnlyEnvVarsResolved = exports.getEnvVarsResolved = exports.getGitlabVar = exports.getEnvironment = exports.getAllPipelineContexts = exports.getAllComponentsWithAllEnvsHierarchical = exports.getAllComponentsWithAllEnvsFlat = exports.getPipelineContextByChoice = exports.getProjectComponents = exports.getGitlabCi = exports.getGitlabCiFilePath = exports.getProjectConfig = exports.parseChoice = void 0;
|
|
224
235
|
var pipeline_1 = __nccwpck_require__(5355);
|
|
225
236
|
var gitlab_1 = __nccwpck_require__(9818);
|
|
226
237
|
var projects_1 = __nccwpck_require__(1619);
|
|
@@ -424,27 +435,55 @@ var resolveSecrets = function (vorpal, allEnvVars) { return __awaiter(void 0, vo
|
|
|
424
435
|
}
|
|
425
436
|
});
|
|
426
437
|
}); };
|
|
427
|
-
var
|
|
438
|
+
var getEnvVarsResolved = function (vorpal, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
428
439
|
var envionment, e_2;
|
|
429
440
|
return __generator(this, function (_a) {
|
|
430
441
|
switch (_a.label) {
|
|
431
442
|
case 0:
|
|
432
|
-
|
|
433
|
-
|
|
443
|
+
if (!componentName) {
|
|
444
|
+
return [2 /*return*/, {}];
|
|
445
|
+
}
|
|
446
|
+
_a.label = 1;
|
|
434
447
|
case 1:
|
|
448
|
+
_a.trys.push([1, 3, , 4]);
|
|
449
|
+
return [4 /*yield*/, (0, exports.getEnvironment)(env, componentName)];
|
|
450
|
+
case 2:
|
|
435
451
|
envionment = _a.sent();
|
|
436
452
|
// in the pipeline the secrets alreadyy exists and bash will expand them
|
|
437
453
|
// but here we need to manually load them
|
|
438
454
|
return [2 /*return*/, resolveSecrets(vorpal, envionment.envVars)];
|
|
439
|
-
case
|
|
455
|
+
case 3:
|
|
440
456
|
e_2 = _a.sent();
|
|
441
457
|
// env is disabled
|
|
442
458
|
return [2 /*return*/, {}];
|
|
459
|
+
case 4: return [2 /*return*/];
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
}); };
|
|
463
|
+
exports.getEnvVarsResolved = getEnvVarsResolved;
|
|
464
|
+
/**
|
|
465
|
+
*
|
|
466
|
+
* is used to get job only vars that should also be editable locally with catladder.
|
|
467
|
+
*/
|
|
468
|
+
var getJobOnlyEnvVarsResolved = function (vorpal, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
469
|
+
var envionment, e_3;
|
|
470
|
+
return __generator(this, function (_a) {
|
|
471
|
+
switch (_a.label) {
|
|
472
|
+
case 0:
|
|
473
|
+
_a.trys.push([0, 2, , 3]);
|
|
474
|
+
return [4 /*yield*/, (0, exports.getEnvironment)(env, componentName)];
|
|
475
|
+
case 1:
|
|
476
|
+
envionment = _a.sent();
|
|
477
|
+
return [2 /*return*/, resolveSecrets(vorpal, __assign(__assign({}, envionment.jobOnlyVars.build.envVars), envionment.jobOnlyVars.deploy.envVars))];
|
|
478
|
+
case 2:
|
|
479
|
+
e_3 = _a.sent();
|
|
480
|
+
// env is disabled
|
|
481
|
+
return [2 /*return*/, {}];
|
|
443
482
|
case 3: return [2 /*return*/];
|
|
444
483
|
}
|
|
445
484
|
});
|
|
446
485
|
}); };
|
|
447
|
-
exports.
|
|
486
|
+
exports.getJobOnlyEnvVarsResolved = getJobOnlyEnvVarsResolved;
|
|
448
487
|
//# sourceMappingURL=getProjectConfig.js.map
|
|
449
488
|
|
|
450
489
|
/***/ }),
|
|
@@ -38790,7 +38829,7 @@ var createBuildJob = function (context, _a) {
|
|
|
38790
38829
|
image: (0, __1.getRunnerImage)("jobs-default"),
|
|
38791
38830
|
needs: [],
|
|
38792
38831
|
cache: [],
|
|
38793
|
-
variables: __assign(__assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
38832
|
+
variables: __assign(__assign(__assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
38794
38833
|
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_c = (0, utils_1.ensureArray)(script)) !== null && _c !== void 0 ? _c : []), false),
|
|
38795
38834
|
artifacts: {
|
|
38796
38835
|
paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
|
|
@@ -39029,9 +39068,9 @@ var createCustomTestJobs = function (context) {
|
|
|
39029
39068
|
throw new Error("deploy config is not custom");
|
|
39030
39069
|
}
|
|
39031
39070
|
var base = {
|
|
39032
|
-
variables: __assign(__assign({
|
|
39071
|
+
variables: __assign(__assign(__assign({
|
|
39033
39072
|
APP_PATH: context.componentConfig.dir
|
|
39034
|
-
}, RUNNER_CUSTOM_TEST_VARIABLES), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
39073
|
+
}, RUNNER_CUSTOM_TEST_VARIABLES), context.environment.jobOnlyVars.build.envVars), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
39035
39074
|
services: buildConfig.jobServices,
|
|
39036
39075
|
cache: buildConfig.jobCache,
|
|
39037
39076
|
stage: "test",
|
|
@@ -39722,9 +39761,9 @@ var createNodeTestJobs = function (context) {
|
|
|
39722
39761
|
}
|
|
39723
39762
|
var buildConfig = context.componentConfig.build;
|
|
39724
39763
|
var base = {
|
|
39725
|
-
variables: __assign(__assign({
|
|
39764
|
+
variables: __assign(__assign(__assign({
|
|
39726
39765
|
APP_PATH: context.componentConfig.dir
|
|
39727
|
-
}, constants_1.NODE_RUNNER_BUILD_VARIABLES), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
39766
|
+
}, constants_1.NODE_RUNNER_BUILD_VARIABLES), context.environment.jobOnlyVars.build.envVars), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
39728
39767
|
stage: "test",
|
|
39729
39768
|
needs: [],
|
|
39730
39769
|
envMode: "none"
|
|
@@ -39841,6 +39880,16 @@ exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
|
|
|
39841
39880
|
"use strict";
|
|
39842
39881
|
|
|
39843
39882
|
|
|
39883
|
+
var __assign = this && this.__assign || function () {
|
|
39884
|
+
__assign = Object.assign || function (t) {
|
|
39885
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
39886
|
+
s = arguments[i];
|
|
39887
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
39888
|
+
}
|
|
39889
|
+
return t;
|
|
39890
|
+
};
|
|
39891
|
+
return __assign.apply(this, arguments);
|
|
39892
|
+
};
|
|
39844
39893
|
var __read = this && this.__read || function (o, n) {
|
|
39845
39894
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
39846
39895
|
if (!m) return o;
|
|
@@ -39882,7 +39931,7 @@ var createRailsBuildJobs = function (context) {
|
|
|
39882
39931
|
return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
|
|
39883
39932
|
}).join(" ");
|
|
39884
39933
|
return [(0, docker_1.createDockerBuildJobBase)(context, {
|
|
39885
|
-
variables: context.componentConfig.build.extraVars,
|
|
39934
|
+
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
|
|
39886
39935
|
// custom script
|
|
39887
39936
|
script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "/pack-v").concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "-linux.tgz | tar -zx --directory /usr/local/bin pack"), "chmod +x /usr/local/bin/pack",
|
|
39888
39937
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
@@ -39999,7 +40048,7 @@ var createRailsTestJobs = function (context) {
|
|
|
39999
40048
|
}
|
|
40000
40049
|
var buildConfig = context.componentConfig.build;
|
|
40001
40050
|
var base = {
|
|
40002
|
-
variables: (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {},
|
|
40051
|
+
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
40003
40052
|
stage: "test",
|
|
40004
40053
|
needs: [],
|
|
40005
40054
|
envMode: "none"
|
|
@@ -40232,7 +40281,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40232
40281
|
|
|
40233
40282
|
exports.__esModule = true;
|
|
40234
40283
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40235
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
40284
|
+
exports.PIPELINE_IMAGE_TAG = "main-0acdca98" || 0;
|
|
40236
40285
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40237
40286
|
|
|
40238
40287
|
/***/ }),
|
|
@@ -40288,6 +40337,16 @@ exports.getEnvType = getEnvType;
|
|
|
40288
40337
|
"use strict";
|
|
40289
40338
|
|
|
40290
40339
|
|
|
40340
|
+
var __assign = this && this.__assign || function () {
|
|
40341
|
+
__assign = Object.assign || function (t) {
|
|
40342
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40343
|
+
s = arguments[i];
|
|
40344
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
40345
|
+
}
|
|
40346
|
+
return t;
|
|
40347
|
+
};
|
|
40348
|
+
return __assign.apply(this, arguments);
|
|
40349
|
+
};
|
|
40291
40350
|
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
40292
40351
|
function adopt(value) {
|
|
40293
40352
|
return value instanceof P ? value : new P(function (resolve) {
|
|
@@ -40409,30 +40468,26 @@ var getEnvironmentContext_1 = __nccwpck_require__(4650);
|
|
|
40409
40468
|
var getEnvironmentVariables_1 = __nccwpck_require__(6602);
|
|
40410
40469
|
var getEnvironment = function (config, componentName, env, commitInfo) {
|
|
40411
40470
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
40412
|
-
var
|
|
40413
|
-
return __generator(this, function (
|
|
40414
|
-
switch (
|
|
40471
|
+
var variables, envContext, envType;
|
|
40472
|
+
return __generator(this, function (_a) {
|
|
40473
|
+
switch (_a.label) {
|
|
40415
40474
|
case 0:
|
|
40416
40475
|
return [4 /*yield*/, (0, getEnvironmentVariables_1.getEnvironmentVariables)(config, componentName, env, commitInfo)];
|
|
40417
40476
|
case 1:
|
|
40418
|
-
|
|
40477
|
+
variables = _a.sent();
|
|
40419
40478
|
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
|
|
40420
40479
|
envType = envContext.envType;
|
|
40421
|
-
return [2 /*return*/, {
|
|
40480
|
+
return [2 /*return*/, __assign({
|
|
40422
40481
|
envType: envType,
|
|
40423
|
-
host: host,
|
|
40424
|
-
url: url,
|
|
40425
40482
|
gitlabEnvironment: {
|
|
40426
40483
|
name: envContext.gitlabEnvironmentName,
|
|
40427
|
-
url: url
|
|
40484
|
+
url: variables.url
|
|
40428
40485
|
},
|
|
40429
40486
|
fullName: envContext.fullName,
|
|
40430
40487
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
40431
40488
|
slug: envContext.environmentSlug,
|
|
40432
|
-
shortName: env
|
|
40433
|
-
|
|
40434
|
-
secretEnvVarKeys: secretEnvVarKeys
|
|
40435
|
-
}];
|
|
40489
|
+
shortName: env
|
|
40490
|
+
}, variables)];
|
|
40436
40491
|
}
|
|
40437
40492
|
});
|
|
40438
40493
|
});
|
|
@@ -40649,19 +40704,22 @@ var lodash_1 = __nccwpck_require__(3255);
|
|
|
40649
40704
|
var deploy_1 = __nccwpck_require__(223);
|
|
40650
40705
|
var getEnvironmentContext_1 = __nccwpck_require__(4650);
|
|
40651
40706
|
var resolveReferences_1 = __nccwpck_require__(928);
|
|
40707
|
+
var envVars_1 = __nccwpck_require__(7185);
|
|
40708
|
+
var transformJobOnlyVars_1 = __nccwpck_require__(4674);
|
|
40652
40709
|
var getEnvironmentVariables = function (config, componentName, env, commitInfo, alreadyVisited // to prevent endless loop
|
|
40653
40710
|
) {
|
|
40654
40711
|
if (alreadyVisited === void 0) {
|
|
40655
40712
|
alreadyVisited = {};
|
|
40656
40713
|
}
|
|
40657
40714
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
40658
|
-
var environmentContext, envConfigRaw, deployConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents,
|
|
40659
|
-
var _a, _b
|
|
40660
|
-
|
|
40661
|
-
|
|
40715
|
+
var environmentContext, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegacyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
|
|
40716
|
+
var _a, _b;
|
|
40717
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
40718
|
+
return __generator(this, function (_m) {
|
|
40719
|
+
switch (_m.label) {
|
|
40662
40720
|
case 0:
|
|
40663
40721
|
environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
|
|
40664
|
-
envConfigRaw = environmentContext.envConfigRaw, deployConfigRaw = environmentContext.deployConfigRaw, envType = environmentContext.envType;
|
|
40722
|
+
envConfigRaw = environmentContext.envConfigRaw, deployConfigRaw = environmentContext.deployConfigRaw, buildConfigRaw = environmentContext.buildConfigRaw, envType = environmentContext.envType;
|
|
40665
40723
|
basePredefinedVariables = {
|
|
40666
40724
|
ENV_SHORT: env,
|
|
40667
40725
|
APP_DIR: envConfigRaw.dir,
|
|
@@ -40672,7 +40730,7 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
40672
40730
|
};
|
|
40673
40731
|
if (envType === "local") {
|
|
40674
40732
|
devLocalConfig = envConfigRaw;
|
|
40675
|
-
port = (
|
|
40733
|
+
port = (_c = devLocalConfig.port) !== null && _c !== void 0 ? _c : 3000;
|
|
40676
40734
|
host = "localhost:" + port;
|
|
40677
40735
|
url = "http://" + host;
|
|
40678
40736
|
predefinedVariables = {
|
|
@@ -40682,7 +40740,7 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
40682
40740
|
};
|
|
40683
40741
|
} else {
|
|
40684
40742
|
additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
|
|
40685
|
-
host = (
|
|
40743
|
+
host = (_e = (_d = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _d !== void 0 ? _d : additionalEnvVars.HOST_CANONICAL) !== null && _e !== void 0 ? _e : "unknown-host.example.com";
|
|
40686
40744
|
url = "https://".concat(host);
|
|
40687
40745
|
predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), config.components[componentName].build.type === "rails" ? {} : {
|
|
40688
40746
|
HOST: host
|
|
@@ -40690,25 +40748,13 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
40690
40748
|
ROOT_URL: url
|
|
40691
40749
|
}), additionalEnvVars);
|
|
40692
40750
|
}
|
|
40693
|
-
publicEnvVarsRaw = (
|
|
40751
|
+
publicEnvVarsRaw = (_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.public) !== null && _g !== void 0 ? _g : {};
|
|
40694
40752
|
additionalSecretKeys = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(environmentContext) : [];
|
|
40695
|
-
secretEnvVarKeys = __spreadArray(__spreadArray([], __read(((
|
|
40696
|
-
|
|
40697
|
-
|
|
40698
|
-
|
|
40699
|
-
|
|
40700
|
-
secretEnvVars = Object.fromEntries(secretEnvVarKeys.map(function (_a) {
|
|
40701
|
-
var key = _a.key;
|
|
40702
|
-
return [key, "$".concat((0, exports.getSecretVarName)(env, componentName, key))];
|
|
40703
|
-
}));
|
|
40704
|
-
legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
|
|
40705
|
-
publicEnvVarsRawWithLegasyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
40706
|
-
publicEnvVarsRawSanitized = Object.fromEntries(Object.entries(publicEnvVarsRawWithLegasyFromComponents).map(function (_a) {
|
|
40707
|
-
var _b = __read(_a, 2),
|
|
40708
|
-
key = _b[0],
|
|
40709
|
-
value = _b[1];
|
|
40710
|
-
return [key, (0, lodash_1.isObject)(value) ? JSON.stringify(value) : "".concat(value)];
|
|
40711
|
-
}));
|
|
40753
|
+
secretEnvVarKeys = __spreadArray(__spreadArray([], __read((0, envVars_1.stringListToSecreteEnvVarList)((_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.secret) !== null && _j !== void 0 ? _j : [])), false), __read(additionalSecretKeys), false);
|
|
40754
|
+
secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
|
|
40755
|
+
legacyFromComponents = (_l = (_k = envConfigRaw.vars) === null || _k === void 0 ? void 0 : _k.fromComponents) !== null && _l !== void 0 ? _l : {};
|
|
40756
|
+
publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
40757
|
+
publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
|
|
40712
40758
|
envVarsRaw = addIndexVar(__assign(__assign(__assign({}, predefinedVariables), secretEnvVars), publicEnvVarsRawSanitized));
|
|
40713
40759
|
return [4 /*yield*/, (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (otherComponentName, alreadyVisited) {
|
|
40714
40760
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -40725,13 +40771,18 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
40725
40771
|
});
|
|
40726
40772
|
}, alreadyVisited)];
|
|
40727
40773
|
case 1:
|
|
40728
|
-
envVars =
|
|
40729
|
-
|
|
40774
|
+
envVars = _m.sent();
|
|
40775
|
+
_a = {
|
|
40730
40776
|
envVars: envVars,
|
|
40731
|
-
secretEnvVarKeys: secretEnvVarKeys
|
|
40732
|
-
|
|
40733
|
-
|
|
40734
|
-
|
|
40777
|
+
secretEnvVarKeys: secretEnvVarKeys
|
|
40778
|
+
};
|
|
40779
|
+
_b = {};
|
|
40780
|
+
return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, buildConfigRaw && buildConfigRaw.jobVars || null)];
|
|
40781
|
+
case 2:
|
|
40782
|
+
_b.build = _m.sent();
|
|
40783
|
+
return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, deployConfigRaw && deployConfigRaw.jobVars || null)];
|
|
40784
|
+
case 3:
|
|
40785
|
+
return [2 /*return*/, (_a.jobOnlyVars = (_b.deploy = _m.sent(), _b), _a.host = host, _a.url = url, _a)];
|
|
40735
40786
|
}
|
|
40736
40787
|
});
|
|
40737
40788
|
});
|
|
@@ -41243,6 +41294,232 @@ exports.translateLegacyFromComponents = translateLegacyFromComponents;
|
|
|
41243
41294
|
|
|
41244
41295
|
/***/ }),
|
|
41245
41296
|
|
|
41297
|
+
/***/ 4674:
|
|
41298
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
41299
|
+
|
|
41300
|
+
"use strict";
|
|
41301
|
+
|
|
41302
|
+
|
|
41303
|
+
var __assign = this && this.__assign || function () {
|
|
41304
|
+
__assign = Object.assign || function (t) {
|
|
41305
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
41306
|
+
s = arguments[i];
|
|
41307
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
41308
|
+
}
|
|
41309
|
+
return t;
|
|
41310
|
+
};
|
|
41311
|
+
return __assign.apply(this, arguments);
|
|
41312
|
+
};
|
|
41313
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
41314
|
+
function adopt(value) {
|
|
41315
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
41316
|
+
resolve(value);
|
|
41317
|
+
});
|
|
41318
|
+
}
|
|
41319
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41320
|
+
function fulfilled(value) {
|
|
41321
|
+
try {
|
|
41322
|
+
step(generator.next(value));
|
|
41323
|
+
} catch (e) {
|
|
41324
|
+
reject(e);
|
|
41325
|
+
}
|
|
41326
|
+
}
|
|
41327
|
+
function rejected(value) {
|
|
41328
|
+
try {
|
|
41329
|
+
step(generator["throw"](value));
|
|
41330
|
+
} catch (e) {
|
|
41331
|
+
reject(e);
|
|
41332
|
+
}
|
|
41333
|
+
}
|
|
41334
|
+
function step(result) {
|
|
41335
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
41336
|
+
}
|
|
41337
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
41338
|
+
});
|
|
41339
|
+
};
|
|
41340
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
41341
|
+
var _ = {
|
|
41342
|
+
label: 0,
|
|
41343
|
+
sent: function () {
|
|
41344
|
+
if (t[0] & 1) throw t[1];
|
|
41345
|
+
return t[1];
|
|
41346
|
+
},
|
|
41347
|
+
trys: [],
|
|
41348
|
+
ops: []
|
|
41349
|
+
},
|
|
41350
|
+
f,
|
|
41351
|
+
y,
|
|
41352
|
+
t,
|
|
41353
|
+
g;
|
|
41354
|
+
return g = {
|
|
41355
|
+
next: verb(0),
|
|
41356
|
+
"throw": verb(1),
|
|
41357
|
+
"return": verb(2)
|
|
41358
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
41359
|
+
return this;
|
|
41360
|
+
}), g;
|
|
41361
|
+
function verb(n) {
|
|
41362
|
+
return function (v) {
|
|
41363
|
+
return step([n, v]);
|
|
41364
|
+
};
|
|
41365
|
+
}
|
|
41366
|
+
function step(op) {
|
|
41367
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
41368
|
+
while (_) try {
|
|
41369
|
+
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;
|
|
41370
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
41371
|
+
switch (op[0]) {
|
|
41372
|
+
case 0:
|
|
41373
|
+
case 1:
|
|
41374
|
+
t = op;
|
|
41375
|
+
break;
|
|
41376
|
+
case 4:
|
|
41377
|
+
_.label++;
|
|
41378
|
+
return {
|
|
41379
|
+
value: op[1],
|
|
41380
|
+
done: false
|
|
41381
|
+
};
|
|
41382
|
+
case 5:
|
|
41383
|
+
_.label++;
|
|
41384
|
+
y = op[1];
|
|
41385
|
+
op = [0];
|
|
41386
|
+
continue;
|
|
41387
|
+
case 7:
|
|
41388
|
+
op = _.ops.pop();
|
|
41389
|
+
_.trys.pop();
|
|
41390
|
+
continue;
|
|
41391
|
+
default:
|
|
41392
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
41393
|
+
_ = 0;
|
|
41394
|
+
continue;
|
|
41395
|
+
}
|
|
41396
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
41397
|
+
_.label = op[1];
|
|
41398
|
+
break;
|
|
41399
|
+
}
|
|
41400
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
41401
|
+
_.label = t[1];
|
|
41402
|
+
t = op;
|
|
41403
|
+
break;
|
|
41404
|
+
}
|
|
41405
|
+
if (t && _.label < t[2]) {
|
|
41406
|
+
_.label = t[2];
|
|
41407
|
+
_.ops.push(op);
|
|
41408
|
+
break;
|
|
41409
|
+
}
|
|
41410
|
+
if (t[2]) _.ops.pop();
|
|
41411
|
+
_.trys.pop();
|
|
41412
|
+
continue;
|
|
41413
|
+
}
|
|
41414
|
+
op = body.call(thisArg, _);
|
|
41415
|
+
} catch (e) {
|
|
41416
|
+
op = [6, e];
|
|
41417
|
+
y = 0;
|
|
41418
|
+
} finally {
|
|
41419
|
+
f = t = 0;
|
|
41420
|
+
}
|
|
41421
|
+
if (op[0] & 5) throw op[1];
|
|
41422
|
+
return {
|
|
41423
|
+
value: op[0] ? op[1] : void 0,
|
|
41424
|
+
done: true
|
|
41425
|
+
};
|
|
41426
|
+
}
|
|
41427
|
+
};
|
|
41428
|
+
exports.__esModule = true;
|
|
41429
|
+
exports.transformJobOnlyVars = void 0;
|
|
41430
|
+
var envVars_1 = __nccwpck_require__(7185);
|
|
41431
|
+
/**
|
|
41432
|
+
* transform EnvVars for environment.
|
|
41433
|
+
*
|
|
41434
|
+
* currently does not resolve references and is only used for additional job-only-vars
|
|
41435
|
+
* @param vars
|
|
41436
|
+
* @returns
|
|
41437
|
+
*/
|
|
41438
|
+
var transformJobOnlyVars = function (env, componentName, vars) {
|
|
41439
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
41440
|
+
var publicVars, secretEnvVarKeys, deployJobOnlySecretEnvVars, envVars;
|
|
41441
|
+
var _a, _b;
|
|
41442
|
+
return __generator(this, function (_c) {
|
|
41443
|
+
if (!vars) {
|
|
41444
|
+
return [2 /*return*/, {
|
|
41445
|
+
envVars: {},
|
|
41446
|
+
secretEnvVarKeys: []
|
|
41447
|
+
}];
|
|
41448
|
+
}
|
|
41449
|
+
publicVars = (0, envVars_1.stringifyValues)((_a = vars === null || vars === void 0 ? void 0 : vars.public) !== null && _a !== void 0 ? _a : {});
|
|
41450
|
+
secretEnvVarKeys = (0, envVars_1.stringListToSecreteEnvVarList)((_b = vars === null || vars === void 0 ? void 0 : vars.secret) !== null && _b !== void 0 ? _b : []);
|
|
41451
|
+
deployJobOnlySecretEnvVars = (vars === null || vars === void 0 ? void 0 : vars.secret) ? (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys) : {};
|
|
41452
|
+
envVars = __assign(__assign({}, deployJobOnlySecretEnvVars), publicVars);
|
|
41453
|
+
return [2 /*return*/, {
|
|
41454
|
+
envVars: envVars,
|
|
41455
|
+
secretEnvVarKeys: secretEnvVarKeys
|
|
41456
|
+
}];
|
|
41457
|
+
});
|
|
41458
|
+
});
|
|
41459
|
+
};
|
|
41460
|
+
exports.transformJobOnlyVars = transformJobOnlyVars;
|
|
41461
|
+
|
|
41462
|
+
/***/ }),
|
|
41463
|
+
|
|
41464
|
+
/***/ 7185:
|
|
41465
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
41466
|
+
|
|
41467
|
+
"use strict";
|
|
41468
|
+
|
|
41469
|
+
|
|
41470
|
+
var __read = this && this.__read || function (o, n) {
|
|
41471
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
41472
|
+
if (!m) return o;
|
|
41473
|
+
var i = m.call(o),
|
|
41474
|
+
r,
|
|
41475
|
+
ar = [],
|
|
41476
|
+
e;
|
|
41477
|
+
try {
|
|
41478
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
41479
|
+
} catch (error) {
|
|
41480
|
+
e = {
|
|
41481
|
+
error: error
|
|
41482
|
+
};
|
|
41483
|
+
} finally {
|
|
41484
|
+
try {
|
|
41485
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
41486
|
+
} finally {
|
|
41487
|
+
if (e) throw e.error;
|
|
41488
|
+
}
|
|
41489
|
+
}
|
|
41490
|
+
return ar;
|
|
41491
|
+
};
|
|
41492
|
+
exports.__esModule = true;
|
|
41493
|
+
exports.makeSecretEnvVarMapping = exports.stringListToSecreteEnvVarList = exports.stringifyValues = void 0;
|
|
41494
|
+
var lodash_1 = __nccwpck_require__(3255);
|
|
41495
|
+
var getEnvironmentVariables_1 = __nccwpck_require__(6602);
|
|
41496
|
+
var stringifyValues = function (obj) {
|
|
41497
|
+
return Object.fromEntries(Object.entries(obj).map(function (_a) {
|
|
41498
|
+
var _b = __read(_a, 2),
|
|
41499
|
+
key = _b[0],
|
|
41500
|
+
value = _b[1];
|
|
41501
|
+
return [key, (0, lodash_1.isObject)(value) ? JSON.stringify(value) : "".concat(value)];
|
|
41502
|
+
}));
|
|
41503
|
+
};
|
|
41504
|
+
exports.stringifyValues = stringifyValues;
|
|
41505
|
+
var stringListToSecreteEnvVarList = function (keys) {
|
|
41506
|
+
return keys.map(function (key) {
|
|
41507
|
+
return {
|
|
41508
|
+
key: key
|
|
41509
|
+
};
|
|
41510
|
+
});
|
|
41511
|
+
};
|
|
41512
|
+
exports.stringListToSecreteEnvVarList = stringListToSecreteEnvVarList;
|
|
41513
|
+
var makeSecretEnvVarMapping = function (env, componentName, secretEnvVars) {
|
|
41514
|
+
return Object.fromEntries(secretEnvVars.map(function (_a) {
|
|
41515
|
+
var key = _a.key;
|
|
41516
|
+
return [key, "$".concat((0, getEnvironmentVariables_1.getSecretVarName)(env, componentName, key))];
|
|
41517
|
+
}));
|
|
41518
|
+
};
|
|
41519
|
+
exports.makeSecretEnvVarMapping = makeSecretEnvVarMapping;
|
|
41520
|
+
|
|
41521
|
+
/***/ }),
|
|
41522
|
+
|
|
41246
41523
|
/***/ 7383:
|
|
41247
41524
|
/***/ ((__unused_webpack_module, exports) => {
|
|
41248
41525
|
|
|
@@ -41324,7 +41601,7 @@ var getBaseDeploymentJob = function (context) {
|
|
|
41324
41601
|
}],
|
|
41325
41602
|
allow_failure: whenDeploy === "manual" ? true : false,
|
|
41326
41603
|
stage: "deploy",
|
|
41327
|
-
variables: __assign(__assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.componentConfig.deploy ? (_d = context.componentConfig.deploy.extraVars) !== null && _d !== void 0 ? _d : {} : {}),
|
|
41604
|
+
variables: __assign(__assign(__assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.environment.jobOnlyVars.deploy.envVars), context.componentConfig.deploy ? (_d = context.componentConfig.deploy.extraVars) !== null && _d !== void 0 ? _d : {} : {}),
|
|
41328
41605
|
environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
|
|
41329
41606
|
on_stop: exports.STOP_JOB_NAME,
|
|
41330
41607
|
auto_stop_in: autoStop
|
|
@@ -41346,7 +41623,7 @@ var getBaseDeploymentStopJob = function (context) {
|
|
|
41346
41623
|
when: "manual",
|
|
41347
41624
|
allow_failure: true
|
|
41348
41625
|
}],
|
|
41349
|
-
variables: __assign(__assign({}, DEPLOY_RUNNER_VARIABLES), {
|
|
41626
|
+
variables: __assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
|
|
41350
41627
|
GIT_STRATEGY: "none"
|
|
41351
41628
|
}),
|
|
41352
41629
|
stage: "stop",
|
|
@@ -41365,7 +41642,7 @@ var getBaseRollbackJob = function (context) {
|
|
|
41365
41642
|
when: "manual",
|
|
41366
41643
|
allow_failure: true
|
|
41367
41644
|
}],
|
|
41368
|
-
variables: __assign(__assign({}, DEPLOY_RUNNER_VARIABLES), {
|
|
41645
|
+
variables: __assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
|
|
41369
41646
|
GIT_STRATEGY: "none"
|
|
41370
41647
|
}),
|
|
41371
41648
|
stage: "rollback",
|