@catladder/cli 0.0.0-refactor-resolve-references-862e93ac → 0.0.0-refactor-resolve-references-next-14821f39
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 +183 -265
- package/dist/bundles/cli/index.js +184 -263
- package/dist/cli/src/apps/catenv/printVariables.js +4 -2
- package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
- 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 +2 -3
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.js +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.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/createAppBuildJob.js +2 -3
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +5 -2
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.js +10 -11
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +3 -3
- package/dist/pipeline/src/build/node/buildJob.js +1 -1
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.d.ts +1 -3
- package/dist/pipeline/src/build/node/cache.js +1 -27
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.js +10 -11
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.js +0 -1
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.js +7 -8
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/types.d.ts +0 -10
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/context/createComponentContext.js +0 -1
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironment.js +0 -1
- package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +5 -6
- package/dist/pipeline/src/context/getEnvironmentVariables.js +17 -26
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +3 -4
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- 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/index.js +2 -2
- package/dist/pipeline/src/deploy/cloudRun/index.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +3 -15
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +0 -2
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.js +2 -2
- package/dist/pipeline/src/deploy/kubernetes/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +3 -4
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +2 -3
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
- package/dist/pipeline/src/deploy/types/base.d.ts +0 -6
- package/dist/pipeline/src/deploy/types/kubernetes.d.ts +1 -34
- 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/pipeline/gitlab/createGitlabJobs.js +2 -4
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/types/config.d.ts +3 -9
- package/dist/pipeline/src/types/context.d.ts +0 -8
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/pipeline/src/types/jobs.d.ts +0 -8
- package/dist/pipeline/src/utils/writeFiles.js +1 -5
- package/dist/pipeline/src/utils/writeFiles.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/printVariables.ts +2 -2
- package/src/apps/catenv/types.ts +3 -1
- package/src/apps/catenv/utils.ts +5 -10
- package/src/apps/catenv/writeDotEnvFiles.ts +3 -5
- package/src/apps/catenv/writeEnvDTs.ts +1 -1
- 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.d.ts +0 -3
- package/dist/pipeline/src/context/resolveReferences.js +0 -13
- package/dist/pipeline/src/context/resolveReferences.js.map +0 -1
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.d.ts +0 -85
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js +0 -27
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js.map +0 -1
- package/dist/pipeline/src/packageInfos.d.ts +0 -4
- package/dist/pipeline/src/packageInfos.js +0 -17
- package/dist/pipeline/src/packageInfos.js.map +0 -1
|
@@ -40,10 +40,11 @@ exports.printVariables = void 0;
|
|
|
40
40
|
const getProjectConfig_1 = __nccwpck_require__(5264);
|
|
41
41
|
const utils_1 = __nccwpck_require__(4560);
|
|
42
42
|
const getAllVariablesToPrint = async (config, choice) => {
|
|
43
|
+
var _a;
|
|
43
44
|
const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
|
|
44
45
|
if (currentComponent) {
|
|
45
46
|
// don't print vars if dotenv is enabled
|
|
46
|
-
if (config.components[currentComponent].dotEnv) {
|
|
47
|
+
if ((_a = config.components[currentComponent].dotEnv) !== null && _a !== void 0 ? _a : true) {
|
|
47
48
|
return {};
|
|
48
49
|
}
|
|
49
50
|
return await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, currentComponent);
|
|
@@ -53,8 +54,9 @@ const getAllVariablesToPrint = async (config, choice) => {
|
|
|
53
54
|
// this is not 100% correct, but better than not exporting any vars at all
|
|
54
55
|
// so we also add prefixed variants
|
|
55
56
|
return await Object.keys(config.components).reduce(async (acc, componentName) => {
|
|
57
|
+
var _a;
|
|
56
58
|
// don't print vars if dotenv is enabled
|
|
57
|
-
if (config.components[componentName].dotEnv) {
|
|
59
|
+
if ((_a = config.components[componentName].dotEnv) !== null && _a !== void 0 ? _a : true) {
|
|
58
60
|
return await acc;
|
|
59
61
|
}
|
|
60
62
|
const subappvars = await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, componentName);
|
|
@@ -87,9 +89,10 @@ const makeExportKeyValuestring = (variables) => (0, utils_1.makeKeyValueString)(
|
|
|
87
89
|
"use strict";
|
|
88
90
|
|
|
89
91
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
90
|
-
exports.sanitizeEnvVarName = exports.
|
|
92
|
+
exports.sanitizeEnvVarName = exports.makeKeyValueString = exports.getCurrentComponentAndEnvFromChoice = exports.getComponentFullPath = void 0;
|
|
91
93
|
const path_1 = __nccwpck_require__(1017);
|
|
92
94
|
const projects_1 = __nccwpck_require__(9011);
|
|
95
|
+
const pipeline_1 = __nccwpck_require__(603);
|
|
93
96
|
const getComponentFullPath = (gitRoot, config, componentName) => {
|
|
94
97
|
return (0, path_1.join)(gitRoot, config.components[componentName].dir);
|
|
95
98
|
};
|
|
@@ -110,16 +113,11 @@ const getCurrentComponentAndEnvFromChoice = async (config, choice) => {
|
|
|
110
113
|
};
|
|
111
114
|
exports.getCurrentComponentAndEnvFromChoice = getCurrentComponentAndEnvFromChoice;
|
|
112
115
|
const makeKeyValueString = (variables, keyPrefix = "") => Object.entries(variables)
|
|
113
|
-
.map(
|
|
116
|
+
.map(
|
|
117
|
+
// double quotes seems not to work
|
|
118
|
+
([key, value]) => `${keyPrefix}${key}='${(0, pipeline_1.bashEscape)(value, "single")}'`)
|
|
114
119
|
.join("\n");
|
|
115
120
|
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
121
|
const sanitizeEnvVarName = (name) => name.replace(/[\s\-.]+/g, "_");
|
|
124
122
|
exports.sanitizeEnvVarName = sanitizeEnvVarName;
|
|
125
123
|
//# sourceMappingURL=utils.js.map
|
|
@@ -141,7 +139,7 @@ const utils_1 = __nccwpck_require__(4560);
|
|
|
141
139
|
const writeDotEnvFiles = async (config, choice) => {
|
|
142
140
|
const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
|
|
143
141
|
const componentsWithEnabledDotEnvWrite = Object.entries(config.components)
|
|
144
|
-
.filter(([, component]) => component === null || component === void 0 ? void 0 : component.dotEnv) // when set to true or "local"
|
|
142
|
+
.filter(([, component]) => { var _a; return (_a = component === null || component === void 0 ? void 0 : component.dotEnv) !== null && _a !== void 0 ? _a : true; }) // when set to true or "local"
|
|
145
143
|
.map(([componentName]) => componentName);
|
|
146
144
|
const componentsToActuallyWriteDotEnvNow = currentComponent
|
|
147
145
|
? componentsWithEnabledDotEnvWrite.includes(currentComponent)
|
|
@@ -155,8 +153,7 @@ const writeDotEnvFiles = async (config, choice) => {
|
|
|
155
153
|
const componentDir = (0, utils_1.getComponentFullPath)(gitRoot, config, componentName);
|
|
156
154
|
const filePath = (0, path_1.join)(componentDir, ".env");
|
|
157
155
|
// 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), {
|
|
156
|
+
await (0, pipeline_1.writeGeneratedFile)(filePath, (0, utils_1.makeKeyValueString)(variables), {
|
|
160
157
|
commentChar: "#",
|
|
161
158
|
});
|
|
162
159
|
}
|
|
@@ -181,7 +178,7 @@ const utils_1 = __nccwpck_require__(4560);
|
|
|
181
178
|
const writeDTsFiles = async (config, choice) => {
|
|
182
179
|
const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
|
|
183
180
|
const componentsWithEnabledEnvDTsWrite = Object.entries(config.components)
|
|
184
|
-
.filter(([, component]) => component === null || component === void 0 ? void 0 : component.envDTs)
|
|
181
|
+
.filter(([, component]) => { var _a; return (_a = component === null || component === void 0 ? void 0 : component.envDTs) !== null && _a !== void 0 ? _a : true; })
|
|
185
182
|
.map(([componentName]) => componentName);
|
|
186
183
|
const componentsToActuallyWriteEnvDts = currentComponent
|
|
187
184
|
? componentsWithEnabledEnvDTsWrite.includes(currentComponent)
|
|
@@ -751,13 +748,12 @@ exports.getProjectNamespace = getProjectNamespace;
|
|
|
751
748
|
/***/ }),
|
|
752
749
|
|
|
753
750
|
/***/ 2376:
|
|
754
|
-
/***/ ((__unused_webpack_module, exports
|
|
751
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
755
752
|
|
|
756
753
|
"use strict";
|
|
757
754
|
|
|
758
755
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
759
|
-
exports.
|
|
760
|
-
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
756
|
+
exports.joinBashExpressions = exports.getBashVariable = exports.BashExpression = void 0;
|
|
761
757
|
/**
|
|
762
758
|
* this class represents a string that can be evaluated in bash scripts.
|
|
763
759
|
*
|
|
@@ -821,24 +817,46 @@ const joinBashExpressions = (parts, joiner = "") => {
|
|
|
821
817
|
}
|
|
822
818
|
};
|
|
823
819
|
exports.joinBashExpressions = joinBashExpressions;
|
|
820
|
+
//# sourceMappingURL=BashExpression.js.map
|
|
821
|
+
|
|
822
|
+
/***/ }),
|
|
823
|
+
|
|
824
|
+
/***/ 2463:
|
|
825
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
826
|
+
|
|
827
|
+
"use strict";
|
|
828
|
+
|
|
829
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
830
|
+
exports.escapeSingleQuotes = exports.escapeDoubleQuotes = exports.escapeString = exports.bashEscape = void 0;
|
|
831
|
+
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
832
|
+
const BashExpression_1 = __nccwpck_require__(2376);
|
|
824
833
|
/**
|
|
825
834
|
* escapes a string or bash expression for bash
|
|
826
|
-
* it
|
|
835
|
+
* it either can escape single or double quotes (double is default)
|
|
827
836
|
*/
|
|
828
|
-
const bashEscape = (value) => {
|
|
829
|
-
if (value instanceof BashExpression) {
|
|
837
|
+
const bashEscape = (value, mode = "double") => {
|
|
838
|
+
if (value instanceof BashExpression_1.BashExpression) {
|
|
830
839
|
return value.toString(); // no need to escape bash expressions, as we want them to evaluate
|
|
831
840
|
}
|
|
832
841
|
if (value instanceof VariableValueContainingReferences_1.VariableValueContainingReferences) {
|
|
833
842
|
return value.toString({
|
|
834
|
-
|
|
843
|
+
escape: mode,
|
|
835
844
|
});
|
|
836
845
|
}
|
|
837
|
-
|
|
838
|
-
return value === null || value === void 0 ? void 0 : value.toString().replace(/"/g, '\\"');
|
|
846
|
+
return (0, exports.escapeString)(value, mode);
|
|
839
847
|
};
|
|
840
848
|
exports.bashEscape = bashEscape;
|
|
841
|
-
|
|
849
|
+
const escapeString = (value, mode = "double") => {
|
|
850
|
+
return mode === "double"
|
|
851
|
+
? (0, exports.escapeDoubleQuotes)(value)
|
|
852
|
+
: (0, exports.escapeSingleQuotes)(value);
|
|
853
|
+
};
|
|
854
|
+
exports.escapeString = escapeString;
|
|
855
|
+
const escapeDoubleQuotes = (value) => value === null || value === void 0 ? void 0 : value.toString().replace(/"/g, '\\"');
|
|
856
|
+
exports.escapeDoubleQuotes = escapeDoubleQuotes;
|
|
857
|
+
const escapeSingleQuotes = (value) => value === null || value === void 0 ? void 0 : value.toString().replace(/'/g, "\\'");
|
|
858
|
+
exports.escapeSingleQuotes = escapeSingleQuotes;
|
|
859
|
+
//# sourceMappingURL=bashEscape.js.map
|
|
842
860
|
|
|
843
861
|
/***/ }),
|
|
844
862
|
|
|
@@ -944,20 +962,46 @@ exports.writeBashYamlToFileScript = writeBashYamlToFileScript;
|
|
|
944
962
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
945
963
|
exports.getInjectVarsScript = void 0;
|
|
946
964
|
const lodash_1 = __nccwpck_require__(3255);
|
|
947
|
-
const
|
|
965
|
+
const bashEscape_1 = __nccwpck_require__(2463);
|
|
948
966
|
const getInjectVarsScript = (vars) => {
|
|
949
967
|
if (!vars)
|
|
950
968
|
return [];
|
|
951
969
|
// filter out null and undefined values
|
|
952
970
|
return Object.entries(vars)
|
|
953
971
|
.filter(([, value]) => !(0, lodash_1.isNil)(value))
|
|
954
|
-
.map(([key, value]) => `export ${key}="${value ? (0,
|
|
972
|
+
.map(([key, value]) => `export ${key}="${value ? (0, bashEscape_1.bashEscape)(value) : ""}"`);
|
|
955
973
|
};
|
|
956
974
|
exports.getInjectVarsScript = getInjectVarsScript;
|
|
957
975
|
//# sourceMappingURL=getInjectVarsScript.js.map
|
|
958
976
|
|
|
959
977
|
/***/ }),
|
|
960
978
|
|
|
979
|
+
/***/ 2990:
|
|
980
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
981
|
+
|
|
982
|
+
"use strict";
|
|
983
|
+
|
|
984
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
985
|
+
if (k2 === undefined) k2 = k;
|
|
986
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
987
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
988
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
989
|
+
}
|
|
990
|
+
Object.defineProperty(o, k2, desc);
|
|
991
|
+
}) : (function(o, m, k, k2) {
|
|
992
|
+
if (k2 === undefined) k2 = k;
|
|
993
|
+
o[k2] = m[k];
|
|
994
|
+
}));
|
|
995
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
996
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
997
|
+
};
|
|
998
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
999
|
+
__exportStar(__nccwpck_require__(2463), exports);
|
|
1000
|
+
__exportStar(__nccwpck_require__(2376), exports);
|
|
1001
|
+
//# sourceMappingURL=index.js.map
|
|
1002
|
+
|
|
1003
|
+
/***/ }),
|
|
1004
|
+
|
|
961
1005
|
/***/ 8774:
|
|
962
1006
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
963
1007
|
|
|
@@ -1049,7 +1093,7 @@ const constants_1 = __nccwpck_require__(2786);
|
|
|
1049
1093
|
const writeBuildInfo_1 = __nccwpck_require__(9578);
|
|
1050
1094
|
const writeDotEnv_1 = __nccwpck_require__(8052);
|
|
1051
1095
|
const createAppBuildJob = (context, { script, variables, runnerVariables, cache, ...def }) => {
|
|
1052
|
-
var _a
|
|
1096
|
+
var _a;
|
|
1053
1097
|
return (0, lodash_1.merge)({
|
|
1054
1098
|
name: constants_1.APP_BUILD_JOB_NAME,
|
|
1055
1099
|
envMode: "jobPerEnv",
|
|
@@ -1063,14 +1107,13 @@ const createAppBuildJob = (context, { script, variables, runnerVariables, cache,
|
|
|
1063
1107
|
? {
|
|
1064
1108
|
...context.environment.envVars,
|
|
1065
1109
|
...context.environment.jobOnlyVars.build.envVars,
|
|
1066
|
-
...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
1067
1110
|
}
|
|
1068
1111
|
: {}),
|
|
1069
1112
|
},
|
|
1070
1113
|
runnerVariables: {
|
|
1071
1114
|
...constants_1.RUNNER_BUILD_RESOURCE_VARIABLES,
|
|
1072
1115
|
...(runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}),
|
|
1073
|
-
...((
|
|
1116
|
+
...((_a = context.build.config.runnerVariables) !== null && _a !== void 0 ? _a : {}),
|
|
1074
1117
|
},
|
|
1075
1118
|
script: [
|
|
1076
1119
|
...(context.type === "component"
|
|
@@ -1251,6 +1294,7 @@ exports.componentContextNeedsBuildTimeDotEnv = exports.writeDotEnv = void 0;
|
|
|
1251
1294
|
const lodash_1 = __nccwpck_require__(3255);
|
|
1252
1295
|
const gitlab_1 = __nccwpck_require__(8490);
|
|
1253
1296
|
const getBuildInfoVariables_1 = __nccwpck_require__(7827);
|
|
1297
|
+
const bashEscape_1 = __nccwpck_require__(2463);
|
|
1254
1298
|
/**
|
|
1255
1299
|
* writes a .env file in the components folder
|
|
1256
1300
|
* @param context
|
|
@@ -1265,7 +1309,8 @@ const writeDotEnv = (context) => {
|
|
|
1265
1309
|
// filter out build variables, since they may interfer with caching like turbo
|
|
1266
1310
|
// build variables are rarely used anyway and we may treat them differently in the future
|
|
1267
1311
|
.filter(([key]) => !getBuildInfoVariables_1.ALL_BUILD_VARIABLES.includes(key))
|
|
1268
|
-
|
|
1312
|
+
// double quotes seems not to work in some cases
|
|
1313
|
+
.map(([key, value]) => `${key}='${(0, bashEscape_1.bashEscape)(value, "single")}'`)
|
|
1269
1314
|
.join("\n");
|
|
1270
1315
|
return (0, gitlab_1.collapseableSection)("write-dotenv-" + context.name, "write dot env")([
|
|
1271
1316
|
`cat <<EOF > ${context.build.dir}/.env
|
|
@@ -1275,7 +1320,8 @@ EOF`,
|
|
|
1275
1320
|
};
|
|
1276
1321
|
exports.writeDotEnv = writeDotEnv;
|
|
1277
1322
|
const componentContextNeedsBuildTimeDotEnv = (context) => {
|
|
1278
|
-
|
|
1323
|
+
var _a;
|
|
1324
|
+
return ((_a = context.componentConfig.dotEnv) !== null && _a !== void 0 ? _a : true) === true; // don't build when set to `local`
|
|
1279
1325
|
};
|
|
1280
1326
|
exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDotEnv;
|
|
1281
1327
|
//# sourceMappingURL=writeDotEnv.js.map
|
|
@@ -1294,7 +1340,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1294
1340
|
exports.createJobCacheFromConfig = exports.createJobCacheFromCacheConfigs = void 0;
|
|
1295
1341
|
const path_1 = __nccwpck_require__(1017);
|
|
1296
1342
|
const getAllCacheConfigsFromConfig_1 = __nccwpck_require__(673);
|
|
1297
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
1343
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
1298
1344
|
const createJobCacheFromCacheConfigs = (context, caches) => {
|
|
1299
1345
|
if (caches.length === 0)
|
|
1300
1346
|
return undefined;
|
|
@@ -1473,7 +1519,7 @@ const RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
|
1473
1519
|
KUBERNETES_MEMORY_LIMIT: "4Gi",
|
|
1474
1520
|
};
|
|
1475
1521
|
const createCustomTestJobs = (context) => {
|
|
1476
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
1522
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1477
1523
|
// don't run tests after release
|
|
1478
1524
|
// TODO: this will be replaced by using rules
|
|
1479
1525
|
if (context.trigger === "taggedRelease") {
|
|
@@ -1487,7 +1533,6 @@ const createCustomTestJobs = (context) => {
|
|
|
1487
1533
|
variables: {
|
|
1488
1534
|
APP_PATH: context.build.dir,
|
|
1489
1535
|
...context.environment.jobOnlyVars.build.envVars,
|
|
1490
|
-
...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
1491
1536
|
},
|
|
1492
1537
|
runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
|
|
1493
1538
|
services: buildConfig.jobServices,
|
|
@@ -1500,29 +1545,29 @@ const createCustomTestJobs = (context) => {
|
|
|
1500
1545
|
? {
|
|
1501
1546
|
name: "🛡 audit",
|
|
1502
1547
|
...base,
|
|
1503
|
-
image: (
|
|
1548
|
+
image: (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : buildConfig.jobImage,
|
|
1504
1549
|
cache: undefined,
|
|
1505
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1550
|
+
script: [...(0, utils_1.ensureArray)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)],
|
|
1506
1551
|
allow_failure: true,
|
|
1507
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1552
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.artifactsReports, (_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.artifacts),
|
|
1508
1553
|
}
|
|
1509
1554
|
: null;
|
|
1510
1555
|
const lintJob = buildConfig.lint
|
|
1511
1556
|
? {
|
|
1512
1557
|
name: "👮 lint",
|
|
1513
1558
|
...base,
|
|
1514
|
-
image: (
|
|
1515
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1516
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1559
|
+
image: (_g = (_f = buildConfig.lint) === null || _f === void 0 ? void 0 : _f.jobImage) !== null && _g !== void 0 ? _g : buildConfig.jobImage,
|
|
1560
|
+
script: [...(0, utils_1.ensureArray)((_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.command)],
|
|
1561
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.artifactsReports, (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.artifacts),
|
|
1517
1562
|
}
|
|
1518
1563
|
: null;
|
|
1519
1564
|
const testJob = buildConfig.test
|
|
1520
1565
|
? {
|
|
1521
1566
|
name: "🧪 test",
|
|
1522
1567
|
...base,
|
|
1523
|
-
image: (
|
|
1524
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1525
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1568
|
+
image: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : buildConfig.jobImage,
|
|
1569
|
+
script: [...(0, utils_1.ensureArray)((_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.command)],
|
|
1570
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.artifactsReports, (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.artifacts),
|
|
1526
1571
|
}
|
|
1527
1572
|
: null;
|
|
1528
1573
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -1824,7 +1869,7 @@ const createNodeBuildJobDefinition = (context) => {
|
|
|
1824
1869
|
const yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
1825
1870
|
return (0, createBuildJobDefinition_1.createBuildJobDefinition)(context, buildConfig, {
|
|
1826
1871
|
prescript: yarnInstall,
|
|
1827
|
-
cache:
|
|
1872
|
+
cache: (0, cache_1.getNodeCache)(context),
|
|
1828
1873
|
});
|
|
1829
1874
|
};
|
|
1830
1875
|
exports.createNodeBuildJobDefinition = createNodeBuildJobDefinition;
|
|
@@ -1859,10 +1904,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
1859
1904
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1860
1905
|
};
|
|
1861
1906
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1862
|
-
exports.
|
|
1907
|
+
exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
1863
1908
|
const lodash_1 = __nccwpck_require__(3255);
|
|
1864
1909
|
const path_1 = __nccwpck_require__(1017);
|
|
1865
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
1910
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
1866
1911
|
const getYarnCache = (context, policy = "pull-push") => {
|
|
1867
1912
|
const componentIsInWorkspace = context.type === "component" &&
|
|
1868
1913
|
context.packageManagerInfo.componentIsInWorkspace;
|
|
@@ -1908,35 +1953,9 @@ const getNodeCache = (context, policy = "pull-push") => {
|
|
|
1908
1953
|
return [
|
|
1909
1954
|
...(0, exports.getYarnCache)(context, policy),
|
|
1910
1955
|
...(0, exports.getNodeModulesCache)(context, policy),
|
|
1911
|
-
...(context.type === "workspace" ? (0, exports.getWorkspaceDefaultCaches)(context) : []),
|
|
1912
1956
|
];
|
|
1913
1957
|
};
|
|
1914
1958
|
exports.getNodeCache = getNodeCache;
|
|
1915
|
-
const getNextCache = (context) => {
|
|
1916
|
-
const paths = context.build
|
|
1917
|
-
.getComponentDirs("direct")
|
|
1918
|
-
.map((c) => (0, path_1.join)(c, ".next/cache"));
|
|
1919
|
-
return [
|
|
1920
|
-
{
|
|
1921
|
-
pathMode: "absolute",
|
|
1922
|
-
key: "next-cache",
|
|
1923
|
-
policy: "pull-push",
|
|
1924
|
-
paths,
|
|
1925
|
-
},
|
|
1926
|
-
];
|
|
1927
|
-
};
|
|
1928
|
-
exports.getNextCache = getNextCache;
|
|
1929
|
-
const getWorkspaceDefaultCaches = (context) => {
|
|
1930
|
-
return [
|
|
1931
|
-
{
|
|
1932
|
-
// turbo repo
|
|
1933
|
-
key: "turbo",
|
|
1934
|
-
policy: "pull-push",
|
|
1935
|
-
paths: [".turbo"],
|
|
1936
|
-
},
|
|
1937
|
-
];
|
|
1938
|
-
};
|
|
1939
|
-
exports.getWorkspaceDefaultCaches = getWorkspaceDefaultCaches;
|
|
1940
1959
|
//# sourceMappingURL=cache.js.map
|
|
1941
1960
|
|
|
1942
1961
|
/***/ }),
|
|
@@ -2061,7 +2080,7 @@ const constants_1 = __nccwpck_require__(1765);
|
|
|
2061
2080
|
const yarn_1 = __nccwpck_require__(5043);
|
|
2062
2081
|
const createJobCache_1 = __nccwpck_require__(340);
|
|
2063
2082
|
const createNodeTestJobs = (context) => {
|
|
2064
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
2083
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
2065
2084
|
// don't run tests after release
|
|
2066
2085
|
// TODO: this will be replaced by using rules
|
|
2067
2086
|
if (context.trigger === "taggedRelease") {
|
|
@@ -2079,7 +2098,6 @@ const createNodeTestJobs = (context) => {
|
|
|
2079
2098
|
...(context.type === "component"
|
|
2080
2099
|
? {
|
|
2081
2100
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2082
|
-
...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
2083
2101
|
}
|
|
2084
2102
|
: {}),
|
|
2085
2103
|
},
|
|
@@ -2094,48 +2112,48 @@ const createNodeTestJobs = (context) => {
|
|
|
2094
2112
|
? {
|
|
2095
2113
|
name: "🛡 audit",
|
|
2096
2114
|
...base,
|
|
2097
|
-
image: (
|
|
2115
|
+
image: (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage,
|
|
2098
2116
|
cache: undefined, // audit does not need yarn install and no cache
|
|
2099
2117
|
script: [
|
|
2100
2118
|
`cd ${context.build.dir}`,
|
|
2101
|
-
...((
|
|
2119
|
+
...((_d = (0, utils_1.ensureArrayOrNull)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : [
|
|
2102
2120
|
context.packageManagerInfo.isClassic
|
|
2103
2121
|
? "yarn audit"
|
|
2104
2122
|
: "yarn npm audit --environment production", // yarn 2
|
|
2105
2123
|
]),
|
|
2106
2124
|
],
|
|
2107
2125
|
allow_failure: true,
|
|
2108
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2126
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.artifactsReports, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifacts),
|
|
2109
2127
|
}
|
|
2110
2128
|
: null;
|
|
2111
2129
|
const lintJob = buildConfig.lint !== false
|
|
2112
2130
|
? {
|
|
2113
2131
|
name: "👮 lint",
|
|
2114
2132
|
...base,
|
|
2115
|
-
image: (
|
|
2133
|
+
image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
|
|
2116
2134
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
2117
2135
|
script: [
|
|
2118
2136
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
2119
2137
|
`cd ${context.build.dir}`,
|
|
2120
2138
|
...yarnInstall,
|
|
2121
|
-
...((
|
|
2139
|
+
...((_k = (0, utils_1.ensureArrayOrNull)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : ["yarn lint"]),
|
|
2122
2140
|
],
|
|
2123
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2141
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.artifactsReports, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifacts),
|
|
2124
2142
|
}
|
|
2125
2143
|
: null;
|
|
2126
2144
|
const testJob = buildConfig.test !== false
|
|
2127
2145
|
? {
|
|
2128
2146
|
name: "🧪 test",
|
|
2129
2147
|
...base,
|
|
2130
|
-
image: (
|
|
2148
|
+
image: (_p = (_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
2131
2149
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
2132
2150
|
script: [
|
|
2133
2151
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
2134
2152
|
`cd ${context.build.dir}`,
|
|
2135
2153
|
...yarnInstall,
|
|
2136
|
-
...((
|
|
2154
|
+
...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : ["yarn test"]),
|
|
2137
2155
|
],
|
|
2138
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2156
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.artifactsReports, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifacts),
|
|
2139
2157
|
}
|
|
2140
2158
|
: null;
|
|
2141
2159
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -2251,7 +2269,6 @@ const createRailsBuildJobs = (context) => {
|
|
|
2251
2269
|
dockerBuild: {
|
|
2252
2270
|
variables: {
|
|
2253
2271
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2254
|
-
...context.build.config.extraVars,
|
|
2255
2272
|
},
|
|
2256
2273
|
// custom script
|
|
2257
2274
|
script: [
|
|
@@ -2299,7 +2316,7 @@ exports.createRailsTestJobs = void 0;
|
|
|
2299
2316
|
const __1 = __nccwpck_require__(603);
|
|
2300
2317
|
const utils_1 = __nccwpck_require__(2497);
|
|
2301
2318
|
const createRailsTestJobs = (context) => {
|
|
2302
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
2319
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2303
2320
|
// don't run tests after release
|
|
2304
2321
|
// TODO: this will be replaced by using rules
|
|
2305
2322
|
if (context.trigger === "taggedRelease") {
|
|
@@ -2313,7 +2330,6 @@ const createRailsTestJobs = (context) => {
|
|
|
2313
2330
|
const base = {
|
|
2314
2331
|
variables: {
|
|
2315
2332
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2316
|
-
...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
2317
2333
|
},
|
|
2318
2334
|
stage: "test",
|
|
2319
2335
|
needs: [],
|
|
@@ -2337,10 +2353,10 @@ const createRailsTestJobs = (context) => {
|
|
|
2337
2353
|
name: "🛡 audit",
|
|
2338
2354
|
...base,
|
|
2339
2355
|
cache: undefined, // audit does not need bundle install and no cache
|
|
2340
|
-
image: (
|
|
2356
|
+
image: (_c = (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : buildConfig.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
|
|
2341
2357
|
script: [
|
|
2342
2358
|
`cd ${context.build.dir}`,
|
|
2343
|
-
...((
|
|
2359
|
+
...((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
2344
2360
|
"gem install bundler-audit",
|
|
2345
2361
|
"bundle audit check",
|
|
2346
2362
|
]),
|
|
@@ -2353,11 +2369,11 @@ const createRailsTestJobs = (context) => {
|
|
|
2353
2369
|
name: "👮 lint",
|
|
2354
2370
|
...base,
|
|
2355
2371
|
cache: bundlerCache,
|
|
2356
|
-
image: (
|
|
2372
|
+
image: (_h = (_g = (_f = buildConfig.lint) === null || _f === void 0 ? void 0 : _f.jobImage) !== null && _g !== void 0 ? _g : buildConfig.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
|
|
2357
2373
|
script: [
|
|
2358
2374
|
`cd ${context.build.dir}`,
|
|
2359
2375
|
...bundlerInstall,
|
|
2360
|
-
...((
|
|
2376
|
+
...((_k = (0, utils_1.ensureArrayOrNull)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : [
|
|
2361
2377
|
"bundle exec rubocop",
|
|
2362
2378
|
]),
|
|
2363
2379
|
],
|
|
@@ -2368,11 +2384,11 @@ const createRailsTestJobs = (context) => {
|
|
|
2368
2384
|
name: "🧪 test",
|
|
2369
2385
|
...base,
|
|
2370
2386
|
cache: bundlerCache,
|
|
2371
|
-
image: (
|
|
2387
|
+
image: (_o = (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : buildConfig.jobImage) !== null && _o !== void 0 ? _o : defaultImage,
|
|
2372
2388
|
script: [
|
|
2373
2389
|
`cd ${context.build.dir}`,
|
|
2374
2390
|
...bundlerInstall,
|
|
2375
|
-
...((
|
|
2391
|
+
...((_q = (0, utils_1.ensureArrayOrNull)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)) !== null && _q !== void 0 ? _q : [
|
|
2376
2392
|
"bundle exec rspec",
|
|
2377
2393
|
]),
|
|
2378
2394
|
],
|
|
@@ -2689,7 +2705,6 @@ const createComponentContext = async (ctx) => {
|
|
|
2689
2705
|
const context = {
|
|
2690
2706
|
type: "component",
|
|
2691
2707
|
name: ctx.componentName,
|
|
2692
|
-
componentName: ctx.componentName,
|
|
2693
2708
|
env: ctx.env,
|
|
2694
2709
|
fullConfig: ctx.config,
|
|
2695
2710
|
componentConfig,
|
|
@@ -2862,7 +2877,6 @@ const getEnvironment = async (ctx) => {
|
|
|
2862
2877
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
2863
2878
|
reviewSlug: envContext.reviewSlug,
|
|
2864
2879
|
slug: envContext.environmentSlug,
|
|
2865
|
-
shortName: env,
|
|
2866
2880
|
...variables,
|
|
2867
2881
|
};
|
|
2868
2882
|
};
|
|
@@ -2922,17 +2936,15 @@ exports.getEnvironmentContext = getEnvironmentContext;
|
|
|
2922
2936
|
|
|
2923
2937
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2924
2938
|
exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironmentVariables = void 0;
|
|
2925
|
-
const lodash_1 = __nccwpck_require__(3255);
|
|
2926
2939
|
const deploy_1 = __nccwpck_require__(8483);
|
|
2927
2940
|
const BashExpression_1 = __nccwpck_require__(2376);
|
|
2928
2941
|
const types_1 = __nccwpck_require__(4466);
|
|
2942
|
+
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
2943
|
+
const resolveAllReferences_1 = __nccwpck_require__(6305);
|
|
2929
2944
|
const getBuildInfoVariables_1 = __nccwpck_require__(7827);
|
|
2930
2945
|
const getEnvironmentContext_1 = __nccwpck_require__(3663);
|
|
2931
|
-
const resolveReferences_1 = __nccwpck_require__(3115);
|
|
2932
2946
|
const transformJobOnlyVars_1 = __nccwpck_require__(1552);
|
|
2933
|
-
const replaceAllReferences_1 = __nccwpck_require__(4035);
|
|
2934
2947
|
const envVars_1 = __nccwpck_require__(6296);
|
|
2935
|
-
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
2936
2948
|
const getBasePredefinedVariables = (ctx) => {
|
|
2937
2949
|
return {
|
|
2938
2950
|
ENV_SHORT: ctx.env,
|
|
@@ -2941,8 +2953,8 @@ const getBasePredefinedVariables = (ctx) => {
|
|
|
2941
2953
|
...(ctx.envType !== "local" ? (0, getBuildInfoVariables_1.getBuildInfoVariables)(ctx) : {}),
|
|
2942
2954
|
};
|
|
2943
2955
|
};
|
|
2944
|
-
const getEnvironmentVariables = async (ctx,
|
|
2945
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
2956
|
+
const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
2957
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2946
2958
|
const environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
2947
2959
|
const { config, env, componentName } = ctx;
|
|
2948
2960
|
const { envConfigRaw, deployConfigRaw, buildConfigRaw, envType } = environmentContext;
|
|
@@ -2959,12 +2971,8 @@ const getEnvironmentVariables = async (ctx, shouldResolveReferences = true) => {
|
|
|
2959
2971
|
...basePredefinedVariables,
|
|
2960
2972
|
ENV_SHORT: "local",
|
|
2961
2973
|
ROOT_URL: url,
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
buildConfigRaw.type === "rails"
|
|
2965
|
-
? {}
|
|
2966
|
-
: { HOST: host }),
|
|
2967
|
-
HOST_INTERNAL: host,
|
|
2974
|
+
HOSTNAME: host,
|
|
2975
|
+
HOSTNAME_INTERNAL: host,
|
|
2968
2976
|
ROOT_URL_INTERNAL: "http://" + host,
|
|
2969
2977
|
PORT: port.toString(),
|
|
2970
2978
|
};
|
|
@@ -2973,8 +2981,8 @@ const getEnvironmentVariables = async (ctx, shouldResolveReferences = true) => {
|
|
|
2973
2981
|
const additionalEnvVars = deployConfigRaw
|
|
2974
2982
|
? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext)
|
|
2975
2983
|
: {};
|
|
2976
|
-
const
|
|
2977
|
-
host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c :
|
|
2984
|
+
const HOSTNAME_INTERNAL = (_b = additionalEnvVars.HOSTNAME_INTERNAL) !== null && _b !== void 0 ? _b : "unknown-host.example.com";
|
|
2985
|
+
host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c : HOSTNAME_INTERNAL;
|
|
2978
2986
|
url = (0, BashExpression_1.joinBashExpressions)(["https://", host]);
|
|
2979
2987
|
predefinedVariables = {
|
|
2980
2988
|
...basePredefinedVariables,
|
|
@@ -2982,12 +2990,10 @@ const getEnvironmentVariables = async (ctx, shouldResolveReferences = true) => {
|
|
|
2982
2990
|
...((0, types_1.isStandaloneBuildConfig)(buildConfigRaw) &&
|
|
2983
2991
|
buildConfigRaw.type === "rails"
|
|
2984
2992
|
? {}
|
|
2985
|
-
: {
|
|
2993
|
+
: { HOSTNAME: host }),
|
|
2986
2994
|
ROOT_URL: url,
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
HOST_CANONICAL: HOST_INTERNAL, // legacy alias for HOST_INTERNAL
|
|
2990
|
-
ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOST_INTERNAL]),
|
|
2995
|
+
HOSTNAME_INTERNAL,
|
|
2996
|
+
ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOSTNAME_INTERNAL]),
|
|
2991
2997
|
...additionalEnvVars,
|
|
2992
2998
|
};
|
|
2993
2999
|
}
|
|
@@ -3000,22 +3006,21 @@ const getEnvironmentVariables = async (ctx, shouldResolveReferences = true) => {
|
|
|
3000
3006
|
...additionalSecretKeys,
|
|
3001
3007
|
];
|
|
3002
3008
|
const secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
|
|
3003
|
-
|
|
3004
|
-
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, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
3006
|
-
const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
|
|
3009
|
+
const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRaw);
|
|
3007
3010
|
const publicEnvVarsUnresolved = Object.fromEntries(Object.entries(publicEnvVarsRawSanitized).map(([key, value]) => [
|
|
3008
3011
|
key,
|
|
3009
3012
|
(0, VariableValueContainingReferences_1.createVariableValueContainingReferencesFromString)(value, {
|
|
3010
3013
|
componentName: ctx.componentName,
|
|
3011
3014
|
}),
|
|
3012
3015
|
]));
|
|
3013
|
-
const publicEnvVars = shouldResolveReferences
|
|
3014
|
-
? await (0,
|
|
3016
|
+
const publicEnvVars = ((_h = options.shouldResolveReferences) !== null && _h !== void 0 ? _h : true)
|
|
3017
|
+
? await (0, resolveAllReferences_1.resolveAllReferences)(publicEnvVarsUnresolved, async (otherComponentName) => {
|
|
3015
3018
|
const { envVars: otherEnvVars } = await (0, exports.getEnvironmentVariables)({
|
|
3016
3019
|
...ctx,
|
|
3017
3020
|
componentName: otherComponentName,
|
|
3018
|
-
},
|
|
3021
|
+
}, {
|
|
3022
|
+
shouldResolveReferences: false, // we already do this here with replaceAllReferences recursivly until re replaced all
|
|
3023
|
+
});
|
|
3019
3024
|
return otherEnvVars;
|
|
3020
3025
|
})
|
|
3021
3026
|
: publicEnvVarsUnresolved;
|
|
@@ -3062,7 +3067,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3062
3067
|
};
|
|
3063
3068
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3064
3069
|
exports.getLabels = void 0;
|
|
3065
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
3070
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
3066
3071
|
const sanitize = (value) => {
|
|
3067
3072
|
if (!value)
|
|
3068
3073
|
return value;
|
|
@@ -3141,26 +3146,6 @@ __exportStar(__nccwpck_require__(5133), exports);
|
|
|
3141
3146
|
|
|
3142
3147
|
/***/ }),
|
|
3143
3148
|
|
|
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
3149
|
/***/ 1552:
|
|
3165
3150
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3166
3151
|
|
|
@@ -3263,7 +3248,7 @@ const stop_1 = __nccwpck_require__(2846);
|
|
|
3263
3248
|
const variables_1 = __nccwpck_require__(2422);
|
|
3264
3249
|
exports.DEPLOY_JOB_NAME = "🚀 Deploy";
|
|
3265
3250
|
const createDeployJob = (context, jobDefinition) => {
|
|
3266
|
-
var _a, _b, _c, _d, _e, _f
|
|
3251
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3267
3252
|
const hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
3268
3253
|
const isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
3269
3254
|
const autoStop = context.environment.envType === "review"
|
|
@@ -3344,13 +3329,12 @@ const createDeployJob = (context, jobDefinition) => {
|
|
|
3344
3329
|
...context.environment.envVars,
|
|
3345
3330
|
...(hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}),
|
|
3346
3331
|
...context.environment.jobOnlyVars.deploy.envVars,
|
|
3347
|
-
...(deployConfig ? (_e = deployConfig.extraVars) !== null && _e !== void 0 ? _e : {} : {}),
|
|
3348
3332
|
...jobDefinition.variables,
|
|
3349
3333
|
},
|
|
3350
3334
|
runnerVariables: {
|
|
3351
3335
|
...variables_1.DEPLOY_RUNNER_VARIABLES,
|
|
3352
|
-
...((
|
|
3353
|
-
...(deployConfig ? (
|
|
3336
|
+
...((_e = jobDefinition.runnerVariables) !== null && _e !== void 0 ? _e : {}),
|
|
3337
|
+
...(deployConfig ? (_f = deployConfig.runnerVariables) !== null && _f !== void 0 ? _f : {} : {}),
|
|
3354
3338
|
},
|
|
3355
3339
|
environment: isStoppable
|
|
3356
3340
|
? {
|
|
@@ -3998,15 +3982,15 @@ exports.getCloudRunDeployScripts = void 0;
|
|
|
3998
3982
|
const lodash_1 = __nccwpck_require__(3255);
|
|
3999
3983
|
const gitlab_1 = __nccwpck_require__(8490);
|
|
4000
3984
|
const sbom_1 = __nccwpck_require__(4986);
|
|
3985
|
+
const __1 = __nccwpck_require__(2674);
|
|
3986
|
+
const bashYaml_1 = __nccwpck_require__(4660);
|
|
4001
3987
|
const cleanup_1 = __nccwpck_require__(7888);
|
|
4002
3988
|
const database_1 = __nccwpck_require__(8206);
|
|
4003
3989
|
const gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(6320);
|
|
4004
3990
|
const cloudRunJobs_1 = __nccwpck_require__(1224);
|
|
4005
3991
|
const cloudRunServices_1 = __nccwpck_require__(7334);
|
|
4006
3992
|
const common_1 = __nccwpck_require__(3325);
|
|
4007
|
-
const __1 = __nccwpck_require__(2674);
|
|
4008
3993
|
const constants_1 = __nccwpck_require__(8865);
|
|
4009
|
-
const bashYaml_1 = __nccwpck_require__(4660);
|
|
4010
3994
|
function getCloudRunDeployScripts(context) {
|
|
4011
3995
|
var _a;
|
|
4012
3996
|
const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
@@ -4217,7 +4201,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
4217
4201
|
],
|
|
4218
4202
|
getAdditionalEnvVars: (ctx) => {
|
|
4219
4203
|
const { fullName, env, componentName, deployConfigRaw } = ctx;
|
|
4220
|
-
const
|
|
4204
|
+
const HOSTNAME_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
|
|
4221
4205
|
fullName,
|
|
4222
4206
|
(0, BashExpression_1.getBashVariable)((0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)),
|
|
4223
4207
|
], "-").toLowerCase();
|
|
@@ -4228,7 +4212,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
4228
4212
|
]))
|
|
4229
4213
|
: {};
|
|
4230
4214
|
return {
|
|
4231
|
-
|
|
4215
|
+
HOSTNAME_INTERNAL,
|
|
4232
4216
|
...getCloudSqlVariables(ctx),
|
|
4233
4217
|
...jobTriggers,
|
|
4234
4218
|
DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw
|
|
@@ -4642,7 +4626,7 @@ const hasKubernetesCloudSQL = (context) => {
|
|
|
4642
4626
|
};
|
|
4643
4627
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
4644
4628
|
const createKubernetesCloudsqlBaseValues = (context) => {
|
|
4645
|
-
var _a, _b, _c
|
|
4629
|
+
var _a, _b, _c;
|
|
4646
4630
|
const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
4647
4631
|
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
4648
4632
|
throw new Error("cannot get cloud sql config");
|
|
@@ -4652,23 +4636,11 @@ const createKubernetesCloudsqlBaseValues = (context) => {
|
|
|
4652
4636
|
throw new Error("cannot get cloud sql config");
|
|
4653
4637
|
}
|
|
4654
4638
|
const proxyCredentials = `$${(0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials")}`;
|
|
4655
|
-
if (
|
|
4656
|
-
const instanceConnectionName = `${(_c = config.projectId) !== null && _c !== void 0 ? _c : "skynet-164509"}:${(_d = config.region) !== null && _d !== void 0 ? _d : "europe-west6"}:${(_e = config.instanceId) !== null && _e !== void 0 ? _e : context.environment.envVars.KUBE_NAMESPACE}`;
|
|
4657
|
-
return {
|
|
4658
|
-
cloudsql: {
|
|
4659
|
-
enabled: config.enabled,
|
|
4660
|
-
dbUser: "postgres",
|
|
4661
|
-
instanceConnectionName,
|
|
4662
|
-
proxyCredentials,
|
|
4663
|
-
fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : "",
|
|
4664
|
-
},
|
|
4665
|
-
};
|
|
4666
|
-
}
|
|
4667
|
-
else if (config.type === "unmanaged") {
|
|
4639
|
+
if (config.type === "unmanaged") {
|
|
4668
4640
|
return {
|
|
4669
4641
|
cloudsql: {
|
|
4670
4642
|
enabled: config.enabled,
|
|
4671
|
-
dbUser: (
|
|
4643
|
+
dbUser: (_c = config.dbUser) !== null && _c !== void 0 ? _c : "postgres",
|
|
4672
4644
|
instanceConnectionName: config.instanceConnectionName,
|
|
4673
4645
|
proxyCredentials,
|
|
4674
4646
|
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.name),
|
|
@@ -4730,8 +4702,6 @@ const createKubernetesDeployJobs = (context) => {
|
|
|
4730
4702
|
...((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []),
|
|
4731
4703
|
].join(" "),
|
|
4732
4704
|
COMPONENT_NAME: context.name,
|
|
4733
|
-
/** @deprecated */
|
|
4734
|
-
BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID,
|
|
4735
4705
|
},
|
|
4736
4706
|
};
|
|
4737
4707
|
const clusterName = `kube-${context.environment.fullName}`;
|
|
@@ -4796,7 +4766,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4796
4766
|
};
|
|
4797
4767
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4798
4768
|
exports.KUBERNETES_DEPLOY_TYPE = void 0;
|
|
4799
|
-
const slugify_1 = __importDefault(__nccwpck_require__(
|
|
4769
|
+
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
4800
4770
|
const __1 = __nccwpck_require__(8483);
|
|
4801
4771
|
const BashExpression_1 = __nccwpck_require__(2376);
|
|
4802
4772
|
const additionalSecretKeys_1 = __nccwpck_require__(436);
|
|
@@ -4815,7 +4785,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
4815
4785
|
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
|
|
4816
4786
|
fullConfig.domainCanonical ||
|
|
4817
4787
|
"panter.cloud";
|
|
4818
|
-
const
|
|
4788
|
+
const HOSTNAME_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
|
|
4819
4789
|
componentSlug,
|
|
4820
4790
|
...(envType === "review" && reviewSlug ? [reviewSlug] : []),
|
|
4821
4791
|
env,
|
|
@@ -4827,7 +4797,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
4827
4797
|
KUBE_NAMESPACE,
|
|
4828
4798
|
KUBE_APP_NAME,
|
|
4829
4799
|
KUBE_APP_NAME_PREFIX,
|
|
4830
|
-
|
|
4800
|
+
HOSTNAME_INTERNAL,
|
|
4831
4801
|
};
|
|
4832
4802
|
},
|
|
4833
4803
|
};
|
|
@@ -4900,7 +4870,6 @@ const types_1 = __nccwpck_require__(5781);
|
|
|
4900
4870
|
const cloudSql_1 = __nccwpck_require__(5129);
|
|
4901
4871
|
const kubeEnv_1 = __nccwpck_require__(6769);
|
|
4902
4872
|
const mongodb_1 = __nccwpck_require__(4139);
|
|
4903
|
-
const processSecretsAsFiles_1 = __nccwpck_require__(6089);
|
|
4904
4873
|
const createAppConfig = (context, application) => {
|
|
4905
4874
|
if (application === false) {
|
|
4906
4875
|
return {
|
|
@@ -4957,11 +4926,11 @@ const createKubeValues = (context) => {
|
|
|
4957
4926
|
: {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled)
|
|
4958
4927
|
? (0, mongodb_1.createMongodbBaseConfig)(context)
|
|
4959
4928
|
: {});
|
|
4960
|
-
const kubeValues = (0,
|
|
4929
|
+
const kubeValues = (0, utils_1.mergeWithMergingArrays)(defaultKubeValues, {
|
|
4961
4930
|
jobs: removeFalsy(jobs),
|
|
4962
4931
|
cronjobs: removeFalsy(cronjobs),
|
|
4963
4932
|
...rest,
|
|
4964
|
-
})
|
|
4933
|
+
});
|
|
4965
4934
|
return kubeValues;
|
|
4966
4935
|
};
|
|
4967
4936
|
exports.createKubeValues = createKubeValues;
|
|
@@ -5080,40 +5049,6 @@ exports.createMongodbBaseConfig = createMongodbBaseConfig;
|
|
|
5080
5049
|
|
|
5081
5050
|
/***/ }),
|
|
5082
5051
|
|
|
5083
|
-
/***/ 6089:
|
|
5084
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5085
|
-
|
|
5086
|
-
"use strict";
|
|
5087
|
-
|
|
5088
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5089
|
-
exports.processSecretsAsFiles = void 0;
|
|
5090
|
-
const lodash_1 = __nccwpck_require__(3255);
|
|
5091
|
-
const processSecretsAsFiles = (values) => {
|
|
5092
|
-
if (!values.secretsAsFile || values.secretsAsFile.length === 0) {
|
|
5093
|
-
return values;
|
|
5094
|
-
}
|
|
5095
|
-
// the initial idea was that we "shadow" secrets that we mount as files,
|
|
5096
|
-
// but there is a weird kubernetes issue with that (https://github.com/kubernetes/kubernetes/issues/46861),
|
|
5097
|
-
// so instead we rename the secrets and append _content, so that inside kuberentes, we can use the original name to contain the path and name+_content as the actual content
|
|
5098
|
-
return {
|
|
5099
|
-
...values,
|
|
5100
|
-
env: {
|
|
5101
|
-
...values.env,
|
|
5102
|
-
secret: {
|
|
5103
|
-
...(0, lodash_1.omit)(values.env.secret, values.secretsAsFile),
|
|
5104
|
-
...Object.fromEntries(values.secretsAsFile.map((key) => [
|
|
5105
|
-
key + "_content",
|
|
5106
|
-
values.env.secret[key],
|
|
5107
|
-
])),
|
|
5108
|
-
},
|
|
5109
|
-
},
|
|
5110
|
-
};
|
|
5111
|
-
};
|
|
5112
|
-
exports.processSecretsAsFiles = processSecretsAsFiles;
|
|
5113
|
-
//# sourceMappingURL=processSecretsAsFiles.js.map
|
|
5114
|
-
|
|
5115
|
-
/***/ }),
|
|
5116
|
-
|
|
5117
5052
|
/***/ 4986:
|
|
5118
5053
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5119
5054
|
|
|
@@ -5288,34 +5223,12 @@ __exportStar(__nccwpck_require__(5875), exports);
|
|
|
5288
5223
|
__exportStar(__nccwpck_require__(7862), exports);
|
|
5289
5224
|
__exportStar(__nccwpck_require__(8483), exports);
|
|
5290
5225
|
__exportStar(__nccwpck_require__(2228), exports);
|
|
5226
|
+
__exportStar(__nccwpck_require__(1619), exports);
|
|
5227
|
+
__exportStar(__nccwpck_require__(2990), exports);
|
|
5291
5228
|
//# sourceMappingURL=index.js.map
|
|
5292
5229
|
|
|
5293
5230
|
/***/ }),
|
|
5294
5231
|
|
|
5295
|
-
/***/ 1792:
|
|
5296
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
5297
|
-
|
|
5298
|
-
"use strict";
|
|
5299
|
-
|
|
5300
|
-
var _a;
|
|
5301
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5302
|
-
// we can't import the package.json directly, because the bundling process will inline it
|
|
5303
|
-
// but the version is only set during deployement, when its already bundled
|
|
5304
|
-
// instead we need to use require.main.path to get the path of the main module, which is actually the file in the bin
|
|
5305
|
-
// this will point to the root package.json
|
|
5306
|
-
let ownPkg = { version: "0.0.0" };
|
|
5307
|
-
try {
|
|
5308
|
-
const path = ((_a = require.main) === null || _a === void 0 ? void 0 : _a.path) + "/../package.json";
|
|
5309
|
-
ownPkg = require(path);
|
|
5310
|
-
}
|
|
5311
|
-
catch (e) {
|
|
5312
|
-
// ignore, currently in the gitlab-includes, this doesn't work
|
|
5313
|
-
}
|
|
5314
|
-
exports["default"] = ownPkg;
|
|
5315
|
-
//# sourceMappingURL=packageInfos.js.map
|
|
5316
|
-
|
|
5317
|
-
/***/ }),
|
|
5318
|
-
|
|
5319
5232
|
/***/ 3579:
|
|
5320
5233
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5321
5234
|
|
|
@@ -5690,7 +5603,7 @@ const getFullReferencedJobNameFromWorkspace = (referencedJobName, workspaceName,
|
|
|
5690
5603
|
const getJobName = (need) => (0, lodash_1.isObject)(need) ? need.job : need;
|
|
5691
5604
|
const makeGitlabJob = (context, job, allJobs, baseRules) => {
|
|
5692
5605
|
var _a, _b;
|
|
5693
|
-
const { environment, envMode, needsStages,
|
|
5606
|
+
const { environment, envMode, needsStages, name, needs, jobTags, script, variables, runnerVariables, when, ...rest } = job;
|
|
5694
5607
|
const stage = envMode === "stagePerEnv" ? `${job.stage} ${context.env}` : job.stage;
|
|
5695
5608
|
const deduplicatedGitlabNeeds = getGitlabNeeds(context, job, allJobs);
|
|
5696
5609
|
const fullJobName = getFullJobName({
|
|
@@ -5814,7 +5727,7 @@ function deduplicateNeeds(needs) {
|
|
|
5814
5727
|
? [...new Map(needs.map((n) => [(0, lodash_1.isObject)(n) ? n.job : n, n])).values()]
|
|
5815
5728
|
: undefined;
|
|
5816
5729
|
}
|
|
5817
|
-
function getGitlabNeedsForComponentJob(context, { needsStages, needs
|
|
5730
|
+
function getGitlabNeedsForComponentJob(context, { needsStages, needs }, allJobs) {
|
|
5818
5731
|
const needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap((n) => {
|
|
5819
5732
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5820
5733
|
const componentName = context.name;
|
|
@@ -5848,8 +5761,6 @@ function getGitlabNeedsForComponentJob(context, { needsStages, needs, needsOther
|
|
|
5848
5761
|
const cleanedNeeds = [
|
|
5849
5762
|
...(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []),
|
|
5850
5763
|
...(needs !== null && needs !== void 0 ? needs : []),
|
|
5851
|
-
// pull in legacy needs from other component, which is now identical to needs
|
|
5852
|
-
...(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []),
|
|
5853
5764
|
];
|
|
5854
5765
|
return cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map((n) => {
|
|
5855
5766
|
var _a;
|
|
@@ -6551,22 +6462,18 @@ exports.removeUndefined = removeUndefined;
|
|
|
6551
6462
|
/***/ }),
|
|
6552
6463
|
|
|
6553
6464
|
/***/ 2228:
|
|
6554
|
-
/***/ (
|
|
6465
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6555
6466
|
|
|
6556
6467
|
"use strict";
|
|
6557
6468
|
|
|
6558
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6559
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6560
|
-
};
|
|
6561
6469
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6562
6470
|
exports.writeYamlfile = exports.yamlStringifyOptions = exports.writeGeneratedFile = exports.getAutoGeneratedHeader = void 0;
|
|
6563
6471
|
const promises_1 = __nccwpck_require__(3292);
|
|
6564
6472
|
const yaml_1 = __nccwpck_require__(8033);
|
|
6565
|
-
const packageInfos_1 = __importDefault(__nccwpck_require__(1792));
|
|
6566
6473
|
const getAutoGeneratedHeader = (commentChar) => {
|
|
6567
6474
|
return [
|
|
6568
6475
|
"-------------------------------------------------",
|
|
6569
|
-
`🐱 🔨 This file is generated by catladder
|
|
6476
|
+
`🐱 🔨 This file is generated by catladder`,
|
|
6570
6477
|
`🚨 Do not edit this file manually 🚨`,
|
|
6571
6478
|
"-------------------------------------------------",
|
|
6572
6479
|
]
|
|
@@ -6601,13 +6508,24 @@ exports.writeYamlfile = writeYamlfile;
|
|
|
6601
6508
|
|
|
6602
6509
|
/***/ }),
|
|
6603
6510
|
|
|
6604
|
-
/***/
|
|
6511
|
+
/***/ 1619:
|
|
6605
6512
|
/***/ ((__unused_webpack_module, exports) => {
|
|
6606
6513
|
|
|
6607
6514
|
"use strict";
|
|
6608
6515
|
|
|
6516
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6517
|
+
//# sourceMappingURL=VariableValue.js.map
|
|
6518
|
+
|
|
6519
|
+
/***/ }),
|
|
6520
|
+
|
|
6521
|
+
/***/ 1592:
|
|
6522
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6523
|
+
|
|
6524
|
+
"use strict";
|
|
6525
|
+
|
|
6609
6526
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6610
6527
|
exports.createVariableValueContainingReferencesFromString = exports.VariableValueContainingReferences = exports.VariableReference = exports.UnresolvableReference = void 0;
|
|
6528
|
+
const bashEscape_1 = __nccwpck_require__(2463);
|
|
6611
6529
|
class UnresolvableReference {
|
|
6612
6530
|
constructor(reference) {
|
|
6613
6531
|
this.reference = reference;
|
|
@@ -6635,11 +6553,11 @@ class VariableValueContainingReferences {
|
|
|
6635
6553
|
? []
|
|
6636
6554
|
: [part]);
|
|
6637
6555
|
}
|
|
6638
|
-
toString(options = {
|
|
6556
|
+
toString(options = { escape: false }) {
|
|
6639
6557
|
return this.parts
|
|
6640
6558
|
.map((part) => {
|
|
6641
6559
|
if (typeof part === "string") {
|
|
6642
|
-
return options.
|
|
6560
|
+
return options.escape ? (0, bashEscape_1.escapeString)(part, options.escape) : part;
|
|
6643
6561
|
}
|
|
6644
6562
|
else {
|
|
6645
6563
|
return part.toString();
|
|
@@ -6670,21 +6588,21 @@ exports.createVariableValueContainingReferencesFromString = createVariableValueC
|
|
|
6670
6588
|
|
|
6671
6589
|
/***/ }),
|
|
6672
6590
|
|
|
6673
|
-
/***/
|
|
6591
|
+
/***/ 6305:
|
|
6674
6592
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6675
6593
|
|
|
6676
6594
|
"use strict";
|
|
6677
6595
|
|
|
6678
6596
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6679
|
-
exports.
|
|
6597
|
+
exports.resolveAllReferences = void 0;
|
|
6680
6598
|
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
6681
|
-
const
|
|
6682
|
-
const
|
|
6599
|
+
const resolveAllReferencesOnce_1 = __nccwpck_require__(9554);
|
|
6600
|
+
const resolveAllReferences = async (values, getEnvVars) => {
|
|
6683
6601
|
// replace until there aren't any references left
|
|
6684
6602
|
let result = values;
|
|
6685
6603
|
let i = 0;
|
|
6686
6604
|
while (Object.values(result).some((value) => value.parts.some((part) => part instanceof VariableValueContainingReferences_1.VariableReference))) {
|
|
6687
|
-
const replaced = await (0,
|
|
6605
|
+
const replaced = await (0, resolveAllReferencesOnce_1.resolveAllReferencesOnce)(result, getEnvVars);
|
|
6688
6606
|
result = replaced;
|
|
6689
6607
|
i++;
|
|
6690
6608
|
if (i > 1000) {
|
|
@@ -6697,21 +6615,21 @@ const replaceAllReferences = async (values, getEnvVars) => {
|
|
|
6697
6615
|
}
|
|
6698
6616
|
return result;
|
|
6699
6617
|
};
|
|
6700
|
-
exports.
|
|
6701
|
-
//# sourceMappingURL=
|
|
6618
|
+
exports.resolveAllReferences = resolveAllReferences;
|
|
6619
|
+
//# sourceMappingURL=resolveAllReferences.js.map
|
|
6702
6620
|
|
|
6703
6621
|
/***/ }),
|
|
6704
6622
|
|
|
6705
|
-
/***/
|
|
6623
|
+
/***/ 9554:
|
|
6706
6624
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6707
6625
|
|
|
6708
6626
|
"use strict";
|
|
6709
6627
|
|
|
6710
6628
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6711
|
-
exports.
|
|
6629
|
+
exports.resolveAllReferencesOnce = void 0;
|
|
6712
6630
|
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
6713
|
-
const
|
|
6714
|
-
const
|
|
6631
|
+
const resolveReferencesOnce_1 = __nccwpck_require__(8749);
|
|
6632
|
+
const resolveAllReferencesOnce = async (values, getEnvVars) => {
|
|
6715
6633
|
const allReferences = Object.values(values).flatMap((value) => value === null || value === void 0 ? void 0 : value.parts.filter((part) => part instanceof VariableValueContainingReferences_1.VariableReference));
|
|
6716
6634
|
const allComponentsUnique = Array.from(new Set(allReferences.map((reference) => reference.componentName)));
|
|
6717
6635
|
const allEnvVarsInComponents = Object.fromEntries(await Promise.all(allComponentsUnique.map(async (componentName) => [
|
|
@@ -6721,29 +6639,29 @@ const replaceAllReferencesOnce = async (values, getEnvVars) => {
|
|
|
6721
6639
|
return Object.fromEntries(Object.entries(values).map(([key, value]) => [
|
|
6722
6640
|
key,
|
|
6723
6641
|
value !== null && value !== undefined
|
|
6724
|
-
? (0,
|
|
6642
|
+
? (0, resolveReferencesOnce_1.resolveReferencesOnce)(value, ({ componentName, variableName }) => {
|
|
6725
6643
|
return allEnvVarsInComponents[componentName][variableName];
|
|
6726
6644
|
})
|
|
6727
6645
|
: value,
|
|
6728
6646
|
]));
|
|
6729
6647
|
};
|
|
6730
|
-
exports.
|
|
6731
|
-
//# sourceMappingURL=
|
|
6648
|
+
exports.resolveAllReferencesOnce = resolveAllReferencesOnce;
|
|
6649
|
+
//# sourceMappingURL=resolveAllReferencesOnce.js.map
|
|
6732
6650
|
|
|
6733
6651
|
/***/ }),
|
|
6734
6652
|
|
|
6735
|
-
/***/
|
|
6653
|
+
/***/ 8749:
|
|
6736
6654
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
6737
6655
|
|
|
6738
6656
|
"use strict";
|
|
6739
6657
|
|
|
6740
6658
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6741
|
-
exports.
|
|
6659
|
+
exports.resolveReferencesOnce = void 0;
|
|
6742
6660
|
const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
6743
|
-
const
|
|
6661
|
+
const resolveReferencesOnce = (value, resolver) => {
|
|
6744
6662
|
const replacedParts = value.parts.map((part) => {
|
|
6745
6663
|
if (part instanceof VariableValueContainingReferences_1.VariableReference) {
|
|
6746
|
-
const result =
|
|
6664
|
+
const result = resolver({
|
|
6747
6665
|
componentName: part.componentName,
|
|
6748
6666
|
variableName: part.variableName,
|
|
6749
6667
|
});
|
|
@@ -6755,8 +6673,8 @@ const replaceReferencesOnce = (value, replacer) => {
|
|
|
6755
6673
|
});
|
|
6756
6674
|
return new VariableValueContainingReferences_1.VariableValueContainingReferences(replacedParts);
|
|
6757
6675
|
};
|
|
6758
|
-
exports.
|
|
6759
|
-
//# sourceMappingURL=
|
|
6676
|
+
exports.resolveReferencesOnce = resolveReferencesOnce;
|
|
6677
|
+
//# sourceMappingURL=resolveReferencesOnce.js.map
|
|
6760
6678
|
|
|
6761
6679
|
/***/ }),
|
|
6762
6680
|
|
|
@@ -39879,7 +39797,7 @@ module.exports = safer
|
|
|
39879
39797
|
|
|
39880
39798
|
/***/ }),
|
|
39881
39799
|
|
|
39882
|
-
/***/
|
|
39800
|
+
/***/ 4035:
|
|
39883
39801
|
/***/ (function(module) {
|
|
39884
39802
|
|
|
39885
39803
|
|