@catladder/cli 0.0.0-refactor-resolve-references-af020709 → 0.0.0-refactor-resolve-references-2-f2d2b81a
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/bundles/catenv/index.js +144 -85
- package/dist/bundles/cli/index.js +149 -85
- package/dist/cli/src/apps/catenv/types.d.ts +2 -1
- package/dist/cli/src/apps/catenv/utils.d.ts +0 -3
- package/dist/cli/src/apps/catenv/utils.js +5 -9
- package/dist/cli/src/apps/catenv/utils.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +1 -2
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +12 -12
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +6 -6
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.d.ts +3 -3
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/pipeline/src/bash/BashExpression.d.ts +0 -6
- package/dist/pipeline/src/bash/BashExpression.js +1 -19
- package/dist/pipeline/src/bash/BashExpression.js.map +1 -1
- package/dist/pipeline/src/bash/bashEscape.d.ts +10 -0
- package/dist/pipeline/src/bash/bashEscape.js +32 -0
- package/dist/pipeline/src/bash/bashEscape.js.map +1 -0
- package/dist/pipeline/src/bash/getInjectVarsScript.js +2 -2
- package/dist/pipeline/src/bash/getInjectVarsScript.js.map +1 -1
- package/dist/pipeline/src/bash/index.d.ts +2 -0
- package/dist/pipeline/src/bash/index.js +19 -0
- package/dist/pipeline/src/bash/index.js.map +1 -0
- package/dist/pipeline/src/build/base/writeDotEnv.js +3 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +3 -3
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +3 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.js +11 -9
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/{resolveReferences.js → translateLegacyFromComponents.js} +1 -1
- package/dist/pipeline/src/context/translateLegacyFromComponents.js.map +1 -0
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +2 -2
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/pipeline/src/index.d.ts +2 -0
- package/dist/pipeline/src/index.js +2 -0
- package/dist/pipeline/src/index.js.map +1 -1
- package/dist/pipeline/src/variables/VariableValueContainingReferences.d.ts +2 -1
- package/dist/pipeline/src/variables/VariableValueContainingReferences.js +3 -2
- package/dist/pipeline/src/variables/VariableValueContainingReferences.js.map +1 -1
- package/dist/pipeline/src/variables/{replaceAllReferences.d.ts → resolveAllReferences.d.ts} +1 -1
- package/dist/pipeline/src/variables/{replaceAllReferences.js → resolveAllReferences.js} +6 -6
- package/dist/pipeline/src/variables/{replaceAllReferences.js.map → resolveAllReferences.js.map} +1 -1
- package/dist/pipeline/src/variables/{replaceAllReferencesOnce.d.ts → resolveAllReferencesOnce.d.ts} +1 -1
- package/dist/pipeline/src/variables/{replaceAllReferencesOnce.js → resolveAllReferencesOnce.js} +6 -6
- package/dist/pipeline/src/variables/{replaceAllReferencesOnce.js.map → resolveAllReferencesOnce.js.map} +1 -1
- package/dist/pipeline/src/variables/{replaceReferencesOnce.d.ts → resolveReferencesOnce.d.ts} +2 -2
- package/dist/pipeline/src/variables/{replaceReferencesOnce.js → resolveReferencesOnce.js} +5 -5
- package/dist/pipeline/src/variables/{replaceReferencesOnce.js.map → resolveReferencesOnce.js.map} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/catenv/types.ts +3 -1
- package/src/apps/catenv/utils.ts +5 -10
- package/src/apps/catenv/writeDotEnvFiles.ts +2 -4
- package/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts +16 -10
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +5 -3
- package/src/config/getProjectConfig.ts +6 -2
- package/dist/pipeline/src/context/resolveReferences.js.map +0 -1
- /package/dist/pipeline/src/context/{resolveReferences.d.ts → translateLegacyFromComponents.d.ts} +0 -0
|
@@ -87,9 +87,10 @@ const makeExportKeyValuestring = (variables) => (0, utils_1.makeKeyValueString)(
|
|
|
87
87
|
"use strict";
|
|
88
88
|
|
|
89
89
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
90
|
-
exports.sanitizeEnvVarName = exports.
|
|
90
|
+
exports.sanitizeEnvVarName = exports.makeKeyValueString = exports.getCurrentComponentAndEnvFromChoice = exports.getComponentFullPath = void 0;
|
|
91
91
|
const path_1 = __nccwpck_require__(1017);
|
|
92
92
|
const projects_1 = __nccwpck_require__(9011);
|
|
93
|
+
const pipeline_1 = __nccwpck_require__(603);
|
|
93
94
|
const getComponentFullPath = (gitRoot, config, componentName) => {
|
|
94
95
|
return (0, path_1.join)(gitRoot, config.components[componentName].dir);
|
|
95
96
|
};
|
|
@@ -110,16 +111,11 @@ const getCurrentComponentAndEnvFromChoice = async (config, choice) => {
|
|
|
110
111
|
};
|
|
111
112
|
exports.getCurrentComponentAndEnvFromChoice = getCurrentComponentAndEnvFromChoice;
|
|
112
113
|
const makeKeyValueString = (variables, keyPrefix = "") => Object.entries(variables)
|
|
113
|
-
.map(
|
|
114
|
+
.map(
|
|
115
|
+
// double quotes seems not to work
|
|
116
|
+
([key, value]) => `${keyPrefix}${key}='${(0, pipeline_1.bashEscape)(value, "single")}'`)
|
|
114
117
|
.join("\n");
|
|
115
118
|
exports.makeKeyValueString = makeKeyValueString;
|
|
116
|
-
const sanitizeMultiLine = (variables) => {
|
|
117
|
-
return Object.fromEntries(Object.entries(variables).map(([key, value]) => [
|
|
118
|
-
key,
|
|
119
|
-
value.replaceAll("\n", "\\n"),
|
|
120
|
-
]));
|
|
121
|
-
};
|
|
122
|
-
exports.sanitizeMultiLine = sanitizeMultiLine;
|
|
123
119
|
const sanitizeEnvVarName = (name) => name.replace(/[\s\-.]+/g, "_");
|
|
124
120
|
exports.sanitizeEnvVarName = sanitizeEnvVarName;
|
|
125
121
|
//# sourceMappingURL=utils.js.map
|
|
@@ -155,8 +151,7 @@ const writeDotEnvFiles = async (config, choice) => {
|
|
|
155
151
|
const componentDir = (0, utils_1.getComponentFullPath)(gitRoot, config, componentName);
|
|
156
152
|
const filePath = (0, path_1.join)(componentDir, ".env");
|
|
157
153
|
// many .dotenv don't like multiline values, so we sanitize them here
|
|
158
|
-
|
|
159
|
-
await (0, pipeline_1.writeGeneratedFile)(filePath, (0, utils_1.makeKeyValueString)(variablesSanitized), {
|
|
154
|
+
await (0, pipeline_1.writeGeneratedFile)(filePath, (0, utils_1.makeKeyValueString)(variables), {
|
|
160
155
|
commentChar: "#",
|
|
161
156
|
});
|
|
162
157
|
}
|
|
@@ -751,13 +746,12 @@ exports.getProjectNamespace = getProjectNamespace;
|
|
|
751
746
|
/***/ }),
|
|
752
747
|
|
|
753
748
|
/***/ 2376:
|
|
754
|
-
/***/ ((__unused_webpack_module, exports
|
|
749
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
755
750
|
|
|
756
751
|
"use strict";
|
|
757
752
|
|
|
758
753
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
759
|
-
exports.
|
|
760
|
-
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
754
|
+
exports.joinBashExpressions = exports.getBashVariable = exports.BashExpression = void 0;
|
|
761
755
|
/**
|
|
762
756
|
* this class represents a string that can be evaluated in bash scripts.
|
|
763
757
|
*
|
|
@@ -821,24 +815,46 @@ const joinBashExpressions = (parts, joiner = "") => {
|
|
|
821
815
|
}
|
|
822
816
|
};
|
|
823
817
|
exports.joinBashExpressions = joinBashExpressions;
|
|
818
|
+
//# sourceMappingURL=BashExpression.js.map
|
|
819
|
+
|
|
820
|
+
/***/ }),
|
|
821
|
+
|
|
822
|
+
/***/ 2463:
|
|
823
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
824
|
+
|
|
825
|
+
"use strict";
|
|
826
|
+
|
|
827
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
828
|
+
exports.escapeSingleQuotes = exports.escapeDoubleQuotes = exports.escapeString = exports.bashEscape = void 0;
|
|
829
|
+
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
830
|
+
const BashExpression_1 = __nccwpck_require__(2376);
|
|
824
831
|
/**
|
|
825
832
|
* escapes a string or bash expression for bash
|
|
826
|
-
* it
|
|
833
|
+
* it either can escape single or double quotes (double is default)
|
|
827
834
|
*/
|
|
828
|
-
const bashEscape = (value) => {
|
|
829
|
-
if (value instanceof BashExpression) {
|
|
835
|
+
const bashEscape = (value, mode = "double") => {
|
|
836
|
+
if (value instanceof BashExpression_1.BashExpression) {
|
|
830
837
|
return value.toString(); // no need to escape bash expressions, as we want them to evaluate
|
|
831
838
|
}
|
|
832
839
|
if (value instanceof VariableValueContainingReferences_1.VariableValueContainingReferences) {
|
|
833
840
|
return value.toString({
|
|
834
|
-
|
|
841
|
+
escape: mode,
|
|
835
842
|
});
|
|
836
843
|
}
|
|
837
|
-
|
|
838
|
-
return value === null || value === void 0 ? void 0 : value.toString().replace(/"/g, '\\"');
|
|
844
|
+
return (0, exports.escapeString)(value, mode);
|
|
839
845
|
};
|
|
840
846
|
exports.bashEscape = bashEscape;
|
|
841
|
-
|
|
847
|
+
const escapeString = (value, mode = "double") => {
|
|
848
|
+
return mode === "double"
|
|
849
|
+
? (0, exports.escapeDoubleQuotes)(value)
|
|
850
|
+
: (0, exports.escapeSingleQuotes)(value);
|
|
851
|
+
};
|
|
852
|
+
exports.escapeString = escapeString;
|
|
853
|
+
const escapeDoubleQuotes = (value) => value === null || value === void 0 ? void 0 : value.toString().replace(/"/g, '\\"');
|
|
854
|
+
exports.escapeDoubleQuotes = escapeDoubleQuotes;
|
|
855
|
+
const escapeSingleQuotes = (value) => value === null || value === void 0 ? void 0 : value.toString().replace(/'/g, "\\'");
|
|
856
|
+
exports.escapeSingleQuotes = escapeSingleQuotes;
|
|
857
|
+
//# sourceMappingURL=bashEscape.js.map
|
|
842
858
|
|
|
843
859
|
/***/ }),
|
|
844
860
|
|
|
@@ -944,20 +960,46 @@ exports.writeBashYamlToFileScript = writeBashYamlToFileScript;
|
|
|
944
960
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
945
961
|
exports.getInjectVarsScript = void 0;
|
|
946
962
|
const lodash_1 = __nccwpck_require__(3255);
|
|
947
|
-
const
|
|
963
|
+
const bashEscape_1 = __nccwpck_require__(2463);
|
|
948
964
|
const getInjectVarsScript = (vars) => {
|
|
949
965
|
if (!vars)
|
|
950
966
|
return [];
|
|
951
967
|
// filter out null and undefined values
|
|
952
968
|
return Object.entries(vars)
|
|
953
969
|
.filter(([, value]) => !(0, lodash_1.isNil)(value))
|
|
954
|
-
.map(([key, value]) => `export ${key}="${value ? (0,
|
|
970
|
+
.map(([key, value]) => `export ${key}="${value ? (0, bashEscape_1.bashEscape)(value) : ""}"`);
|
|
955
971
|
};
|
|
956
972
|
exports.getInjectVarsScript = getInjectVarsScript;
|
|
957
973
|
//# sourceMappingURL=getInjectVarsScript.js.map
|
|
958
974
|
|
|
959
975
|
/***/ }),
|
|
960
976
|
|
|
977
|
+
/***/ 2990:
|
|
978
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
979
|
+
|
|
980
|
+
"use strict";
|
|
981
|
+
|
|
982
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
983
|
+
if (k2 === undefined) k2 = k;
|
|
984
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
985
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
986
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
987
|
+
}
|
|
988
|
+
Object.defineProperty(o, k2, desc);
|
|
989
|
+
}) : (function(o, m, k, k2) {
|
|
990
|
+
if (k2 === undefined) k2 = k;
|
|
991
|
+
o[k2] = m[k];
|
|
992
|
+
}));
|
|
993
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
994
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
995
|
+
};
|
|
996
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
997
|
+
__exportStar(__nccwpck_require__(2463), exports);
|
|
998
|
+
__exportStar(__nccwpck_require__(2376), exports);
|
|
999
|
+
//# sourceMappingURL=index.js.map
|
|
1000
|
+
|
|
1001
|
+
/***/ }),
|
|
1002
|
+
|
|
961
1003
|
/***/ 8774:
|
|
962
1004
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
963
1005
|
|
|
@@ -1251,6 +1293,7 @@ exports.componentContextNeedsBuildTimeDotEnv = exports.writeDotEnv = void 0;
|
|
|
1251
1293
|
const lodash_1 = __nccwpck_require__(3255);
|
|
1252
1294
|
const gitlab_1 = __nccwpck_require__(8490);
|
|
1253
1295
|
const getBuildInfoVariables_1 = __nccwpck_require__(7827);
|
|
1296
|
+
const bashEscape_1 = __nccwpck_require__(2463);
|
|
1254
1297
|
/**
|
|
1255
1298
|
* writes a .env file in the components folder
|
|
1256
1299
|
* @param context
|
|
@@ -1265,7 +1308,8 @@ const writeDotEnv = (context) => {
|
|
|
1265
1308
|
// filter out build variables, since they may interfer with caching like turbo
|
|
1266
1309
|
// build variables are rarely used anyway and we may treat them differently in the future
|
|
1267
1310
|
.filter(([key]) => !getBuildInfoVariables_1.ALL_BUILD_VARIABLES.includes(key))
|
|
1268
|
-
|
|
1311
|
+
// double quotes seems not to work in some cases
|
|
1312
|
+
.map(([key, value]) => `${key}='${(0, bashEscape_1.bashEscape)(value, "single")}'`)
|
|
1269
1313
|
.join("\n");
|
|
1270
1314
|
return (0, gitlab_1.collapseableSection)("write-dotenv-" + context.name, "write dot env")([
|
|
1271
1315
|
`cat <<EOF > ${context.build.dir}/.env
|
|
@@ -1294,7 +1338,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1294
1338
|
exports.createJobCacheFromConfig = exports.createJobCacheFromCacheConfigs = void 0;
|
|
1295
1339
|
const path_1 = __nccwpck_require__(1017);
|
|
1296
1340
|
const getAllCacheConfigsFromConfig_1 = __nccwpck_require__(673);
|
|
1297
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
1341
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
1298
1342
|
const createJobCacheFromCacheConfigs = (context, caches) => {
|
|
1299
1343
|
if (caches.length === 0)
|
|
1300
1344
|
return undefined;
|
|
@@ -1862,7 +1906,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1862
1906
|
exports.getWorkspaceDefaultCaches = exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
1863
1907
|
const lodash_1 = __nccwpck_require__(3255);
|
|
1864
1908
|
const path_1 = __nccwpck_require__(1017);
|
|
1865
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
1909
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
1866
1910
|
const getYarnCache = (context, policy = "pull-push") => {
|
|
1867
1911
|
const componentIsInWorkspace = context.type === "component" &&
|
|
1868
1912
|
context.packageManagerInfo.componentIsInWorkspace;
|
|
@@ -2211,7 +2255,7 @@ exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
|
|
|
2211
2255
|
|
|
2212
2256
|
/***/ }),
|
|
2213
2257
|
|
|
2214
|
-
/***/
|
|
2258
|
+
/***/ 5756:
|
|
2215
2259
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2216
2260
|
|
|
2217
2261
|
"use strict";
|
|
@@ -2279,7 +2323,7 @@ exports.createRailsBuildJobs = createRailsBuildJobs;
|
|
|
2279
2323
|
|
|
2280
2324
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2281
2325
|
exports.createRailsJobs = void 0;
|
|
2282
|
-
const build_1 = __nccwpck_require__(
|
|
2326
|
+
const build_1 = __nccwpck_require__(5756);
|
|
2283
2327
|
const test_1 = __nccwpck_require__(7910);
|
|
2284
2328
|
const createRailsJobs = (context) => {
|
|
2285
2329
|
return [...(0, test_1.createRailsTestJobs)(context), ...(0, build_1.createRailsBuildJobs)(context)];
|
|
@@ -2926,13 +2970,13 @@ const lodash_1 = __nccwpck_require__(3255);
|
|
|
2926
2970
|
const deploy_1 = __nccwpck_require__(8483);
|
|
2927
2971
|
const BashExpression_1 = __nccwpck_require__(2376);
|
|
2928
2972
|
const types_1 = __nccwpck_require__(4466);
|
|
2973
|
+
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
2974
|
+
const resolveAllReferences_1 = __nccwpck_require__(6305);
|
|
2929
2975
|
const getBuildInfoVariables_1 = __nccwpck_require__(7827);
|
|
2930
2976
|
const getEnvironmentContext_1 = __nccwpck_require__(3663);
|
|
2931
|
-
const
|
|
2977
|
+
const translateLegacyFromComponents_1 = __nccwpck_require__(7261);
|
|
2932
2978
|
const transformJobOnlyVars_1 = __nccwpck_require__(1552);
|
|
2933
|
-
const replaceAllReferences_1 = __nccwpck_require__(4035);
|
|
2934
2979
|
const envVars_1 = __nccwpck_require__(6296);
|
|
2935
|
-
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
2936
2980
|
const getBasePredefinedVariables = (ctx) => {
|
|
2937
2981
|
return {
|
|
2938
2982
|
ENV_SHORT: ctx.env,
|
|
@@ -2941,8 +2985,8 @@ const getBasePredefinedVariables = (ctx) => {
|
|
|
2941
2985
|
...(ctx.envType !== "local" ? (0, getBuildInfoVariables_1.getBuildInfoVariables)(ctx) : {}),
|
|
2942
2986
|
};
|
|
2943
2987
|
};
|
|
2944
|
-
const getEnvironmentVariables = async (ctx,
|
|
2945
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2988
|
+
const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
2989
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2946
2990
|
const environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
2947
2991
|
const { config, env, componentName } = ctx;
|
|
2948
2992
|
const { envConfigRaw, deployConfigRaw, buildConfigRaw, envType } = environmentContext;
|
|
@@ -3002,7 +3046,7 @@ const getEnvironmentVariables = async (ctx, shouldResolveReferences = true) => {
|
|
|
3002
3046
|
const secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
|
|
3003
3047
|
// this is deprecated, we now support: $componentname:FOO
|
|
3004
3048
|
const legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
|
|
3005
|
-
const publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0,
|
|
3049
|
+
const publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, translateLegacyFromComponents_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
3006
3050
|
const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
|
|
3007
3051
|
const publicEnvVarsUnresolved = Object.fromEntries(Object.entries(publicEnvVarsRawSanitized).map(([key, value]) => [
|
|
3008
3052
|
key,
|
|
@@ -3010,12 +3054,14 @@ const getEnvironmentVariables = async (ctx, shouldResolveReferences = true) => {
|
|
|
3010
3054
|
componentName: ctx.componentName,
|
|
3011
3055
|
}),
|
|
3012
3056
|
]));
|
|
3013
|
-
const publicEnvVars = shouldResolveReferences
|
|
3014
|
-
? await (0,
|
|
3057
|
+
const publicEnvVars = ((_k = options.shouldResolveReferences) !== null && _k !== void 0 ? _k : true)
|
|
3058
|
+
? await (0, resolveAllReferences_1.resolveAllReferences)(publicEnvVarsUnresolved, async (otherComponentName) => {
|
|
3015
3059
|
const { envVars: otherEnvVars } = await (0, exports.getEnvironmentVariables)({
|
|
3016
3060
|
...ctx,
|
|
3017
3061
|
componentName: otherComponentName,
|
|
3018
|
-
},
|
|
3062
|
+
}, {
|
|
3063
|
+
shouldResolveReferences: false, // we already do this here with replaceAllReferences recursivly until re replaced all
|
|
3064
|
+
});
|
|
3019
3065
|
return otherEnvVars;
|
|
3020
3066
|
})
|
|
3021
3067
|
: publicEnvVarsUnresolved;
|
|
@@ -3062,7 +3108,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3062
3108
|
};
|
|
3063
3109
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3064
3110
|
exports.getLabels = void 0;
|
|
3065
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
3111
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
3066
3112
|
const sanitize = (value) => {
|
|
3067
3113
|
if (!value)
|
|
3068
3114
|
return value;
|
|
@@ -3141,26 +3187,6 @@ __exportStar(__nccwpck_require__(5133), exports);
|
|
|
3141
3187
|
|
|
3142
3188
|
/***/ }),
|
|
3143
3189
|
|
|
3144
|
-
/***/ 3115:
|
|
3145
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
3146
|
-
|
|
3147
|
-
"use strict";
|
|
3148
|
-
|
|
3149
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3150
|
-
exports.translateLegacyFromComponents = void 0;
|
|
3151
|
-
const translateLegacyFromComponents = (fromComponents) => {
|
|
3152
|
-
return Object.fromEntries(Object.entries(fromComponents).flatMap(([componentName, variables]) => {
|
|
3153
|
-
return Object.entries(variables).map(([ourName, otherName]) => [
|
|
3154
|
-
ourName,
|
|
3155
|
-
"${" + componentName + ":" + otherName + "}",
|
|
3156
|
-
]);
|
|
3157
|
-
}));
|
|
3158
|
-
};
|
|
3159
|
-
exports.translateLegacyFromComponents = translateLegacyFromComponents;
|
|
3160
|
-
//# sourceMappingURL=resolveReferences.js.map
|
|
3161
|
-
|
|
3162
|
-
/***/ }),
|
|
3163
|
-
|
|
3164
3190
|
/***/ 1552:
|
|
3165
3191
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3166
3192
|
|
|
@@ -3203,6 +3229,26 @@ exports.transformJobOnlyVars = transformJobOnlyVars;
|
|
|
3203
3229
|
|
|
3204
3230
|
/***/ }),
|
|
3205
3231
|
|
|
3232
|
+
/***/ 7261:
|
|
3233
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
3234
|
+
|
|
3235
|
+
"use strict";
|
|
3236
|
+
|
|
3237
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3238
|
+
exports.translateLegacyFromComponents = void 0;
|
|
3239
|
+
const translateLegacyFromComponents = (fromComponents) => {
|
|
3240
|
+
return Object.fromEntries(Object.entries(fromComponents).flatMap(([componentName, variables]) => {
|
|
3241
|
+
return Object.entries(variables).map(([ourName, otherName]) => [
|
|
3242
|
+
ourName,
|
|
3243
|
+
"${" + componentName + ":" + otherName + "}",
|
|
3244
|
+
]);
|
|
3245
|
+
}));
|
|
3246
|
+
};
|
|
3247
|
+
exports.translateLegacyFromComponents = translateLegacyFromComponents;
|
|
3248
|
+
//# sourceMappingURL=translateLegacyFromComponents.js.map
|
|
3249
|
+
|
|
3250
|
+
/***/ }),
|
|
3251
|
+
|
|
3206
3252
|
/***/ 6296:
|
|
3207
3253
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3208
3254
|
|
|
@@ -3998,15 +4044,15 @@ exports.getCloudRunDeployScripts = void 0;
|
|
|
3998
4044
|
const lodash_1 = __nccwpck_require__(3255);
|
|
3999
4045
|
const gitlab_1 = __nccwpck_require__(8490);
|
|
4000
4046
|
const sbom_1 = __nccwpck_require__(4986);
|
|
4047
|
+
const __1 = __nccwpck_require__(2674);
|
|
4048
|
+
const bashYaml_1 = __nccwpck_require__(4660);
|
|
4001
4049
|
const cleanup_1 = __nccwpck_require__(7888);
|
|
4002
4050
|
const database_1 = __nccwpck_require__(8206);
|
|
4003
4051
|
const gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(6320);
|
|
4004
4052
|
const cloudRunJobs_1 = __nccwpck_require__(1224);
|
|
4005
4053
|
const cloudRunServices_1 = __nccwpck_require__(7334);
|
|
4006
4054
|
const common_1 = __nccwpck_require__(3325);
|
|
4007
|
-
const __1 = __nccwpck_require__(2674);
|
|
4008
4055
|
const constants_1 = __nccwpck_require__(8865);
|
|
4009
|
-
const bashYaml_1 = __nccwpck_require__(4660);
|
|
4010
4056
|
function getCloudRunDeployScripts(context) {
|
|
4011
4057
|
var _a;
|
|
4012
4058
|
const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
@@ -4796,7 +4842,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4796
4842
|
};
|
|
4797
4843
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4798
4844
|
exports.KUBERNETES_DEPLOY_TYPE = void 0;
|
|
4799
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
4845
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
4800
4846
|
const __1 = __nccwpck_require__(8483);
|
|
4801
4847
|
const BashExpression_1 = __nccwpck_require__(2376);
|
|
4802
4848
|
const additionalSecretKeys_1 = __nccwpck_require__(436);
|
|
@@ -5288,6 +5334,8 @@ __exportStar(__nccwpck_require__(5875), exports);
|
|
|
5288
5334
|
__exportStar(__nccwpck_require__(7862), exports);
|
|
5289
5335
|
__exportStar(__nccwpck_require__(8483), exports);
|
|
5290
5336
|
__exportStar(__nccwpck_require__(2228), exports);
|
|
5337
|
+
__exportStar(__nccwpck_require__(1619), exports);
|
|
5338
|
+
__exportStar(__nccwpck_require__(2990), exports);
|
|
5291
5339
|
//# sourceMappingURL=index.js.map
|
|
5292
5340
|
|
|
5293
5341
|
/***/ }),
|
|
@@ -6601,13 +6649,24 @@ exports.writeYamlfile = writeYamlfile;
|
|
|
6601
6649
|
|
|
6602
6650
|
/***/ }),
|
|
6603
6651
|
|
|
6604
|
-
/***/
|
|
6652
|
+
/***/ 1619:
|
|
6605
6653
|
/***/ ((__unused_webpack_module, exports) => {
|
|
6606
6654
|
|
|
6607
6655
|
"use strict";
|
|
6608
6656
|
|
|
6657
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6658
|
+
//# sourceMappingURL=VariableValue.js.map
|
|
6659
|
+
|
|
6660
|
+
/***/ }),
|
|
6661
|
+
|
|
6662
|
+
/***/ 1592:
|
|
6663
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6664
|
+
|
|
6665
|
+
"use strict";
|
|
6666
|
+
|
|
6609
6667
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6610
6668
|
exports.createVariableValueContainingReferencesFromString = exports.VariableValueContainingReferences = exports.VariableReference = exports.UnresolvableReference = void 0;
|
|
6669
|
+
const bashEscape_1 = __nccwpck_require__(2463);
|
|
6611
6670
|
class UnresolvableReference {
|
|
6612
6671
|
constructor(reference) {
|
|
6613
6672
|
this.reference = reference;
|
|
@@ -6635,11 +6694,11 @@ class VariableValueContainingReferences {
|
|
|
6635
6694
|
? []
|
|
6636
6695
|
: [part]);
|
|
6637
6696
|
}
|
|
6638
|
-
toString(options = {
|
|
6697
|
+
toString(options = { escape: false }) {
|
|
6639
6698
|
return this.parts
|
|
6640
6699
|
.map((part) => {
|
|
6641
6700
|
if (typeof part === "string") {
|
|
6642
|
-
return options.
|
|
6701
|
+
return options.escape ? (0, bashEscape_1.escapeString)(part, options.escape) : part;
|
|
6643
6702
|
}
|
|
6644
6703
|
else {
|
|
6645
6704
|
return part.toString();
|
|
@@ -6670,21 +6729,21 @@ exports.createVariableValueContainingReferencesFromString = createVariableValueC
|
|
|
6670
6729
|
|
|
6671
6730
|
/***/ }),
|
|
6672
6731
|
|
|
6673
|
-
/***/
|
|
6732
|
+
/***/ 6305:
|
|
6674
6733
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6675
6734
|
|
|
6676
6735
|
"use strict";
|
|
6677
6736
|
|
|
6678
6737
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6679
|
-
exports.
|
|
6738
|
+
exports.resolveAllReferences = void 0;
|
|
6680
6739
|
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
6681
|
-
const
|
|
6682
|
-
const
|
|
6740
|
+
const resolveAllReferencesOnce_1 = __nccwpck_require__(9554);
|
|
6741
|
+
const resolveAllReferences = async (values, getEnvVars) => {
|
|
6683
6742
|
// replace until there aren't any references left
|
|
6684
6743
|
let result = values;
|
|
6685
6744
|
let i = 0;
|
|
6686
6745
|
while (Object.values(result).some((value) => value.parts.some((part) => part instanceof VariableValueContainingReferences_1.VariableReference))) {
|
|
6687
|
-
const replaced = await (0,
|
|
6746
|
+
const replaced = await (0, resolveAllReferencesOnce_1.resolveAllReferencesOnce)(result, getEnvVars);
|
|
6688
6747
|
result = replaced;
|
|
6689
6748
|
i++;
|
|
6690
6749
|
if (i > 1000) {
|
|
@@ -6697,21 +6756,21 @@ const replaceAllReferences = async (values, getEnvVars) => {
|
|
|
6697
6756
|
}
|
|
6698
6757
|
return result;
|
|
6699
6758
|
};
|
|
6700
|
-
exports.
|
|
6701
|
-
//# sourceMappingURL=
|
|
6759
|
+
exports.resolveAllReferences = resolveAllReferences;
|
|
6760
|
+
//# sourceMappingURL=resolveAllReferences.js.map
|
|
6702
6761
|
|
|
6703
6762
|
/***/ }),
|
|
6704
6763
|
|
|
6705
|
-
/***/
|
|
6764
|
+
/***/ 9554:
|
|
6706
6765
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6707
6766
|
|
|
6708
6767
|
"use strict";
|
|
6709
6768
|
|
|
6710
6769
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6711
|
-
exports.
|
|
6770
|
+
exports.resolveAllReferencesOnce = void 0;
|
|
6712
6771
|
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
6713
|
-
const
|
|
6714
|
-
const
|
|
6772
|
+
const resolveReferencesOnce_1 = __nccwpck_require__(8749);
|
|
6773
|
+
const resolveAllReferencesOnce = async (values, getEnvVars) => {
|
|
6715
6774
|
const allReferences = Object.values(values).flatMap((value) => value === null || value === void 0 ? void 0 : value.parts.filter((part) => part instanceof VariableValueContainingReferences_1.VariableReference));
|
|
6716
6775
|
const allComponentsUnique = Array.from(new Set(allReferences.map((reference) => reference.componentName)));
|
|
6717
6776
|
const allEnvVarsInComponents = Object.fromEntries(await Promise.all(allComponentsUnique.map(async (componentName) => [
|
|
@@ -6721,29 +6780,29 @@ const replaceAllReferencesOnce = async (values, getEnvVars) => {
|
|
|
6721
6780
|
return Object.fromEntries(Object.entries(values).map(([key, value]) => [
|
|
6722
6781
|
key,
|
|
6723
6782
|
value !== null && value !== undefined
|
|
6724
|
-
? (0,
|
|
6783
|
+
? (0, resolveReferencesOnce_1.resolveReferencesOnce)(value, ({ componentName, variableName }) => {
|
|
6725
6784
|
return allEnvVarsInComponents[componentName][variableName];
|
|
6726
6785
|
})
|
|
6727
6786
|
: value,
|
|
6728
6787
|
]));
|
|
6729
6788
|
};
|
|
6730
|
-
exports.
|
|
6731
|
-
//# sourceMappingURL=
|
|
6789
|
+
exports.resolveAllReferencesOnce = resolveAllReferencesOnce;
|
|
6790
|
+
//# sourceMappingURL=resolveAllReferencesOnce.js.map
|
|
6732
6791
|
|
|
6733
6792
|
/***/ }),
|
|
6734
6793
|
|
|
6735
|
-
/***/
|
|
6794
|
+
/***/ 8749:
|
|
6736
6795
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6737
6796
|
|
|
6738
6797
|
"use strict";
|
|
6739
6798
|
|
|
6740
6799
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6741
|
-
exports.
|
|
6800
|
+
exports.resolveReferencesOnce = void 0;
|
|
6742
6801
|
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
6743
|
-
const
|
|
6802
|
+
const resolveReferencesOnce = (value, resolver) => {
|
|
6744
6803
|
const replacedParts = value.parts.map((part) => {
|
|
6745
6804
|
if (part instanceof VariableValueContainingReferences_1.VariableReference) {
|
|
6746
|
-
const result =
|
|
6805
|
+
const result = resolver({
|
|
6747
6806
|
componentName: part.componentName,
|
|
6748
6807
|
variableName: part.variableName,
|
|
6749
6808
|
});
|
|
@@ -6755,8 +6814,8 @@ const replaceReferencesOnce = (value, replacer) => {
|
|
|
6755
6814
|
});
|
|
6756
6815
|
return new VariableValueContainingReferences_1.VariableValueContainingReferences(replacedParts);
|
|
6757
6816
|
};
|
|
6758
|
-
exports.
|
|
6759
|
-
//# sourceMappingURL=
|
|
6817
|
+
exports.resolveReferencesOnce = resolveReferencesOnce;
|
|
6818
|
+
//# sourceMappingURL=resolveReferencesOnce.js.map
|
|
6760
6819
|
|
|
6761
6820
|
/***/ }),
|
|
6762
6821
|
|
|
@@ -39879,7 +39938,7 @@ module.exports = safer
|
|
|
39879
39938
|
|
|
39880
39939
|
/***/ }),
|
|
39881
39940
|
|
|
39882
|
-
/***/
|
|
39941
|
+
/***/ 4035:
|
|
39883
39942
|
/***/ (function(module) {
|
|
39884
39943
|
|
|
39885
39944
|
|