@catladder/cli 0.0.0-refactor-resolve-references-next-14821f39 → 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 +208 -67
- package/dist/bundles/cli/index.js +202 -59
- package/dist/cli/src/apps/catenv/printVariables.js +2 -4
- package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +1 -1
- 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/pipeline/src/build/base/createAppBuildJob.js +3 -2
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +1 -2
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.js +11 -10
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- 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 +3 -1
- package/dist/pipeline/src/build/node/cache.js +27 -1
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.js +11 -10
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.js +1 -0
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.js +8 -7
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/types.d.ts +10 -0
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/context/createComponentContext.js +1 -0
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironment.js +1 -0
- package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +5 -2
- package/dist/pipeline/src/context/getEnvironmentVariables.js +21 -10
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/translateLegacyFromComponents.d.ts +3 -0
- package/dist/pipeline/src/context/translateLegacyFromComponents.js +13 -0
- package/dist/pipeline/src/context/translateLegacyFromComponents.js.map +1 -0
- package/dist/pipeline/src/deploy/base/deploy.js +4 -3
- package/dist/pipeline/src/deploy/base/deploy.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/kubernetes/cloudSql/index.js +15 -3
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +2 -0
- 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 +2 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +3 -2
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.d.ts +85 -0
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js +27 -0
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js.map +1 -0
- package/dist/pipeline/src/deploy/types/base.d.ts +6 -0
- package/dist/pipeline/src/deploy/types/kubernetes.d.ts +34 -1
- package/dist/pipeline/src/packageInfos.d.ts +4 -0
- package/dist/pipeline/src/packageInfos.js +17 -0
- package/dist/pipeline/src/packageInfos.js.map +1 -0
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +4 -2
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/types/config.d.ts +9 -3
- package/dist/pipeline/src/types/context.d.ts +8 -0
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/pipeline/src/types/jobs.d.ts +8 -0
- package/dist/pipeline/src/utils/writeFiles.js +5 -1
- package/dist/pipeline/src/utils/writeFiles.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/writeDotEnvFiles.ts +1 -1
- package/src/apps/catenv/writeEnvDTs.ts +1 -1
|
@@ -40,11 +40,10 @@ 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;
|
|
44
43
|
const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
|
|
45
44
|
if (currentComponent) {
|
|
46
45
|
// don't print vars if dotenv is enabled
|
|
47
|
-
if (
|
|
46
|
+
if (config.components[currentComponent].dotEnv) {
|
|
48
47
|
return {};
|
|
49
48
|
}
|
|
50
49
|
return await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, currentComponent);
|
|
@@ -54,9 +53,8 @@ const getAllVariablesToPrint = async (config, choice) => {
|
|
|
54
53
|
// this is not 100% correct, but better than not exporting any vars at all
|
|
55
54
|
// so we also add prefixed variants
|
|
56
55
|
return await Object.keys(config.components).reduce(async (acc, componentName) => {
|
|
57
|
-
var _a;
|
|
58
56
|
// don't print vars if dotenv is enabled
|
|
59
|
-
if (
|
|
57
|
+
if (config.components[componentName].dotEnv) {
|
|
60
58
|
return await acc;
|
|
61
59
|
}
|
|
62
60
|
const subappvars = await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, componentName);
|
|
@@ -139,7 +137,7 @@ const utils_1 = __nccwpck_require__(4560);
|
|
|
139
137
|
const writeDotEnvFiles = async (config, choice) => {
|
|
140
138
|
const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
|
|
141
139
|
const componentsWithEnabledDotEnvWrite = Object.entries(config.components)
|
|
142
|
-
.filter(([, component]) =>
|
|
140
|
+
.filter(([, component]) => component === null || component === void 0 ? void 0 : component.dotEnv) // when set to true or "local"
|
|
143
141
|
.map(([componentName]) => componentName);
|
|
144
142
|
const componentsToActuallyWriteDotEnvNow = currentComponent
|
|
145
143
|
? componentsWithEnabledDotEnvWrite.includes(currentComponent)
|
|
@@ -178,7 +176,7 @@ const utils_1 = __nccwpck_require__(4560);
|
|
|
178
176
|
const writeDTsFiles = async (config, choice) => {
|
|
179
177
|
const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
|
|
180
178
|
const componentsWithEnabledEnvDTsWrite = Object.entries(config.components)
|
|
181
|
-
.filter(([, component]) =>
|
|
179
|
+
.filter(([, component]) => component === null || component === void 0 ? void 0 : component.envDTs)
|
|
182
180
|
.map(([componentName]) => componentName);
|
|
183
181
|
const componentsToActuallyWriteEnvDts = currentComponent
|
|
184
182
|
? componentsWithEnabledEnvDTsWrite.includes(currentComponent)
|
|
@@ -1093,7 +1091,7 @@ const constants_1 = __nccwpck_require__(2786);
|
|
|
1093
1091
|
const writeBuildInfo_1 = __nccwpck_require__(9578);
|
|
1094
1092
|
const writeDotEnv_1 = __nccwpck_require__(8052);
|
|
1095
1093
|
const createAppBuildJob = (context, { script, variables, runnerVariables, cache, ...def }) => {
|
|
1096
|
-
var _a;
|
|
1094
|
+
var _a, _b;
|
|
1097
1095
|
return (0, lodash_1.merge)({
|
|
1098
1096
|
name: constants_1.APP_BUILD_JOB_NAME,
|
|
1099
1097
|
envMode: "jobPerEnv",
|
|
@@ -1107,13 +1105,14 @@ const createAppBuildJob = (context, { script, variables, runnerVariables, cache,
|
|
|
1107
1105
|
? {
|
|
1108
1106
|
...context.environment.envVars,
|
|
1109
1107
|
...context.environment.jobOnlyVars.build.envVars,
|
|
1108
|
+
...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
1110
1109
|
}
|
|
1111
1110
|
: {}),
|
|
1112
1111
|
},
|
|
1113
1112
|
runnerVariables: {
|
|
1114
1113
|
...constants_1.RUNNER_BUILD_RESOURCE_VARIABLES,
|
|
1115
1114
|
...(runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}),
|
|
1116
|
-
...((
|
|
1115
|
+
...((_b = context.build.config.runnerVariables) !== null && _b !== void 0 ? _b : {}),
|
|
1117
1116
|
},
|
|
1118
1117
|
script: [
|
|
1119
1118
|
...(context.type === "component"
|
|
@@ -1320,8 +1319,7 @@ EOF`,
|
|
|
1320
1319
|
};
|
|
1321
1320
|
exports.writeDotEnv = writeDotEnv;
|
|
1322
1321
|
const componentContextNeedsBuildTimeDotEnv = (context) => {
|
|
1323
|
-
|
|
1324
|
-
return ((_a = context.componentConfig.dotEnv) !== null && _a !== void 0 ? _a : true) === true; // don't build when set to `local`
|
|
1322
|
+
return context.componentConfig.dotEnv === true; // don't build when set to `local`
|
|
1325
1323
|
};
|
|
1326
1324
|
exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDotEnv;
|
|
1327
1325
|
//# sourceMappingURL=writeDotEnv.js.map
|
|
@@ -1519,7 +1517,7 @@ const RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
|
1519
1517
|
KUBERNETES_MEMORY_LIMIT: "4Gi",
|
|
1520
1518
|
};
|
|
1521
1519
|
const createCustomTestJobs = (context) => {
|
|
1522
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1520
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
1523
1521
|
// don't run tests after release
|
|
1524
1522
|
// TODO: this will be replaced by using rules
|
|
1525
1523
|
if (context.trigger === "taggedRelease") {
|
|
@@ -1533,6 +1531,7 @@ const createCustomTestJobs = (context) => {
|
|
|
1533
1531
|
variables: {
|
|
1534
1532
|
APP_PATH: context.build.dir,
|
|
1535
1533
|
...context.environment.jobOnlyVars.build.envVars,
|
|
1534
|
+
...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
1536
1535
|
},
|
|
1537
1536
|
runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
|
|
1538
1537
|
services: buildConfig.jobServices,
|
|
@@ -1545,29 +1544,29 @@ const createCustomTestJobs = (context) => {
|
|
|
1545
1544
|
? {
|
|
1546
1545
|
name: "🛡 audit",
|
|
1547
1546
|
...base,
|
|
1548
|
-
image: (
|
|
1547
|
+
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage,
|
|
1549
1548
|
cache: undefined,
|
|
1550
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1549
|
+
script: [...(0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)],
|
|
1551
1550
|
allow_failure: true,
|
|
1552
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1551
|
+
...(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),
|
|
1553
1552
|
}
|
|
1554
1553
|
: null;
|
|
1555
1554
|
const lintJob = buildConfig.lint
|
|
1556
1555
|
? {
|
|
1557
1556
|
name: "👮 lint",
|
|
1558
1557
|
...base,
|
|
1559
|
-
image: (
|
|
1560
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1561
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1558
|
+
image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage,
|
|
1559
|
+
script: [...(0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)],
|
|
1560
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.artifactsReports, (_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.artifacts),
|
|
1562
1561
|
}
|
|
1563
1562
|
: null;
|
|
1564
1563
|
const testJob = buildConfig.test
|
|
1565
1564
|
? {
|
|
1566
1565
|
name: "🧪 test",
|
|
1567
1566
|
...base,
|
|
1568
|
-
image: (
|
|
1569
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1570
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1567
|
+
image: (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage,
|
|
1568
|
+
script: [...(0, utils_1.ensureArray)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)],
|
|
1569
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.artifactsReports, (_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.artifacts),
|
|
1571
1570
|
}
|
|
1572
1571
|
: null;
|
|
1573
1572
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -1869,7 +1868,7 @@ const createNodeBuildJobDefinition = (context) => {
|
|
|
1869
1868
|
const yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
1870
1869
|
return (0, createBuildJobDefinition_1.createBuildJobDefinition)(context, buildConfig, {
|
|
1871
1870
|
prescript: yarnInstall,
|
|
1872
|
-
cache: (0, cache_1.getNodeCache)(context),
|
|
1871
|
+
cache: [...(0, cache_1.getNodeCache)(context), ...(0, cache_1.getNextCache)(context)],
|
|
1873
1872
|
});
|
|
1874
1873
|
};
|
|
1875
1874
|
exports.createNodeBuildJobDefinition = createNodeBuildJobDefinition;
|
|
@@ -1904,7 +1903,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
1904
1903
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1905
1904
|
};
|
|
1906
1905
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1907
|
-
exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
1906
|
+
exports.getWorkspaceDefaultCaches = exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
1908
1907
|
const lodash_1 = __nccwpck_require__(3255);
|
|
1909
1908
|
const path_1 = __nccwpck_require__(1017);
|
|
1910
1909
|
const slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
@@ -1953,9 +1952,35 @@ const getNodeCache = (context, policy = "pull-push") => {
|
|
|
1953
1952
|
return [
|
|
1954
1953
|
...(0, exports.getYarnCache)(context, policy),
|
|
1955
1954
|
...(0, exports.getNodeModulesCache)(context, policy),
|
|
1955
|
+
...(context.type === "workspace" ? (0, exports.getWorkspaceDefaultCaches)(context) : []),
|
|
1956
1956
|
];
|
|
1957
1957
|
};
|
|
1958
1958
|
exports.getNodeCache = getNodeCache;
|
|
1959
|
+
const getNextCache = (context) => {
|
|
1960
|
+
const paths = context.build
|
|
1961
|
+
.getComponentDirs("direct")
|
|
1962
|
+
.map((c) => (0, path_1.join)(c, ".next/cache"));
|
|
1963
|
+
return [
|
|
1964
|
+
{
|
|
1965
|
+
pathMode: "absolute",
|
|
1966
|
+
key: "next-cache",
|
|
1967
|
+
policy: "pull-push",
|
|
1968
|
+
paths,
|
|
1969
|
+
},
|
|
1970
|
+
];
|
|
1971
|
+
};
|
|
1972
|
+
exports.getNextCache = getNextCache;
|
|
1973
|
+
const getWorkspaceDefaultCaches = (context) => {
|
|
1974
|
+
return [
|
|
1975
|
+
{
|
|
1976
|
+
// turbo repo
|
|
1977
|
+
key: "turbo",
|
|
1978
|
+
policy: "pull-push",
|
|
1979
|
+
paths: [".turbo"],
|
|
1980
|
+
},
|
|
1981
|
+
];
|
|
1982
|
+
};
|
|
1983
|
+
exports.getWorkspaceDefaultCaches = getWorkspaceDefaultCaches;
|
|
1959
1984
|
//# sourceMappingURL=cache.js.map
|
|
1960
1985
|
|
|
1961
1986
|
/***/ }),
|
|
@@ -2080,7 +2105,7 @@ const constants_1 = __nccwpck_require__(1765);
|
|
|
2080
2105
|
const yarn_1 = __nccwpck_require__(5043);
|
|
2081
2106
|
const createJobCache_1 = __nccwpck_require__(340);
|
|
2082
2107
|
const createNodeTestJobs = (context) => {
|
|
2083
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
2108
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
2084
2109
|
// don't run tests after release
|
|
2085
2110
|
// TODO: this will be replaced by using rules
|
|
2086
2111
|
if (context.trigger === "taggedRelease") {
|
|
@@ -2098,6 +2123,7 @@ const createNodeTestJobs = (context) => {
|
|
|
2098
2123
|
...(context.type === "component"
|
|
2099
2124
|
? {
|
|
2100
2125
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2126
|
+
...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
2101
2127
|
}
|
|
2102
2128
|
: {}),
|
|
2103
2129
|
},
|
|
@@ -2112,48 +2138,48 @@ const createNodeTestJobs = (context) => {
|
|
|
2112
2138
|
? {
|
|
2113
2139
|
name: "🛡 audit",
|
|
2114
2140
|
...base,
|
|
2115
|
-
image: (
|
|
2141
|
+
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
|
|
2116
2142
|
cache: undefined, // audit does not need yarn install and no cache
|
|
2117
2143
|
script: [
|
|
2118
2144
|
`cd ${context.build.dir}`,
|
|
2119
|
-
...((
|
|
2145
|
+
...((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
2120
2146
|
context.packageManagerInfo.isClassic
|
|
2121
2147
|
? "yarn audit"
|
|
2122
2148
|
: "yarn npm audit --environment production", // yarn 2
|
|
2123
2149
|
]),
|
|
2124
2150
|
],
|
|
2125
2151
|
allow_failure: true,
|
|
2126
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2152
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts),
|
|
2127
2153
|
}
|
|
2128
2154
|
: null;
|
|
2129
2155
|
const lintJob = buildConfig.lint !== false
|
|
2130
2156
|
? {
|
|
2131
2157
|
name: "👮 lint",
|
|
2132
2158
|
...base,
|
|
2133
|
-
image: (
|
|
2159
|
+
image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
2134
2160
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
2135
2161
|
script: [
|
|
2136
2162
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
2137
2163
|
`cd ${context.build.dir}`,
|
|
2138
2164
|
...yarnInstall,
|
|
2139
|
-
...((
|
|
2165
|
+
...((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"]),
|
|
2140
2166
|
],
|
|
2141
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2167
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts),
|
|
2142
2168
|
}
|
|
2143
2169
|
: null;
|
|
2144
2170
|
const testJob = buildConfig.test !== false
|
|
2145
2171
|
? {
|
|
2146
2172
|
name: "🧪 test",
|
|
2147
2173
|
...base,
|
|
2148
|
-
image: (
|
|
2174
|
+
image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
2149
2175
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
2150
2176
|
script: [
|
|
2151
2177
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
2152
2178
|
`cd ${context.build.dir}`,
|
|
2153
2179
|
...yarnInstall,
|
|
2154
|
-
...((
|
|
2180
|
+
...((_s = (0, utils_1.ensureArrayOrNull)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"]),
|
|
2155
2181
|
],
|
|
2156
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2182
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts),
|
|
2157
2183
|
}
|
|
2158
2184
|
: null;
|
|
2159
2185
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -2229,7 +2255,7 @@ exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
|
|
|
2229
2255
|
|
|
2230
2256
|
/***/ }),
|
|
2231
2257
|
|
|
2232
|
-
/***/
|
|
2258
|
+
/***/ 5756:
|
|
2233
2259
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2234
2260
|
|
|
2235
2261
|
"use strict";
|
|
@@ -2269,6 +2295,7 @@ const createRailsBuildJobs = (context) => {
|
|
|
2269
2295
|
dockerBuild: {
|
|
2270
2296
|
variables: {
|
|
2271
2297
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2298
|
+
...context.build.config.extraVars,
|
|
2272
2299
|
},
|
|
2273
2300
|
// custom script
|
|
2274
2301
|
script: [
|
|
@@ -2296,7 +2323,7 @@ exports.createRailsBuildJobs = createRailsBuildJobs;
|
|
|
2296
2323
|
|
|
2297
2324
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2298
2325
|
exports.createRailsJobs = void 0;
|
|
2299
|
-
const build_1 = __nccwpck_require__(
|
|
2326
|
+
const build_1 = __nccwpck_require__(5756);
|
|
2300
2327
|
const test_1 = __nccwpck_require__(7910);
|
|
2301
2328
|
const createRailsJobs = (context) => {
|
|
2302
2329
|
return [...(0, test_1.createRailsTestJobs)(context), ...(0, build_1.createRailsBuildJobs)(context)];
|
|
@@ -2316,7 +2343,7 @@ exports.createRailsTestJobs = void 0;
|
|
|
2316
2343
|
const __1 = __nccwpck_require__(603);
|
|
2317
2344
|
const utils_1 = __nccwpck_require__(2497);
|
|
2318
2345
|
const createRailsTestJobs = (context) => {
|
|
2319
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2346
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
2320
2347
|
// don't run tests after release
|
|
2321
2348
|
// TODO: this will be replaced by using rules
|
|
2322
2349
|
if (context.trigger === "taggedRelease") {
|
|
@@ -2330,6 +2357,7 @@ const createRailsTestJobs = (context) => {
|
|
|
2330
2357
|
const base = {
|
|
2331
2358
|
variables: {
|
|
2332
2359
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2360
|
+
...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
2333
2361
|
},
|
|
2334
2362
|
stage: "test",
|
|
2335
2363
|
needs: [],
|
|
@@ -2353,10 +2381,10 @@ const createRailsTestJobs = (context) => {
|
|
|
2353
2381
|
name: "🛡 audit",
|
|
2354
2382
|
...base,
|
|
2355
2383
|
cache: undefined, // audit does not need bundle install and no cache
|
|
2356
|
-
image: (
|
|
2384
|
+
image: (_d = (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
|
|
2357
2385
|
script: [
|
|
2358
2386
|
`cd ${context.build.dir}`,
|
|
2359
|
-
...((
|
|
2387
|
+
...((_f = (0, utils_1.ensureArrayOrNull)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [
|
|
2360
2388
|
"gem install bundler-audit",
|
|
2361
2389
|
"bundle audit check",
|
|
2362
2390
|
]),
|
|
@@ -2369,11 +2397,11 @@ const createRailsTestJobs = (context) => {
|
|
|
2369
2397
|
name: "👮 lint",
|
|
2370
2398
|
...base,
|
|
2371
2399
|
cache: bundlerCache,
|
|
2372
|
-
image: (
|
|
2400
|
+
image: (_j = (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
2373
2401
|
script: [
|
|
2374
2402
|
`cd ${context.build.dir}`,
|
|
2375
2403
|
...bundlerInstall,
|
|
2376
|
-
...((
|
|
2404
|
+
...((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : [
|
|
2377
2405
|
"bundle exec rubocop",
|
|
2378
2406
|
]),
|
|
2379
2407
|
],
|
|
@@ -2384,11 +2412,11 @@ const createRailsTestJobs = (context) => {
|
|
|
2384
2412
|
name: "🧪 test",
|
|
2385
2413
|
...base,
|
|
2386
2414
|
cache: bundlerCache,
|
|
2387
|
-
image: (
|
|
2415
|
+
image: (_p = (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage) !== null && _p !== void 0 ? _p : defaultImage,
|
|
2388
2416
|
script: [
|
|
2389
2417
|
`cd ${context.build.dir}`,
|
|
2390
2418
|
...bundlerInstall,
|
|
2391
|
-
...((
|
|
2419
|
+
...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : [
|
|
2392
2420
|
"bundle exec rspec",
|
|
2393
2421
|
]),
|
|
2394
2422
|
],
|
|
@@ -2705,6 +2733,7 @@ const createComponentContext = async (ctx) => {
|
|
|
2705
2733
|
const context = {
|
|
2706
2734
|
type: "component",
|
|
2707
2735
|
name: ctx.componentName,
|
|
2736
|
+
componentName: ctx.componentName,
|
|
2708
2737
|
env: ctx.env,
|
|
2709
2738
|
fullConfig: ctx.config,
|
|
2710
2739
|
componentConfig,
|
|
@@ -2877,6 +2906,7 @@ const getEnvironment = async (ctx) => {
|
|
|
2877
2906
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
2878
2907
|
reviewSlug: envContext.reviewSlug,
|
|
2879
2908
|
slug: envContext.environmentSlug,
|
|
2909
|
+
shortName: env,
|
|
2880
2910
|
...variables,
|
|
2881
2911
|
};
|
|
2882
2912
|
};
|
|
@@ -2936,6 +2966,7 @@ exports.getEnvironmentContext = getEnvironmentContext;
|
|
|
2936
2966
|
|
|
2937
2967
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2938
2968
|
exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironmentVariables = void 0;
|
|
2969
|
+
const lodash_1 = __nccwpck_require__(3255);
|
|
2939
2970
|
const deploy_1 = __nccwpck_require__(8483);
|
|
2940
2971
|
const BashExpression_1 = __nccwpck_require__(2376);
|
|
2941
2972
|
const types_1 = __nccwpck_require__(4466);
|
|
@@ -2943,6 +2974,7 @@ const VariableValueContainingReferences_1 = __nccwpck_require__(1592);
|
|
|
2943
2974
|
const resolveAllReferences_1 = __nccwpck_require__(6305);
|
|
2944
2975
|
const getBuildInfoVariables_1 = __nccwpck_require__(7827);
|
|
2945
2976
|
const getEnvironmentContext_1 = __nccwpck_require__(3663);
|
|
2977
|
+
const translateLegacyFromComponents_1 = __nccwpck_require__(7261);
|
|
2946
2978
|
const transformJobOnlyVars_1 = __nccwpck_require__(1552);
|
|
2947
2979
|
const envVars_1 = __nccwpck_require__(6296);
|
|
2948
2980
|
const getBasePredefinedVariables = (ctx) => {
|
|
@@ -2954,7 +2986,7 @@ const getBasePredefinedVariables = (ctx) => {
|
|
|
2954
2986
|
};
|
|
2955
2987
|
};
|
|
2956
2988
|
const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
2957
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2989
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2958
2990
|
const environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
2959
2991
|
const { config, env, componentName } = ctx;
|
|
2960
2992
|
const { envConfigRaw, deployConfigRaw, buildConfigRaw, envType } = environmentContext;
|
|
@@ -2971,8 +3003,12 @@ const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
|
2971
3003
|
...basePredefinedVariables,
|
|
2972
3004
|
ENV_SHORT: "local",
|
|
2973
3005
|
ROOT_URL: url,
|
|
2974
|
-
|
|
2975
|
-
|
|
3006
|
+
// Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
|
|
3007
|
+
...((0, types_1.isStandaloneBuildConfig)(buildConfigRaw) &&
|
|
3008
|
+
buildConfigRaw.type === "rails"
|
|
3009
|
+
? {}
|
|
3010
|
+
: { HOST: host }),
|
|
3011
|
+
HOST_INTERNAL: host,
|
|
2976
3012
|
ROOT_URL_INTERNAL: "http://" + host,
|
|
2977
3013
|
PORT: port.toString(),
|
|
2978
3014
|
};
|
|
@@ -2981,8 +3017,8 @@ const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
|
2981
3017
|
const additionalEnvVars = deployConfigRaw
|
|
2982
3018
|
? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext)
|
|
2983
3019
|
: {};
|
|
2984
|
-
const
|
|
2985
|
-
host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c :
|
|
3020
|
+
const HOST_INTERNAL = (_b = additionalEnvVars.HOST_INTERNAL) !== null && _b !== void 0 ? _b : "unknown-host.example.com";
|
|
3021
|
+
host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c : HOST_INTERNAL;
|
|
2986
3022
|
url = (0, BashExpression_1.joinBashExpressions)(["https://", host]);
|
|
2987
3023
|
predefinedVariables = {
|
|
2988
3024
|
...basePredefinedVariables,
|
|
@@ -2990,10 +3026,12 @@ const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
|
2990
3026
|
...((0, types_1.isStandaloneBuildConfig)(buildConfigRaw) &&
|
|
2991
3027
|
buildConfigRaw.type === "rails"
|
|
2992
3028
|
? {}
|
|
2993
|
-
: {
|
|
3029
|
+
: { HOST: host }),
|
|
2994
3030
|
ROOT_URL: url,
|
|
2995
|
-
|
|
2996
|
-
|
|
3031
|
+
HOST_INTERNAL,
|
|
3032
|
+
/**@deprecated */
|
|
3033
|
+
HOST_CANONICAL: HOST_INTERNAL, // legacy alias for HOST_INTERNAL
|
|
3034
|
+
ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOST_INTERNAL]),
|
|
2997
3035
|
...additionalEnvVars,
|
|
2998
3036
|
};
|
|
2999
3037
|
}
|
|
@@ -3006,14 +3044,17 @@ const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
|
3006
3044
|
...additionalSecretKeys,
|
|
3007
3045
|
];
|
|
3008
3046
|
const secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
|
|
3009
|
-
|
|
3047
|
+
// this is deprecated, we now support: $componentname:FOO
|
|
3048
|
+
const legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
|
|
3049
|
+
const publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, translateLegacyFromComponents_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
3050
|
+
const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
|
|
3010
3051
|
const publicEnvVarsUnresolved = Object.fromEntries(Object.entries(publicEnvVarsRawSanitized).map(([key, value]) => [
|
|
3011
3052
|
key,
|
|
3012
3053
|
(0, VariableValueContainingReferences_1.createVariableValueContainingReferencesFromString)(value, {
|
|
3013
3054
|
componentName: ctx.componentName,
|
|
3014
3055
|
}),
|
|
3015
3056
|
]));
|
|
3016
|
-
const publicEnvVars = ((
|
|
3057
|
+
const publicEnvVars = ((_k = options.shouldResolveReferences) !== null && _k !== void 0 ? _k : true)
|
|
3017
3058
|
? await (0, resolveAllReferences_1.resolveAllReferences)(publicEnvVarsUnresolved, async (otherComponentName) => {
|
|
3018
3059
|
const { envVars: otherEnvVars } = await (0, exports.getEnvironmentVariables)({
|
|
3019
3060
|
...ctx,
|
|
@@ -3188,6 +3229,26 @@ exports.transformJobOnlyVars = transformJobOnlyVars;
|
|
|
3188
3229
|
|
|
3189
3230
|
/***/ }),
|
|
3190
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
|
+
|
|
3191
3252
|
/***/ 6296:
|
|
3192
3253
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3193
3254
|
|
|
@@ -3248,7 +3309,7 @@ const stop_1 = __nccwpck_require__(2846);
|
|
|
3248
3309
|
const variables_1 = __nccwpck_require__(2422);
|
|
3249
3310
|
exports.DEPLOY_JOB_NAME = "🚀 Deploy";
|
|
3250
3311
|
const createDeployJob = (context, jobDefinition) => {
|
|
3251
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3312
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
3252
3313
|
const hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
3253
3314
|
const isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
3254
3315
|
const autoStop = context.environment.envType === "review"
|
|
@@ -3329,12 +3390,13 @@ const createDeployJob = (context, jobDefinition) => {
|
|
|
3329
3390
|
...context.environment.envVars,
|
|
3330
3391
|
...(hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}),
|
|
3331
3392
|
...context.environment.jobOnlyVars.deploy.envVars,
|
|
3393
|
+
...(deployConfig ? (_e = deployConfig.extraVars) !== null && _e !== void 0 ? _e : {} : {}),
|
|
3332
3394
|
...jobDefinition.variables,
|
|
3333
3395
|
},
|
|
3334
3396
|
runnerVariables: {
|
|
3335
3397
|
...variables_1.DEPLOY_RUNNER_VARIABLES,
|
|
3336
|
-
...((
|
|
3337
|
-
...(deployConfig ? (
|
|
3398
|
+
...((_f = jobDefinition.runnerVariables) !== null && _f !== void 0 ? _f : {}),
|
|
3399
|
+
...(deployConfig ? (_g = deployConfig.runnerVariables) !== null && _g !== void 0 ? _g : {} : {}),
|
|
3338
3400
|
},
|
|
3339
3401
|
environment: isStoppable
|
|
3340
3402
|
? {
|
|
@@ -4201,7 +4263,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
4201
4263
|
],
|
|
4202
4264
|
getAdditionalEnvVars: (ctx) => {
|
|
4203
4265
|
const { fullName, env, componentName, deployConfigRaw } = ctx;
|
|
4204
|
-
const
|
|
4266
|
+
const HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
|
|
4205
4267
|
fullName,
|
|
4206
4268
|
(0, BashExpression_1.getBashVariable)((0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)),
|
|
4207
4269
|
], "-").toLowerCase();
|
|
@@ -4212,7 +4274,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
4212
4274
|
]))
|
|
4213
4275
|
: {};
|
|
4214
4276
|
return {
|
|
4215
|
-
|
|
4277
|
+
HOST_INTERNAL,
|
|
4216
4278
|
...getCloudSqlVariables(ctx),
|
|
4217
4279
|
...jobTriggers,
|
|
4218
4280
|
DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw
|
|
@@ -4626,7 +4688,7 @@ const hasKubernetesCloudSQL = (context) => {
|
|
|
4626
4688
|
};
|
|
4627
4689
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
4628
4690
|
const createKubernetesCloudsqlBaseValues = (context) => {
|
|
4629
|
-
var _a, _b, _c;
|
|
4691
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
4630
4692
|
const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
4631
4693
|
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
4632
4694
|
throw new Error("cannot get cloud sql config");
|
|
@@ -4636,11 +4698,23 @@ const createKubernetesCloudsqlBaseValues = (context) => {
|
|
|
4636
4698
|
throw new Error("cannot get cloud sql config");
|
|
4637
4699
|
}
|
|
4638
4700
|
const proxyCredentials = `$${(0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials")}`;
|
|
4639
|
-
if (config.type
|
|
4701
|
+
if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
|
|
4702
|
+
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}`;
|
|
4703
|
+
return {
|
|
4704
|
+
cloudsql: {
|
|
4705
|
+
enabled: config.enabled,
|
|
4706
|
+
dbUser: "postgres",
|
|
4707
|
+
instanceConnectionName,
|
|
4708
|
+
proxyCredentials,
|
|
4709
|
+
fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : "",
|
|
4710
|
+
},
|
|
4711
|
+
};
|
|
4712
|
+
}
|
|
4713
|
+
else if (config.type === "unmanaged") {
|
|
4640
4714
|
return {
|
|
4641
4715
|
cloudsql: {
|
|
4642
4716
|
enabled: config.enabled,
|
|
4643
|
-
dbUser: (
|
|
4717
|
+
dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
|
|
4644
4718
|
instanceConnectionName: config.instanceConnectionName,
|
|
4645
4719
|
proxyCredentials,
|
|
4646
4720
|
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.name),
|
|
@@ -4702,6 +4776,8 @@ const createKubernetesDeployJobs = (context) => {
|
|
|
4702
4776
|
...((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []),
|
|
4703
4777
|
].join(" "),
|
|
4704
4778
|
COMPONENT_NAME: context.name,
|
|
4779
|
+
/** @deprecated */
|
|
4780
|
+
BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID,
|
|
4705
4781
|
},
|
|
4706
4782
|
};
|
|
4707
4783
|
const clusterName = `kube-${context.environment.fullName}`;
|
|
@@ -4785,7 +4861,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
4785
4861
|
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
|
|
4786
4862
|
fullConfig.domainCanonical ||
|
|
4787
4863
|
"panter.cloud";
|
|
4788
|
-
const
|
|
4864
|
+
const HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
|
|
4789
4865
|
componentSlug,
|
|
4790
4866
|
...(envType === "review" && reviewSlug ? [reviewSlug] : []),
|
|
4791
4867
|
env,
|
|
@@ -4797,7 +4873,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
4797
4873
|
KUBE_NAMESPACE,
|
|
4798
4874
|
KUBE_APP_NAME,
|
|
4799
4875
|
KUBE_APP_NAME_PREFIX,
|
|
4800
|
-
|
|
4876
|
+
HOST_INTERNAL,
|
|
4801
4877
|
};
|
|
4802
4878
|
},
|
|
4803
4879
|
};
|
|
@@ -4870,6 +4946,7 @@ const types_1 = __nccwpck_require__(5781);
|
|
|
4870
4946
|
const cloudSql_1 = __nccwpck_require__(5129);
|
|
4871
4947
|
const kubeEnv_1 = __nccwpck_require__(6769);
|
|
4872
4948
|
const mongodb_1 = __nccwpck_require__(4139);
|
|
4949
|
+
const processSecretsAsFiles_1 = __nccwpck_require__(6089);
|
|
4873
4950
|
const createAppConfig = (context, application) => {
|
|
4874
4951
|
if (application === false) {
|
|
4875
4952
|
return {
|
|
@@ -4926,11 +5003,11 @@ const createKubeValues = (context) => {
|
|
|
4926
5003
|
: {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled)
|
|
4927
5004
|
? (0, mongodb_1.createMongodbBaseConfig)(context)
|
|
4928
5005
|
: {});
|
|
4929
|
-
const kubeValues = (0, utils_1.mergeWithMergingArrays)(defaultKubeValues, {
|
|
5006
|
+
const kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, {
|
|
4930
5007
|
jobs: removeFalsy(jobs),
|
|
4931
5008
|
cronjobs: removeFalsy(cronjobs),
|
|
4932
5009
|
...rest,
|
|
4933
|
-
});
|
|
5010
|
+
}));
|
|
4934
5011
|
return kubeValues;
|
|
4935
5012
|
};
|
|
4936
5013
|
exports.createKubeValues = createKubeValues;
|
|
@@ -5049,6 +5126,40 @@ exports.createMongodbBaseConfig = createMongodbBaseConfig;
|
|
|
5049
5126
|
|
|
5050
5127
|
/***/ }),
|
|
5051
5128
|
|
|
5129
|
+
/***/ 6089:
|
|
5130
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5131
|
+
|
|
5132
|
+
"use strict";
|
|
5133
|
+
|
|
5134
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5135
|
+
exports.processSecretsAsFiles = void 0;
|
|
5136
|
+
const lodash_1 = __nccwpck_require__(3255);
|
|
5137
|
+
const processSecretsAsFiles = (values) => {
|
|
5138
|
+
if (!values.secretsAsFile || values.secretsAsFile.length === 0) {
|
|
5139
|
+
return values;
|
|
5140
|
+
}
|
|
5141
|
+
// the initial idea was that we "shadow" secrets that we mount as files,
|
|
5142
|
+
// but there is a weird kubernetes issue with that (https://github.com/kubernetes/kubernetes/issues/46861),
|
|
5143
|
+
// 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
|
|
5144
|
+
return {
|
|
5145
|
+
...values,
|
|
5146
|
+
env: {
|
|
5147
|
+
...values.env,
|
|
5148
|
+
secret: {
|
|
5149
|
+
...(0, lodash_1.omit)(values.env.secret, values.secretsAsFile),
|
|
5150
|
+
...Object.fromEntries(values.secretsAsFile.map((key) => [
|
|
5151
|
+
key + "_content",
|
|
5152
|
+
values.env.secret[key],
|
|
5153
|
+
])),
|
|
5154
|
+
},
|
|
5155
|
+
},
|
|
5156
|
+
};
|
|
5157
|
+
};
|
|
5158
|
+
exports.processSecretsAsFiles = processSecretsAsFiles;
|
|
5159
|
+
//# sourceMappingURL=processSecretsAsFiles.js.map
|
|
5160
|
+
|
|
5161
|
+
/***/ }),
|
|
5162
|
+
|
|
5052
5163
|
/***/ 4986:
|
|
5053
5164
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5054
5165
|
|
|
@@ -5229,6 +5340,30 @@ __exportStar(__nccwpck_require__(2990), exports);
|
|
|
5229
5340
|
|
|
5230
5341
|
/***/ }),
|
|
5231
5342
|
|
|
5343
|
+
/***/ 1792:
|
|
5344
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5345
|
+
|
|
5346
|
+
"use strict";
|
|
5347
|
+
|
|
5348
|
+
var _a;
|
|
5349
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5350
|
+
// we can't import the package.json directly, because the bundling process will inline it
|
|
5351
|
+
// but the version is only set during deployement, when its already bundled
|
|
5352
|
+
// instead we need to use require.main.path to get the path of the main module, which is actually the file in the bin
|
|
5353
|
+
// this will point to the root package.json
|
|
5354
|
+
let ownPkg = { version: "0.0.0" };
|
|
5355
|
+
try {
|
|
5356
|
+
const path = ((_a = require.main) === null || _a === void 0 ? void 0 : _a.path) + "/../package.json";
|
|
5357
|
+
ownPkg = require(path);
|
|
5358
|
+
}
|
|
5359
|
+
catch (e) {
|
|
5360
|
+
// ignore, currently in the gitlab-includes, this doesn't work
|
|
5361
|
+
}
|
|
5362
|
+
exports["default"] = ownPkg;
|
|
5363
|
+
//# sourceMappingURL=packageInfos.js.map
|
|
5364
|
+
|
|
5365
|
+
/***/ }),
|
|
5366
|
+
|
|
5232
5367
|
/***/ 3579:
|
|
5233
5368
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5234
5369
|
|
|
@@ -5603,7 +5738,7 @@ const getFullReferencedJobNameFromWorkspace = (referencedJobName, workspaceName,
|
|
|
5603
5738
|
const getJobName = (need) => (0, lodash_1.isObject)(need) ? need.job : need;
|
|
5604
5739
|
const makeGitlabJob = (context, job, allJobs, baseRules) => {
|
|
5605
5740
|
var _a, _b;
|
|
5606
|
-
const { environment, envMode, needsStages, name, needs, jobTags, script, variables, runnerVariables, when, ...rest } = job;
|
|
5741
|
+
const { environment, envMode, needsStages, needsOtherComponent, name, needs, jobTags, script, variables, runnerVariables, when, ...rest } = job;
|
|
5607
5742
|
const stage = envMode === "stagePerEnv" ? `${job.stage} ${context.env}` : job.stage;
|
|
5608
5743
|
const deduplicatedGitlabNeeds = getGitlabNeeds(context, job, allJobs);
|
|
5609
5744
|
const fullJobName = getFullJobName({
|
|
@@ -5727,7 +5862,7 @@ function deduplicateNeeds(needs) {
|
|
|
5727
5862
|
? [...new Map(needs.map((n) => [(0, lodash_1.isObject)(n) ? n.job : n, n])).values()]
|
|
5728
5863
|
: undefined;
|
|
5729
5864
|
}
|
|
5730
|
-
function getGitlabNeedsForComponentJob(context, { needsStages, needs }, allJobs) {
|
|
5865
|
+
function getGitlabNeedsForComponentJob(context, { needsStages, needs, needsOtherComponent }, allJobs) {
|
|
5731
5866
|
const needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap((n) => {
|
|
5732
5867
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5733
5868
|
const componentName = context.name;
|
|
@@ -5761,6 +5896,8 @@ function getGitlabNeedsForComponentJob(context, { needsStages, needs }, allJobs)
|
|
|
5761
5896
|
const cleanedNeeds = [
|
|
5762
5897
|
...(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []),
|
|
5763
5898
|
...(needs !== null && needs !== void 0 ? needs : []),
|
|
5899
|
+
// pull in legacy needs from other component, which is now identical to needs
|
|
5900
|
+
...(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []),
|
|
5764
5901
|
];
|
|
5765
5902
|
return cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map((n) => {
|
|
5766
5903
|
var _a;
|
|
@@ -6462,18 +6599,22 @@ exports.removeUndefined = removeUndefined;
|
|
|
6462
6599
|
/***/ }),
|
|
6463
6600
|
|
|
6464
6601
|
/***/ 2228:
|
|
6465
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__)
|
|
6602
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
6466
6603
|
|
|
6467
6604
|
"use strict";
|
|
6468
6605
|
|
|
6606
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6607
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6608
|
+
};
|
|
6469
6609
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6470
6610
|
exports.writeYamlfile = exports.yamlStringifyOptions = exports.writeGeneratedFile = exports.getAutoGeneratedHeader = void 0;
|
|
6471
6611
|
const promises_1 = __nccwpck_require__(3292);
|
|
6472
6612
|
const yaml_1 = __nccwpck_require__(8033);
|
|
6613
|
+
const packageInfos_1 = __importDefault(__nccwpck_require__(1792));
|
|
6473
6614
|
const getAutoGeneratedHeader = (commentChar) => {
|
|
6474
6615
|
return [
|
|
6475
6616
|
"-------------------------------------------------",
|
|
6476
|
-
`🐱 🔨 This file is generated by catladder`,
|
|
6617
|
+
`🐱 🔨 This file is generated by catladder v${packageInfos_1.default.version}`,
|
|
6477
6618
|
`🚨 Do not edit this file manually 🚨`,
|
|
6478
6619
|
"-------------------------------------------------",
|
|
6479
6620
|
]
|