@catladder/cli 0.0.0-next-51c86d8a → 0.0.0-next-84c974cd

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.
Files changed (50) hide show
  1. package/dist/bundles/catenv/index.js +53 -131
  2. package/dist/bundles/cli/index.js +53 -131
  3. package/dist/pipeline/src/build/base/createAppBuildJob.js +2 -3
  4. package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
  5. package/dist/pipeline/src/build/custom/testJob.js +10 -11
  6. package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
  7. package/dist/pipeline/src/build/node/testJob.js +10 -11
  8. package/dist/pipeline/src/build/node/testJob.js.map +1 -1
  9. package/dist/pipeline/src/build/rails/build.js +0 -1
  10. package/dist/pipeline/src/build/rails/build.js.map +1 -1
  11. package/dist/pipeline/src/build/rails/test.js +7 -8
  12. package/dist/pipeline/src/build/rails/test.js.map +1 -1
  13. package/dist/pipeline/src/build/types.d.ts +0 -10
  14. package/dist/pipeline/src/build/types.js.map +1 -1
  15. package/dist/pipeline/src/context/createComponentContext.js +0 -1
  16. package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
  17. package/dist/pipeline/src/context/getEnvironment.js +0 -1
  18. package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
  19. package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +2 -5
  20. package/dist/pipeline/src/context/getEnvironmentVariables.js +9 -19
  21. package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
  22. package/dist/pipeline/src/context/resolveReferences.d.ts +0 -3
  23. package/dist/pipeline/src/context/resolveReferences.js +1 -10
  24. package/dist/pipeline/src/context/resolveReferences.js.map +1 -1
  25. package/dist/pipeline/src/deploy/base/deploy.js +3 -4
  26. package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
  27. package/dist/pipeline/src/deploy/cloudRun/index.js +2 -2
  28. package/dist/pipeline/src/deploy/cloudRun/index.js.map +1 -1
  29. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +3 -15
  30. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
  31. package/dist/pipeline/src/deploy/kubernetes/deployJob.js +0 -2
  32. package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
  33. package/dist/pipeline/src/deploy/kubernetes/index.js +2 -2
  34. package/dist/pipeline/src/deploy/kubernetes/index.js.map +1 -1
  35. package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +1 -2
  36. package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +2 -3
  37. package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
  38. package/dist/pipeline/src/deploy/types/base.d.ts +0 -6
  39. package/dist/pipeline/src/deploy/types/kubernetes.d.ts +1 -34
  40. package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +2 -4
  41. package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
  42. package/dist/pipeline/src/types/config.d.ts +0 -8
  43. package/dist/pipeline/src/types/context.d.ts +0 -8
  44. package/dist/pipeline/src/types/context.js.map +1 -1
  45. package/dist/pipeline/src/types/jobs.d.ts +0 -8
  46. package/dist/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +1 -1
  48. package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.d.ts +0 -85
  49. package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js +0 -27
  50. package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js.map +0 -1
@@ -1063,7 +1063,7 @@ const constants_1 = __nccwpck_require__(2786);
1063
1063
  const writeBuildInfo_1 = __nccwpck_require__(9578);
1064
1064
  const writeDotEnv_1 = __nccwpck_require__(8052);
1065
1065
  const createAppBuildJob = (context, { script, variables, runnerVariables, cache, ...def }) => {
1066
- var _a, _b;
1066
+ var _a;
1067
1067
  return (0, lodash_1.merge)({
1068
1068
  name: constants_1.APP_BUILD_JOB_NAME,
1069
1069
  envMode: "jobPerEnv",
@@ -1077,14 +1077,13 @@ const createAppBuildJob = (context, { script, variables, runnerVariables, cache,
1077
1077
  ? {
1078
1078
  ...context.environment.envVars,
1079
1079
  ...context.environment.jobOnlyVars.build.envVars,
1080
- ...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
1081
1080
  }
1082
1081
  : {}),
1083
1082
  },
1084
1083
  runnerVariables: {
1085
1084
  ...constants_1.RUNNER_BUILD_RESOURCE_VARIABLES,
1086
1085
  ...(runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}),
1087
- ...((_b = context.build.config.runnerVariables) !== null && _b !== void 0 ? _b : {}),
1086
+ ...((_a = context.build.config.runnerVariables) !== null && _a !== void 0 ? _a : {}),
1088
1087
  },
1089
1088
  script: [
1090
1089
  ...(context.type === "component"
@@ -1484,7 +1483,7 @@ const RUNNER_CUSTOM_TEST_VARIABLES = {
1484
1483
  KUBERNETES_MEMORY_LIMIT: "4Gi",
1485
1484
  };
1486
1485
  const createCustomTestJobs = (context) => {
1487
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
1486
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1488
1487
  // don't run tests after release
1489
1488
  // TODO: this will be replaced by using rules
1490
1489
  if (context.trigger === "taggedRelease") {
@@ -1498,7 +1497,6 @@ const createCustomTestJobs = (context) => {
1498
1497
  variables: {
1499
1498
  APP_PATH: context.build.dir,
1500
1499
  ...context.environment.jobOnlyVars.build.envVars,
1501
- ...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
1502
1500
  },
1503
1501
  runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
1504
1502
  services: buildConfig.jobServices,
@@ -1511,29 +1509,29 @@ const createCustomTestJobs = (context) => {
1511
1509
  ? {
1512
1510
  name: "🛡 audit",
1513
1511
  ...base,
1514
- image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage,
1512
+ image: (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : buildConfig.jobImage,
1515
1513
  cache: undefined,
1516
- script: [...(0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)],
1514
+ script: [...(0, utils_1.ensureArray)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)],
1517
1515
  allow_failure: true,
1518
- ...(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),
1516
+ ...(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),
1519
1517
  }
1520
1518
  : null;
1521
1519
  const lintJob = buildConfig.lint
1522
1520
  ? {
1523
1521
  name: "👮 lint",
1524
1522
  ...base,
1525
- image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage,
1526
- script: [...(0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)],
1527
- ...(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),
1523
+ image: (_g = (_f = buildConfig.lint) === null || _f === void 0 ? void 0 : _f.jobImage) !== null && _g !== void 0 ? _g : buildConfig.jobImage,
1524
+ script: [...(0, utils_1.ensureArray)((_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.command)],
1525
+ ...(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),
1528
1526
  }
1529
1527
  : null;
1530
1528
  const testJob = buildConfig.test
1531
1529
  ? {
1532
1530
  name: "🧪 test",
1533
1531
  ...base,
1534
- image: (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage,
1535
- script: [...(0, utils_1.ensureArray)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)],
1536
- ...(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),
1532
+ image: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : buildConfig.jobImage,
1533
+ script: [...(0, utils_1.ensureArray)((_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.command)],
1534
+ ...(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),
1537
1535
  }
1538
1536
  : null;
1539
1537
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
@@ -2071,7 +2069,7 @@ const constants_1 = __nccwpck_require__(1765);
2071
2069
  const yarn_1 = __nccwpck_require__(5043);
2072
2070
  const createJobCache_1 = __nccwpck_require__(4372);
2073
2071
  const createNodeTestJobs = (context) => {
2074
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2072
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
2075
2073
  // don't run tests after release
2076
2074
  // TODO: this will be replaced by using rules
2077
2075
  if (context.trigger === "taggedRelease") {
@@ -2089,7 +2087,6 @@ const createNodeTestJobs = (context) => {
2089
2087
  ...(context.type === "component"
2090
2088
  ? {
2091
2089
  ...context.environment.jobOnlyVars.build.envVars,
2092
- ...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
2093
2090
  }
2094
2091
  : {}),
2095
2092
  },
@@ -2104,48 +2101,48 @@ const createNodeTestJobs = (context) => {
2104
2101
  ? {
2105
2102
  name: "🛡 audit",
2106
2103
  ...base,
2107
- image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
2104
+ image: (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage,
2108
2105
  cache: undefined, // audit does not need yarn install and no cache
2109
2106
  script: [
2110
2107
  `cd ${context.build.dir}`,
2111
- ...((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
2108
+ ...((_d = (0, utils_1.ensureArrayOrNull)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : [
2112
2109
  context.packageManagerInfo.isClassic
2113
2110
  ? "yarn audit"
2114
2111
  : "yarn npm audit --environment production", // yarn 2
2115
2112
  ]),
2116
2113
  ],
2117
2114
  allow_failure: true,
2118
- ...(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),
2115
+ ...(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),
2119
2116
  }
2120
2117
  : null;
2121
2118
  const lintJob = buildConfig.lint !== false
2122
2119
  ? {
2123
2120
  name: "👮 lint",
2124
2121
  ...base,
2125
- image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
2122
+ image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
2126
2123
  cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
2127
2124
  script: [
2128
2125
  ...(0, yarn_1.ensureNodeVersion)(context),
2129
2126
  `cd ${context.build.dir}`,
2130
2127
  ...yarnInstall,
2131
- ...((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"]),
2128
+ ...((_k = (0, utils_1.ensureArrayOrNull)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : ["yarn lint"]),
2132
2129
  ],
2133
- ...(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),
2130
+ ...(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),
2134
2131
  }
2135
2132
  : null;
2136
2133
  const testJob = buildConfig.test !== false
2137
2134
  ? {
2138
2135
  name: "🧪 test",
2139
2136
  ...base,
2140
- 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"),
2137
+ 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"),
2141
2138
  cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
2142
2139
  script: [
2143
2140
  ...(0, yarn_1.ensureNodeVersion)(context),
2144
2141
  `cd ${context.build.dir}`,
2145
2142
  ...yarnInstall,
2146
- ...((_s = (0, utils_1.ensureArrayOrNull)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"]),
2143
+ ...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : ["yarn test"]),
2147
2144
  ],
2148
- ...(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),
2145
+ ...(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),
2149
2146
  }
2150
2147
  : null;
2151
2148
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
@@ -2261,7 +2258,6 @@ const createRailsBuildJobs = (context) => {
2261
2258
  dockerBuild: {
2262
2259
  variables: {
2263
2260
  ...context.environment.jobOnlyVars.build.envVars,
2264
- ...context.build.config.extraVars,
2265
2261
  },
2266
2262
  // custom script
2267
2263
  script: [
@@ -2309,7 +2305,7 @@ exports.createRailsTestJobs = void 0;
2309
2305
  const __1 = __nccwpck_require__(603);
2310
2306
  const utils_1 = __nccwpck_require__(2497);
2311
2307
  const createRailsTestJobs = (context) => {
2312
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
2308
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
2313
2309
  // don't run tests after release
2314
2310
  // TODO: this will be replaced by using rules
2315
2311
  if (context.trigger === "taggedRelease") {
@@ -2323,7 +2319,6 @@ const createRailsTestJobs = (context) => {
2323
2319
  const base = {
2324
2320
  variables: {
2325
2321
  ...context.environment.jobOnlyVars.build.envVars,
2326
- ...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
2327
2322
  },
2328
2323
  stage: "test",
2329
2324
  needs: [],
@@ -2347,10 +2342,10 @@ const createRailsTestJobs = (context) => {
2347
2342
  name: "🛡 audit",
2348
2343
  ...base,
2349
2344
  cache: undefined, // audit does not need bundle install and no cache
2350
- 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,
2345
+ 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,
2351
2346
  script: [
2352
2347
  `cd ${context.build.dir}`,
2353
- ...((_f = (0, utils_1.ensureArrayOrNull)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [
2348
+ ...((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
2354
2349
  "gem install bundler-audit",
2355
2350
  "bundle audit check",
2356
2351
  ]),
@@ -2363,11 +2358,11 @@ const createRailsTestJobs = (context) => {
2363
2358
  name: "👮 lint",
2364
2359
  ...base,
2365
2360
  cache: bundlerCache,
2366
- 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,
2361
+ 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,
2367
2362
  script: [
2368
2363
  `cd ${context.build.dir}`,
2369
2364
  ...bundlerInstall,
2370
- ...((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : [
2365
+ ...((_k = (0, utils_1.ensureArrayOrNull)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : [
2371
2366
  "bundle exec rubocop",
2372
2367
  ]),
2373
2368
  ],
@@ -2378,11 +2373,11 @@ const createRailsTestJobs = (context) => {
2378
2373
  name: "🧪 test",
2379
2374
  ...base,
2380
2375
  cache: bundlerCache,
2381
- 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,
2376
+ 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,
2382
2377
  script: [
2383
2378
  `cd ${context.build.dir}`,
2384
2379
  ...bundlerInstall,
2385
- ...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : [
2380
+ ...((_q = (0, utils_1.ensureArrayOrNull)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)) !== null && _q !== void 0 ? _q : [
2386
2381
  "bundle exec rspec",
2387
2382
  ]),
2388
2383
  ],
@@ -2699,7 +2694,6 @@ const createComponentContext = async (ctx) => {
2699
2694
  const context = {
2700
2695
  type: "component",
2701
2696
  name: ctx.componentName,
2702
- componentName: ctx.componentName,
2703
2697
  env: ctx.env,
2704
2698
  fullConfig: ctx.config,
2705
2699
  componentConfig,
@@ -2872,7 +2866,6 @@ const getEnvironment = async (ctx) => {
2872
2866
  slugPrefix: envContext.environmentSlugPrefix,
2873
2867
  reviewSlug: envContext.reviewSlug,
2874
2868
  slug: envContext.environmentSlug,
2875
- shortName: env,
2876
2869
  ...variables,
2877
2870
  };
2878
2871
  };
@@ -2932,7 +2925,6 @@ exports.getEnvironmentContext = getEnvironmentContext;
2932
2925
 
2933
2926
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2934
2927
  exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironmentVariables = void 0;
2935
- const lodash_1 = __nccwpck_require__(3255);
2936
2928
  const deploy_1 = __nccwpck_require__(8483);
2937
2929
  const BashExpression_1 = __nccwpck_require__(2376);
2938
2930
  const types_1 = __nccwpck_require__(4466);
@@ -2950,7 +2942,7 @@ const getBasePredefinedVariables = (ctx) => {
2950
2942
  };
2951
2943
  };
2952
2944
  const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
2953
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2945
+ var _a, _b, _c, _d, _e, _f, _g;
2954
2946
  const environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
2955
2947
  const { config, env, componentName } = ctx;
2956
2948
  const { envConfigRaw, deployConfigRaw, buildConfigRaw, envType } = environmentContext;
@@ -2967,12 +2959,8 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
2967
2959
  ...basePredefinedVariables,
2968
2960
  ENV_SHORT: "local",
2969
2961
  ROOT_URL: url,
2970
- // Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
2971
- ...((0, types_1.isStandaloneBuildConfig)(buildConfigRaw) &&
2972
- buildConfigRaw.type === "rails"
2973
- ? {}
2974
- : { HOST: host }),
2975
- HOST_INTERNAL: host,
2962
+ HOSTNAME: host,
2963
+ HOSTNAME_INTERNAL: host,
2976
2964
  ROOT_URL_INTERNAL: "http://" + host,
2977
2965
  PORT: port.toString(),
2978
2966
  };
@@ -2981,8 +2969,8 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
2981
2969
  const additionalEnvVars = deployConfigRaw
2982
2970
  ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext)
2983
2971
  : {};
2984
- const HOST_INTERNAL = (_b = additionalEnvVars.HOST_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 : HOST_INTERNAL;
2972
+ const HOSTNAME_INTERNAL = (_b = additionalEnvVars.HOSTNAME_INTERNAL) !== null && _b !== void 0 ? _b : "unknown-host.example.com";
2973
+ host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c : HOSTNAME_INTERNAL;
2986
2974
  url = (0, BashExpression_1.joinBashExpressions)(["https://", host]);
2987
2975
  predefinedVariables = {
2988
2976
  ...basePredefinedVariables,
@@ -2990,12 +2978,10 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
2990
2978
  ...((0, types_1.isStandaloneBuildConfig)(buildConfigRaw) &&
2991
2979
  buildConfigRaw.type === "rails"
2992
2980
  ? {}
2993
- : { HOST: host }),
2981
+ : { HOSTNAME: host }),
2994
2982
  ROOT_URL: url,
2995
- HOST_INTERNAL,
2996
- /**@deprecated */
2997
- HOST_CANONICAL: HOST_INTERNAL, // legacy alias for HOST_INTERNAL
2998
- ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOST_INTERNAL]),
2983
+ HOSTNAME_INTERNAL,
2984
+ ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOSTNAME_INTERNAL]),
2999
2985
  ...additionalEnvVars,
3000
2986
  };
3001
2987
  }
@@ -3008,10 +2994,7 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
3008
2994
  ...additionalSecretKeys,
3009
2995
  ];
3010
2996
  const secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
3011
- // this is deprecated, we now support: $componentname:FOO
3012
- const legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
3013
- const publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
3014
- const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
2997
+ const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRaw);
3015
2998
  const envVarsRaw = addIndexVar({
3016
2999
  ...predefinedVariables,
3017
3000
  ...secretEnvVars,
@@ -3150,7 +3133,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3150
3133
  return (mod && mod.__esModule) ? mod : { "default": mod };
3151
3134
  };
3152
3135
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3153
- exports.translateLegacyFromComponents = exports.resolveReferences = void 0;
3136
+ exports.resolveReferences = void 0;
3154
3137
  const lodash_1 = __nccwpck_require__(3255);
3155
3138
  const replaceAsync_1 = __importDefault(__nccwpck_require__(2233));
3156
3139
  // regex to resolve references in catladder variables
@@ -3200,15 +3183,6 @@ const resolveReferences = async (vars, getOtherVariables, alreadyVisitedBase = {
3200
3183
  })));
3201
3184
  };
3202
3185
  exports.resolveReferences = resolveReferences;
3203
- const translateLegacyFromComponents = (fromComponents) => {
3204
- return Object.fromEntries(Object.entries(fromComponents).flatMap(([componentName, variables]) => {
3205
- return Object.entries(variables).map(([ourName, otherName]) => [
3206
- ourName,
3207
- "${" + componentName + ":" + otherName + "}",
3208
- ]);
3209
- }));
3210
- };
3211
- exports.translateLegacyFromComponents = translateLegacyFromComponents;
3212
3186
  //# sourceMappingURL=resolveReferences.js.map
3213
3187
 
3214
3188
  /***/ }),
@@ -3314,7 +3288,7 @@ const stop_1 = __nccwpck_require__(2846);
3314
3288
  const variables_1 = __nccwpck_require__(2422);
3315
3289
  exports.DEPLOY_JOB_NAME = "🚀 Deploy";
3316
3290
  const createDeployJob = (context, jobDefinition) => {
3317
- var _a, _b, _c, _d, _e, _f, _g;
3291
+ var _a, _b, _c, _d, _e, _f;
3318
3292
  const hasDocker = (0, docker_1.requiresDockerBuild)(context);
3319
3293
  const isStoppable = (0, utils_1.contextIsStoppable)(context);
3320
3294
  const autoStop = context.environment.envType === "review"
@@ -3393,13 +3367,12 @@ const createDeployJob = (context, jobDefinition) => {
3393
3367
  ...context.environment.envVars,
3394
3368
  ...(hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}),
3395
3369
  ...context.environment.jobOnlyVars.deploy.envVars,
3396
- ...(deployConfig ? (_e = deployConfig.extraVars) !== null && _e !== void 0 ? _e : {} : {}),
3397
3370
  ...jobDefinition.variables,
3398
3371
  },
3399
3372
  runnerVariables: {
3400
3373
  ...variables_1.DEPLOY_RUNNER_VARIABLES,
3401
- ...((_f = jobDefinition.runnerVariables) !== null && _f !== void 0 ? _f : {}),
3402
- ...(deployConfig ? (_g = deployConfig.runnerVariables) !== null && _g !== void 0 ? _g : {} : {}),
3374
+ ...((_e = jobDefinition.runnerVariables) !== null && _e !== void 0 ? _e : {}),
3375
+ ...(deployConfig ? (_f = deployConfig.runnerVariables) !== null && _f !== void 0 ? _f : {} : {}),
3403
3376
  },
3404
3377
  environment: isStoppable
3405
3378
  ? {
@@ -4248,7 +4221,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
4248
4221
  ],
4249
4222
  getAdditionalEnvVars: (ctx) => {
4250
4223
  const { fullName, env, componentName, deployConfigRaw } = ctx;
4251
- const HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
4224
+ const HOSTNAME_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
4252
4225
  fullName,
4253
4226
  (0, BashExpression_1.getBashVariable)((0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)),
4254
4227
  ], "-").toLowerCase();
@@ -4259,7 +4232,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
4259
4232
  ]))
4260
4233
  : {};
4261
4234
  return {
4262
- HOST_INTERNAL,
4235
+ HOSTNAME_INTERNAL,
4263
4236
  ...getCloudSqlVariables(ctx),
4264
4237
  ...jobTriggers,
4265
4238
  DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw
@@ -4671,7 +4644,7 @@ const hasKubernetesCloudSQL = (context) => {
4671
4644
  };
4672
4645
  exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
4673
4646
  const createKubernetesCloudsqlBaseValues = (context) => {
4674
- var _a, _b, _c, _d, _e, _f, _g;
4647
+ var _a, _b, _c;
4675
4648
  const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
4676
4649
  if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
4677
4650
  throw new Error("cannot get cloud sql config");
@@ -4681,23 +4654,11 @@ const createKubernetesCloudsqlBaseValues = (context) => {
4681
4654
  throw new Error("cannot get cloud sql config");
4682
4655
  }
4683
4656
  const proxyCredentials = `$${(0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials")}`;
4684
- if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
4685
- 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
+ if (config.type === "unmanaged") {
4686
4658
  return {
4687
4659
  cloudsql: {
4688
4660
  enabled: config.enabled,
4689
- dbUser: "postgres",
4690
- instanceConnectionName,
4691
- proxyCredentials,
4692
- fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : "",
4693
- },
4694
- };
4695
- }
4696
- else if (config.type === "unmanaged") {
4697
- return {
4698
- cloudsql: {
4699
- enabled: config.enabled,
4700
- dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
4661
+ dbUser: (_c = config.dbUser) !== null && _c !== void 0 ? _c : "postgres",
4701
4662
  instanceConnectionName: config.instanceConnectionName,
4702
4663
  proxyCredentials,
4703
4664
  fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.name),
@@ -4759,8 +4720,6 @@ const createKubernetesDeployJobs = (context) => {
4759
4720
  ...((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []),
4760
4721
  ].join(" "),
4761
4722
  COMPONENT_NAME: context.name,
4762
- /** @deprecated */
4763
- BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID,
4764
4723
  },
4765
4724
  };
4766
4725
  const clusterName = `kube-${context.environment.fullName}`;
@@ -4844,7 +4803,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
4844
4803
  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
4845
4804
  fullConfig.domainCanonical ||
4846
4805
  "panter.cloud";
4847
- const HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
4806
+ const HOSTNAME_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
4848
4807
  componentSlug,
4849
4808
  ...(envType === "review" && reviewSlug ? [reviewSlug] : []),
4850
4809
  env,
@@ -4856,7 +4815,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
4856
4815
  KUBE_NAMESPACE,
4857
4816
  KUBE_APP_NAME,
4858
4817
  KUBE_APP_NAME_PREFIX,
4859
- HOST_INTERNAL,
4818
+ HOSTNAME_INTERNAL,
4860
4819
  };
4861
4820
  },
4862
4821
  };
@@ -4929,7 +4888,6 @@ const types_1 = __nccwpck_require__(5781);
4929
4888
  const cloudSql_1 = __nccwpck_require__(5129);
4930
4889
  const kubeEnv_1 = __nccwpck_require__(6769);
4931
4890
  const mongodb_1 = __nccwpck_require__(4139);
4932
- const processSecretsAsFiles_1 = __nccwpck_require__(6089);
4933
4891
  const createAppConfig = (context, application) => {
4934
4892
  if (application === false) {
4935
4893
  return {
@@ -4986,11 +4944,11 @@ const createKubeValues = (context) => {
4986
4944
  : {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled)
4987
4945
  ? (0, mongodb_1.createMongodbBaseConfig)(context)
4988
4946
  : {});
4989
- const kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, {
4947
+ const kubeValues = (0, utils_1.mergeWithMergingArrays)(defaultKubeValues, {
4990
4948
  jobs: removeFalsy(jobs),
4991
4949
  cronjobs: removeFalsy(cronjobs),
4992
4950
  ...rest,
4993
- }));
4951
+ });
4994
4952
  return kubeValues;
4995
4953
  };
4996
4954
  exports.createKubeValues = createKubeValues;
@@ -5109,40 +5067,6 @@ exports.createMongodbBaseConfig = createMongodbBaseConfig;
5109
5067
 
5110
5068
  /***/ }),
5111
5069
 
5112
- /***/ 6089:
5113
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5114
-
5115
- "use strict";
5116
-
5117
- Object.defineProperty(exports, "__esModule", ({ value: true }));
5118
- exports.processSecretsAsFiles = void 0;
5119
- const lodash_1 = __nccwpck_require__(3255);
5120
- const processSecretsAsFiles = (values) => {
5121
- if (!values.secretsAsFile || values.secretsAsFile.length === 0) {
5122
- return values;
5123
- }
5124
- // the initial idea was that we "shadow" secrets that we mount as files,
5125
- // but there is a weird kubernetes issue with that (https://github.com/kubernetes/kubernetes/issues/46861),
5126
- // 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
5127
- return {
5128
- ...values,
5129
- env: {
5130
- ...values.env,
5131
- secret: {
5132
- ...(0, lodash_1.omit)(values.env.secret, values.secretsAsFile),
5133
- ...Object.fromEntries(values.secretsAsFile.map((key) => [
5134
- key + "_content",
5135
- values.env.secret[key],
5136
- ])),
5137
- },
5138
- },
5139
- };
5140
- };
5141
- exports.processSecretsAsFiles = processSecretsAsFiles;
5142
- //# sourceMappingURL=processSecretsAsFiles.js.map
5143
-
5144
- /***/ }),
5145
-
5146
5070
  /***/ 4986:
5147
5071
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5148
5072
 
@@ -5719,7 +5643,7 @@ const getFullReferencedJobNameFromWorkspace = (referencedJobName, workspaceName,
5719
5643
  const getJobName = (need) => (0, lodash_1.isObject)(need) ? need.job : need;
5720
5644
  const makeGitlabJob = (context, job, allJobs, baseRules) => {
5721
5645
  var _a, _b;
5722
- const { environment, envMode, needsStages, needsOtherComponent, name, needs, jobTags, script, variables, runnerVariables, when, ...rest } = job;
5646
+ const { environment, envMode, needsStages, name, needs, jobTags, script, variables, runnerVariables, when, ...rest } = job;
5723
5647
  const stage = envMode === "stagePerEnv" ? `${job.stage} ${context.env}` : job.stage;
5724
5648
  const deduplicatedGitlabNeeds = getGitlabNeeds(context, job, allJobs);
5725
5649
  const fullJobName = getFullJobName({
@@ -5843,7 +5767,7 @@ function deduplicateNeeds(needs) {
5843
5767
  ? [...new Map(needs.map((n) => [(0, lodash_1.isObject)(n) ? n.job : n, n])).values()]
5844
5768
  : undefined;
5845
5769
  }
5846
- function getGitlabNeedsForComponentJob(context, { needsStages, needs, needsOtherComponent }, allJobs) {
5770
+ function getGitlabNeedsForComponentJob(context, { needsStages, needs }, allJobs) {
5847
5771
  const needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap((n) => {
5848
5772
  var _a, _b, _c, _d, _e, _f, _g, _h;
5849
5773
  const componentName = context.name;
@@ -5877,8 +5801,6 @@ function getGitlabNeedsForComponentJob(context, { needsStages, needs, needsOther
5877
5801
  const cleanedNeeds = [
5878
5802
  ...(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []),
5879
5803
  ...(needs !== null && needs !== void 0 ? needs : []),
5880
- // pull in legacy needs from other component, which is now identical to needs
5881
- ...(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []),
5882
5804
  ];
5883
5805
  return cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map((n) => {
5884
5806
  var _a;