@catladder/pipeline 0.0.0-next-e2e4f00a → 0.0.0-next-de346530

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 (107) hide show
  1. package/dist/build/base/createAppBuildJob.js +3 -3
  2. package/dist/build/custom/testJob.js +12 -12
  3. package/dist/build/node/buildJob.js +1 -1
  4. package/dist/build/node/cache.d.ts +2 -4
  5. package/dist/build/node/cache.js +3 -24
  6. package/dist/build/node/testJob.js +11 -11
  7. package/dist/build/rails/build.js +1 -1
  8. package/dist/build/rails/test.js +8 -8
  9. package/dist/build/types.d.ts +0 -10
  10. package/dist/bundles/catladder-gitlab/index.js +74 -174
  11. package/dist/constants.js +1 -1
  12. package/dist/context/__tests__/resolveReferences.test.js +0 -22
  13. package/dist/context/createComponentContext.js +0 -1
  14. package/dist/context/getEnvironment.js +1 -2
  15. package/dist/context/getEnvironmentVariables.d.ts +2 -5
  16. package/dist/context/getEnvironmentVariables.js +17 -24
  17. package/dist/context/resolveReferences.d.ts +1 -4
  18. package/dist/context/resolveReferences.js +2 -16
  19. package/dist/deploy/base/deploy.js +3 -3
  20. package/dist/deploy/cloudRun/index.js +2 -2
  21. package/dist/deploy/kubernetes/cloudSql/index.js +3 -14
  22. package/dist/deploy/kubernetes/deployJob.js +1 -3
  23. package/dist/deploy/kubernetes/index.js +2 -2
  24. package/dist/deploy/kubernetes/kubeValues.d.ts +1 -2
  25. package/dist/deploy/kubernetes/kubeValues.js +2 -3
  26. package/dist/deploy/types/base.d.ts +0 -6
  27. package/dist/deploy/types/kubernetes.d.ts +1 -34
  28. package/dist/pipeline/gitlab/createGitlabJobs.js +3 -5
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/dist/types/config.d.ts +0 -8
  31. package/dist/types/context.d.ts +0 -8
  32. package/dist/types/jobs.d.ts +0 -8
  33. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +36 -68
  34. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +36 -52
  35. package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +1402 -0
  36. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +36 -68
  37. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +36 -68
  38. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +36 -68
  39. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +36 -68
  40. package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +36 -68
  41. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +36 -68
  42. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +36 -68
  43. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +36 -68
  44. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +36 -68
  45. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +36 -68
  46. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +72 -136
  47. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +48 -84
  48. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +36 -68
  49. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +36 -52
  50. package/examples/__snapshots__/custom-build-job.test.ts.snap +36 -52
  51. package/examples/__snapshots__/custom-deploy.test.ts.snap +24 -48
  52. package/examples/__snapshots__/custom-envs.test.ts.snap +18 -48
  53. package/examples/__snapshots__/custom-sbom-java.test.ts.snap +36 -52
  54. package/examples/__snapshots__/git-submodule.test.ts.snap +36 -68
  55. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +60 -112
  56. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +60 -112
  57. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +120 -224
  58. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +60 -112
  59. package/examples/__snapshots__/local-dot-env.test.ts.snap +36 -68
  60. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +60 -96
  61. package/examples/__snapshots__/multiline-var.test.ts.snap +96 -180
  62. package/examples/__snapshots__/native-app.test.ts.snap +72 -132
  63. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +36 -68
  64. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +36 -68
  65. package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +48 -80
  66. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +48 -80
  67. package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +48 -96
  68. package/examples/__snapshots__/{workspace-api-www-custom-cache.test.ts.snap → workspace-api-www-turbo-cache.test.ts.snap} +81 -153
  69. package/examples/__snapshots__/workspace-api-www.test.ts.snap +76 -136
  70. package/examples/{workspace-api-www-custom-cache.test.ts → cloud-run-nextjs.test.ts} +2 -2
  71. package/examples/cloud-run-nextjs.ts +29 -0
  72. package/examples/native-app.ts +10 -6
  73. package/examples/rails-k8s-with-worker.ts +5 -1
  74. package/examples/{kubernetes-with-cloud-sql-legacy.test.ts → workspace-api-www-turbo-cache.test.ts} +2 -2
  75. package/examples/{workspace-api-www-custom-cache.ts → workspace-api-www-turbo-cache.ts} +4 -1
  76. package/examples/workspace-api-www.ts +3 -0
  77. package/package.json +1 -1
  78. package/src/build/base/createAppBuildJob.ts +0 -1
  79. package/src/build/custom/testJob.ts +0 -1
  80. package/src/build/node/buildJob.ts +2 -2
  81. package/src/build/node/cache.ts +0 -29
  82. package/src/build/node/testJob.ts +0 -1
  83. package/src/build/rails/build.ts +0 -1
  84. package/src/build/rails/test.ts +0 -1
  85. package/src/build/types.ts +0 -13
  86. package/src/context/__tests__/resolveReferences.test.ts +1 -27
  87. package/src/context/createComponentContext.ts +0 -1
  88. package/src/context/getEnvironment.ts +1 -1
  89. package/src/context/getEnvironmentVariables.ts +13 -34
  90. package/src/context/resolveReferences.ts +0 -13
  91. package/src/deploy/base/deploy.ts +1 -1
  92. package/src/deploy/cloudRun/index.ts +2 -2
  93. package/src/deploy/kubernetes/cloudSql/index.ts +1 -15
  94. package/src/deploy/kubernetes/deployJob.ts +0 -2
  95. package/src/deploy/kubernetes/index.ts +2 -2
  96. package/src/deploy/kubernetes/kubeValues.ts +5 -8
  97. package/src/deploy/types/base.ts +0 -6
  98. package/src/deploy/types/kubernetes.ts +1 -36
  99. package/src/pipeline/gitlab/createGitlabJobs.ts +1 -4
  100. package/src/types/config.ts +0 -8
  101. package/src/types/context.ts +1 -8
  102. package/src/types/jobs.ts +0 -8
  103. package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +0 -85
  104. package/dist/deploy/kubernetes/processSecretsAsFiles.js +0 -33
  105. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.test.ts.snap +0 -1791
  106. package/examples/kubernetes-with-cloud-sql-legacy.ts +0 -35
  107. package/src/deploy/kubernetes/processSecretsAsFiles.ts +0 -35
@@ -1,11 +1,11 @@
1
1
  import { createYamlLocalPipeline } from "./__utils__/helpers";
2
- import config from "./workspace-api-www-custom-cache";
2
+ import config from "./cloud-run-nextjs";
3
3
 
4
4
  /**
5
5
  * This test is auto-generated.
6
6
  * Modifications will be overwritten on every `yarn test` run!
7
7
  */
8
8
 
9
- it("matches snapshot for workspace-api-www-custom-cache local pipeline YAML", async () => {
9
+ it("matches snapshot for cloud-run-nextjs local pipeline YAML", async () => {
10
10
  expect(await createYamlLocalPipeline(config)).toMatchSnapshot();
11
11
  });
@@ -0,0 +1,29 @@
1
+ import type { Config } from "../src";
2
+
3
+ const config: Config = {
4
+ appName: "test-app",
5
+ customerName: "pan",
6
+ components: {
7
+ www: {
8
+ dotEnv: true,
9
+ dir: "www",
10
+ build: {
11
+ type: "node",
12
+ cache: {
13
+ paths: [".next/cache"],
14
+ },
15
+ },
16
+ deploy: {
17
+ type: "google-cloudrun",
18
+ projectId: "google-project-id",
19
+ region: "europe-west6",
20
+ },
21
+ },
22
+ },
23
+ };
24
+
25
+ export default config;
26
+
27
+ export const information = {
28
+ title: "Cloud Run: With SQL",
29
+ };
@@ -28,9 +28,11 @@ const config: Config = {
28
28
  ],
29
29
  },
30
30
  build: {
31
- extraVars: {
32
- LC_A: "L=en_US.UTF-8",
33
- LANG: "en_US.UTF-8",
31
+ jobVars: {
32
+ public: {
33
+ LC_A: "L=en_US.UTF-8",
34
+ LANG: "en_US.UTF-8",
35
+ },
34
36
  },
35
37
  type: "node",
36
38
  buildCommand: [
@@ -46,9 +48,11 @@ const config: Config = {
46
48
 
47
49
  deploy: {
48
50
  type: "custom",
49
- extraVars: {
50
- LC_A: "L=en_US.UTF-8",
51
- LANG: "en_US.UTF-8",
51
+ jobVars: {
52
+ public: {
53
+ LC_A: "L=en_US.UTF-8",
54
+ LANG: "en_US.UTF-8",
55
+ },
52
56
  },
53
57
  requiresDocker: false,
54
58
  script: [
@@ -44,7 +44,11 @@ const config: Config = {
44
44
  domainCanonical: "panter.cloud",
45
45
  },
46
46
  values: {
47
- cloudsql: { enabled: true, projectId: "some-project-id" },
47
+ cloudsql: {
48
+ enabled: true,
49
+ type: "unmanaged",
50
+ instanceConnectionName: "myproject:europe-west6:instance-name",
51
+ },
48
52
  application: {
49
53
  // if deployed to Google Cloud Run use a gem like cloudtasker instead of a permanently running expensive worker
50
54
  worker: {
@@ -1,11 +1,11 @@
1
1
  import { createYamlLocalPipeline } from "./__utils__/helpers";
2
- import config from "./kubernetes-with-cloud-sql-legacy";
2
+ import config from "./workspace-api-www-turbo-cache";
3
3
 
4
4
  /**
5
5
  * This test is auto-generated.
6
6
  * Modifications will be overwritten on every `yarn test` run!
7
7
  */
8
8
 
9
- it("matches snapshot for kubernetes-with-cloud-sql-legacy local pipeline YAML", async () => {
9
+ it("matches snapshot for workspace-api-www-turbo-cache local pipeline YAML", async () => {
10
10
  expect(await createYamlLocalPipeline(config)).toMatchSnapshot();
11
11
  });
@@ -12,7 +12,7 @@ const config: Config = {
12
12
  myWorkspace: {
13
13
  type: "node",
14
14
  cache: {
15
- paths: [".my-cache"],
15
+ paths: [".turbo"],
16
16
  },
17
17
  },
18
18
  },
@@ -33,6 +33,9 @@ const config: Config = {
33
33
  dir: "www",
34
34
  build: {
35
35
  from: "myWorkspace",
36
+ cache: {
37
+ paths: [".next/cache"],
38
+ },
36
39
  },
37
40
  deploy: DEPLOY_CONFIG,
38
41
  vars: {
@@ -27,6 +27,9 @@ const config: Config = {
27
27
  dir: "www",
28
28
  build: {
29
29
  from: "myWorkspace",
30
+ cache: {
31
+ paths: [".next/cache"],
32
+ },
30
33
  },
31
34
  deploy: DEPLOY_CONFIG,
32
35
  vars: {
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  }
54
54
  ],
55
55
  "license": "MIT",
56
- "version": "0.0.0-next-e2e4f00a",
56
+ "version": "0.0.0-next-de346530",
57
57
  "stableVersion": "0.1.0",
58
58
  "scripts": {
59
59
  "build:tsc": "yarn tsc",
@@ -40,7 +40,6 @@ export const createAppBuildJob = (
40
40
  ? {
41
41
  ...context.environment.envVars,
42
42
  ...context.environment.jobOnlyVars.build.envVars,
43
- ...(context.build.config.extraVars ?? {}),
44
43
  }
45
44
  : {}),
46
45
  },
@@ -31,7 +31,6 @@ export const createCustomTestJobs = (
31
31
  variables: {
32
32
  APP_PATH: context.build.dir,
33
33
  ...context.environment.jobOnlyVars.build.envVars,
34
- ...(buildConfig.extraVars ?? {}),
35
34
  },
36
35
  runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
37
36
  services: buildConfig.jobServices,
@@ -13,7 +13,7 @@ import { createBuildJobDefinition } from "../base/createBuildJobDefinition";
13
13
  import type { DockerBuildJobDefinition } from "../docker";
14
14
  import { getDockerBuildScriptWithBuiltInDockerFile } from "../docker";
15
15
  import type { BuildConfigDocker } from "../types";
16
- import { getNextCache, getNodeCache, getYarnCache } from "./cache";
16
+ import { getNodeCache, getYarnCache } from "./cache";
17
17
  import { getDockerAppCopyAndBuildScript, getYarnInstall } from "./yarn";
18
18
 
19
19
  export const createNodeBuildJobs = (
@@ -41,7 +41,7 @@ export const createNodeBuildJobDefinition = (
41
41
  const yarnInstall = getYarnInstall(context);
42
42
  return createBuildJobDefinition(context, buildConfig, {
43
43
  prescript: yarnInstall,
44
- cache: [...getNodeCache(context), ...getNextCache(context)],
44
+ cache: getNodeCache(context),
45
45
  });
46
46
  };
47
47
 
@@ -63,34 +63,5 @@ export const getNodeCache = (
63
63
  return [
64
64
  ...getYarnCache(context, policy),
65
65
  ...getNodeModulesCache(context, policy),
66
- ...(context.type === "workspace" ? getWorkspaceDefaultCaches(context) : []),
67
- ];
68
- };
69
-
70
- export const getNextCache = (context: Context): CacheConfig[] => {
71
- const paths = context.build
72
- .getComponentDirs("direct")
73
- .map((c) => join(c, ".next/cache"));
74
-
75
- return [
76
- {
77
- pathMode: "absolute",
78
- key: "next-cache",
79
- policy: "pull-push",
80
- paths,
81
- },
82
- ];
83
- };
84
-
85
- export const getWorkspaceDefaultCaches = (
86
- context: WorkspaceContext,
87
- ): CacheConfig[] => {
88
- return [
89
- {
90
- // turbo repo
91
- key: "turbo",
92
- policy: "pull-push",
93
- paths: [".turbo"],
94
- },
95
66
  ];
96
67
  };
@@ -35,7 +35,6 @@ export const createNodeTestJobs = (
35
35
  ...(context.type === "component"
36
36
  ? {
37
37
  ...context.environment.jobOnlyVars.build.envVars,
38
- ...(context.build.config.extraVars ?? {}),
39
38
  }
40
39
  : {}),
41
40
  },
@@ -47,7 +47,6 @@ export const createRailsBuildJobs = (
47
47
  dockerBuild: {
48
48
  variables: {
49
49
  ...context.environment.jobOnlyVars.build.envVars,
50
- ...context.build.config.extraVars,
51
50
  },
52
51
  // custom script
53
52
  script: [
@@ -24,7 +24,6 @@ export const createRailsTestJobs = (
24
24
  const base: Omit<CatladderJob, "script" | "name"> = {
25
25
  variables: {
26
26
  ...context.environment.jobOnlyVars.build.envVars,
27
- ...(buildConfig.extraVars ?? {}),
28
27
  },
29
28
  stage: "test",
30
29
  needs: [],
@@ -82,12 +82,6 @@ export type BuildConfigBase = {
82
82
  * Can curently not reference other variables from other components
83
83
  */
84
84
  jobVars?: EnvVars;
85
- /**
86
- * additional env vars for the buid jobs
87
- *
88
- * @deprecated use jobVars or runnerVariables
89
- */
90
- extraVars?: Record<string, string>;
91
85
 
92
86
  /**
93
87
  * additional vars only for the runner.
@@ -232,13 +226,6 @@ export type BuildConfigDocker =
232
226
  | BuildConfigDockerBuiltIn
233
227
  | BuildConfigDockerCustom;
234
228
 
235
- /**
236
- * @deprecated this type is no longer used. Use {@link BuildConfigDocker} instead.
237
- */
238
- export type BuildConfigCustomDocker =
239
- | BuildConfigDockerCustom
240
- | BuildConfigDockerBuiltInNgninx;
241
-
242
229
  export type BuildConfigCustom = Omit<
243
230
  BuildConfigBase,
244
231
  "lint" | "test" | "audit"
@@ -1,8 +1,5 @@
1
1
  import type { BashExpression } from "../../bash/BashExpression";
2
- import {
3
- resolveReferences,
4
- translateLegacyFromComponents,
5
- } from "../resolveReferences";
2
+ import { resolveReferences } from "../resolveReferences";
6
3
 
7
4
  const unpackBashExpressions = (obj: Record<string, string | BashExpression>) =>
8
5
  Object.fromEntries(
@@ -123,26 +120,3 @@ describe("resolveReferences", () => {
123
120
  });
124
121
  });
125
122
  });
126
-
127
- describe("translateLegacyFromComponents", () => {
128
- it("translatetes the old `fromComponents` approach to ${componentName:variableName}", () => {
129
- const fromComponents = {
130
- api: {
131
- API_FOO: "FOO",
132
- API_BAR: "BAR",
133
- },
134
- www: {
135
- WWW_X: "X",
136
- WWW_Y: "Y",
137
- },
138
- };
139
-
140
- const result = translateLegacyFromComponents(fromComponents);
141
- expect(result).toEqual({
142
- API_FOO: "${api:FOO}",
143
- API_BAR: "${api:BAR}",
144
- WWW_X: "${www:X}",
145
- WWW_Y: "${www:Y}",
146
- });
147
- });
148
- });
@@ -108,7 +108,6 @@ export const createComponentContext = async (
108
108
  const context: Omit<ComponentContext, "customJobs"> = {
109
109
  type: "component",
110
110
  name: ctx.componentName,
111
- componentName: ctx.componentName,
112
111
  env: ctx.env,
113
112
  fullConfig: ctx.config,
114
113
  componentConfig,
@@ -20,7 +20,7 @@ export const getEnvironment = async (
20
20
  slugPrefix: envContext.environmentSlugPrefix,
21
21
  reviewSlug: envContext.reviewSlug,
22
22
  slug: envContext.environmentSlug,
23
- shortName: env,
23
+
24
24
  ...variables,
25
25
  };
26
26
  };
@@ -1,4 +1,3 @@
1
- import { merge } from "lodash";
2
1
  import { DEPLOY_TYPES } from "../deploy";
3
2
  import type {
4
3
  ComponentContext,
@@ -13,10 +12,7 @@ import { isStandaloneBuildConfig } from "../build/types";
13
12
  import type { EnvironmentContext } from "../types/environmentContext";
14
13
  import { getBuildInfoVariables } from "./getBuildInfoVariables";
15
14
  import { getEnvironmentContext } from "./getEnvironmentContext";
16
- import {
17
- resolveReferences,
18
- translateLegacyFromComponents,
19
- } from "./resolveReferences";
15
+ import { resolveReferences } from "./resolveReferences";
20
16
  import { transformJobOnlyVars } from "./transformJobOnlyVars";
21
17
  import {
22
18
  makeSecretEnvVarMapping,
@@ -43,12 +39,9 @@ type BasePredefinedVariables = ReturnType<typeof getBasePredefinedVariables>;
43
39
 
44
40
  // we export so that we have later nice autocomplete
45
41
  export type PredefinedVariables = BasePredefinedVariables & {
46
- /**
47
- * undefined in rails, Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
48
- */
49
- HOST?: StringOrBashExpression;
42
+ HOSTNAME?: StringOrBashExpression;
50
43
  ROOT_URL: StringOrBashExpression;
51
- HOST_INTERNAL: StringOrBashExpression;
44
+ HOSTNAME_INTERNAL: StringOrBashExpression;
52
45
  ROOT_URL_INTERNAL: StringOrBashExpression;
53
46
  };
54
47
 
@@ -78,12 +71,8 @@ export const getEnvironmentVariables = async (
78
71
  ...basePredefinedVariables,
79
72
  ENV_SHORT: "local",
80
73
  ROOT_URL: url,
81
- // Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
82
- ...(isStandaloneBuildConfig(buildConfigRaw) &&
83
- buildConfigRaw.type === "rails"
84
- ? {}
85
- : { HOST: host }),
86
- HOST_INTERNAL: host,
74
+ HOSTNAME: host,
75
+ HOSTNAME_INTERNAL: host,
87
76
  ROOT_URL_INTERNAL: "http://" + host,
88
77
  PORT: port.toString(),
89
78
  };
@@ -94,10 +83,10 @@ export const getEnvironmentVariables = async (
94
83
  )
95
84
  : {};
96
85
 
97
- const HOST_INTERNAL =
98
- additionalEnvVars.HOST_INTERNAL ?? "unknown-host.example.com";
86
+ const HOSTNAME_INTERNAL =
87
+ additionalEnvVars.HOSTNAME_INTERNAL ?? "unknown-host.example.com";
99
88
 
100
- host = envConfigRaw?.host ?? HOST_INTERNAL;
89
+ host = envConfigRaw?.host ?? HOSTNAME_INTERNAL;
101
90
  url = joinBashExpressions(["https://", host]);
102
91
 
103
92
  predefinedVariables = {
@@ -106,12 +95,11 @@ export const getEnvironmentVariables = async (
106
95
  ...(isStandaloneBuildConfig(buildConfigRaw) &&
107
96
  buildConfigRaw.type === "rails"
108
97
  ? {}
109
- : { HOST: host }),
98
+ : { HOSTNAME: host }),
110
99
  ROOT_URL: url,
111
- HOST_INTERNAL,
112
- /**@deprecated */
113
- HOST_CANONICAL: HOST_INTERNAL, // legacy alias for HOST_INTERNAL
114
- ROOT_URL_INTERNAL: joinBashExpressions(["https://", HOST_INTERNAL]),
100
+ HOSTNAME_INTERNAL,
101
+
102
+ ROOT_URL_INTERNAL: joinBashExpressions(["https://", HOSTNAME_INTERNAL]),
115
103
  ...additionalEnvVars,
116
104
  };
117
105
  }
@@ -132,17 +120,8 @@ export const getEnvironmentVariables = async (
132
120
  componentName,
133
121
  secretEnvVarKeys,
134
122
  );
135
- // this is deprecated, we now support: $componentname:FOO
136
- const legacyFromComponents = envConfigRaw.vars?.fromComponents ?? {};
137
- const publicEnvVarsRawWithLegacyFromComponents = merge(
138
- {},
139
- translateLegacyFromComponents(legacyFromComponents),
140
- publicEnvVarsRaw,
141
- );
142
123
 
143
- const publicEnvVarsRawSanitized = stringifyValues(
144
- publicEnvVarsRawWithLegacyFromComponents,
145
- );
124
+ const publicEnvVarsRawSanitized = stringifyValues(publicEnvVarsRaw);
146
125
 
147
126
  const envVarsRaw = addIndexVar({
148
127
  ...predefinedVariables,
@@ -78,16 +78,3 @@ export const resolveReferences = async (
78
78
  ),
79
79
  ) as Record<string, BashExpression>;
80
80
  };
81
-
82
- export const translateLegacyFromComponents = (
83
- fromComponents: Record<string, Record<string, string>>,
84
- ) => {
85
- return Object.fromEntries(
86
- Object.entries(fromComponents).flatMap(([componentName, variables]) => {
87
- return Object.entries(variables).map(([ourName, otherName]) => [
88
- ourName,
89
- "${" + componentName + ":" + otherName + "}",
90
- ]);
91
- }),
92
- );
93
- };
@@ -117,7 +117,7 @@ export const createDeployJob = (
117
117
  ...context.environment.envVars,
118
118
  ...(hasDocker ? getDockerImageVariables(context) : {}),
119
119
  ...context.environment.jobOnlyVars.deploy.envVars,
120
- ...(deployConfig ? deployConfig.extraVars ?? {} : {}),
120
+
121
121
  ...jobDefinition.variables,
122
122
  },
123
123
  runnerVariables: {
@@ -85,7 +85,7 @@ export const GCLOUD_RUN_DEPLOY_TYPE: DeployTypeDefinition<DeployConfigCloudRun>
85
85
  getAdditionalEnvVars: (ctx) => {
86
86
  const { fullName, env, componentName, deployConfigRaw } = ctx;
87
87
 
88
- const HOST_INTERNAL = joinBashExpressions(
88
+ const HOSTNAME_INTERNAL = joinBashExpressions(
89
89
  [
90
90
  fullName,
91
91
  getBashVariable(
@@ -113,7 +113,7 @@ export const GCLOUD_RUN_DEPLOY_TYPE: DeployTypeDefinition<DeployConfigCloudRun>
113
113
  : {};
114
114
 
115
115
  return {
116
- HOST_INTERNAL,
116
+ HOSTNAME_INTERNAL,
117
117
  ...getCloudSqlVariables(ctx),
118
118
  ...jobTriggers,
119
119
  DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw
@@ -41,21 +41,7 @@ export const createKubernetesCloudsqlBaseValues = (
41
41
  context,
42
42
  "cloudsqlProxyCredentials",
43
43
  )}`;
44
- if (config?.type !== "unmanaged") {
45
- const instanceConnectionName = `${config.projectId ?? "skynet-164509"}:${
46
- config.region ?? "europe-west6"
47
- }:${config.instanceId ?? context.environment.envVars.KUBE_NAMESPACE}`;
48
-
49
- return {
50
- cloudsql: {
51
- enabled: config.enabled,
52
- dbUser: "postgres",
53
- instanceConnectionName,
54
- proxyCredentials,
55
- fullDbName: context.environment.envVars.KUBE_APP_NAME ?? "",
56
- },
57
- };
58
- } else if (config.type === "unmanaged") {
44
+ if (config.type === "unmanaged") {
59
45
  return {
60
46
  cloudsql: {
61
47
  enabled: config.enabled,
@@ -47,8 +47,6 @@ export const createKubernetesDeployJobs = (
47
47
  ...(deployConfig.additionalHelmArgs ?? []),
48
48
  ].join(" "),
49
49
  COMPONENT_NAME: context.name,
50
- /** @deprecated */
51
- BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID,
52
50
  },
53
51
  };
54
52
 
@@ -29,7 +29,7 @@ export const KUBERNETES_DEPLOY_TYPE: DeployTypeDefinition<DeployConfigKubernetes
29
29
  fullConfig.domainCanonical ||
30
30
  "panter.cloud";
31
31
 
32
- const HOST_INTERNAL = joinBashExpressions(
32
+ const HOSTNAME_INTERNAL = joinBashExpressions(
33
33
  [
34
34
  componentSlug,
35
35
  ...(envType === "review" && reviewSlug ? [reviewSlug] : []),
@@ -44,7 +44,7 @@ export const KUBERNETES_DEPLOY_TYPE: DeployTypeDefinition<DeployConfigKubernetes
44
44
  KUBE_NAMESPACE,
45
45
  KUBE_APP_NAME,
46
46
  KUBE_APP_NAME_PREFIX,
47
- HOST_INTERNAL,
47
+ HOSTNAME_INTERNAL,
48
48
  };
49
49
  },
50
50
  };
@@ -11,7 +11,6 @@ import {
11
11
 
12
12
  import { createKubeEnv } from "./kubeEnv";
13
13
  import { createMongodbBaseConfig } from "./mongodb";
14
- import { processSecretsAsFiles } from "./processSecretsAsFiles";
15
14
 
16
15
  const createAppConfig = (
17
16
  context: ComponentContext,
@@ -87,14 +86,12 @@ export const createKubeValues = (context: ComponentContext) => {
87
86
  : {},
88
87
  );
89
88
 
90
- const kubeValues = processSecretsAsFiles(
91
- mergeWithMergingArrays(defaultKubeValues, {
92
- jobs: removeFalsy(jobs),
93
- cronjobs: removeFalsy(cronjobs),
89
+ const kubeValues = mergeWithMergingArrays(defaultKubeValues, {
90
+ jobs: removeFalsy(jobs),
91
+ cronjobs: removeFalsy(cronjobs),
94
92
 
95
- ...rest,
96
- }),
97
- );
93
+ ...rest,
94
+ });
98
95
 
99
96
  return kubeValues;
100
97
  };
@@ -25,12 +25,6 @@ export type DeployConfigBase = {
25
25
  */
26
26
  jobVars?: EnvVars;
27
27
 
28
- /**
29
- * additional env vars for the deploy job
30
- *
31
- * @deprecated use deploy.jobVars for deploy job specific variables
32
- */
33
- extraVars?: Record<string, string>;
34
28
  /**
35
29
  * additional vars only for the runner.
36
30
  * Also if you use services: that require env vars, you need to set them here.
@@ -164,33 +164,6 @@ export type DeployConfigMongodbReplicaset = {
164
164
  export type DeployConfigMongodb = DeployConfigMongodbBase &
165
165
  (DeployConfigMongodbStandalone | DeployConfigMongodbReplicaset);
166
166
 
167
- /**
168
- * @deprecated use config with instanceConnectionName
169
- */
170
- type DeployConfigKubernetesValuesCloudSQLLegacy = {
171
- enabled: boolean;
172
- /**
173
- * @deprecated use config with instanceConnectionName
174
- */
175
- instanceId?: string;
176
- /**
177
- * @deprecated use config with instanceConnectionName
178
- */
179
- projectId?: string;
180
- /**
181
- * @deprecated use config with instanceConnectionName
182
- */
183
- region?: string;
184
- /**
185
- * @deprecated use type "unmanaged".
186
- *
187
- * Be aware that "unmanaged" is not fully backward compatible with "legacy".
188
- *
189
- *
190
- */
191
- type?: "legacy";
192
- };
193
-
194
167
  export type DeployConfigKubernetesValuesCloudSQLUnmanaged = {
195
168
  enabled: boolean;
196
169
  instanceConnectionName: string;
@@ -220,8 +193,7 @@ export type DeployConfigKubernetesValuesCloudSQLUnmanaged = {
220
193
  dbBaseName?: string;
221
194
  };
222
195
  export type DeployConfigKubernetesValuesCloudSQL =
223
- | DeployConfigKubernetesValuesCloudSQLLegacy
224
- | DeployConfigKubernetesValuesCloudSQLUnmanaged;
196
+ DeployConfigKubernetesValuesCloudSQLUnmanaged;
225
197
  export type DeployConfigKubernetesValues = AllowUnknownProps<{
226
198
  /**
227
199
  * enable cloudsql db. Currently you have to manually set it up
@@ -358,13 +330,6 @@ export type DeployConfigKubernetesValues = AllowUnknownProps<{
358
330
  mapServiceUrlToEnv?: {
359
331
  [envVar: string]: string;
360
332
  };
361
- /**
362
- * Mount secrets as files in the filesystem.
363
- * These secrets are still available as env vars, but will contain the path of the file instead
364
- *
365
- * @deprecated this will be removed in the future, because its very niche and not used
366
- */
367
- secretsAsFile?: string[];
368
333
  }>;
369
334
 
370
335
  export type DeployConfigKubernetes = {
@@ -106,7 +106,6 @@ export const makeGitlabJob = (
106
106
  environment,
107
107
  envMode,
108
108
  needsStages,
109
- needsOtherComponent,
110
109
  name,
111
110
  needs,
112
111
  jobTags,
@@ -310,7 +309,7 @@ function deduplicateNeeds(needs: GitlabJobDef["needs"]): GitlabJobDef["needs"] {
310
309
 
311
310
  function getGitlabNeedsForComponentJob(
312
311
  context: ComponentContext,
313
- { needsStages, needs, needsOtherComponent }: CatladderJob<string>,
312
+ { needsStages, needs }: CatladderJob<string>,
314
313
  allJobs: AllCatladderJobs,
315
314
  ): GitlabJobDef["needs"] {
316
315
  const needsFromStages = needsStages?.flatMap<CatladderJobNeed>((n) => {
@@ -353,8 +352,6 @@ function getGitlabNeedsForComponentJob(
353
352
  const cleanedNeeds: CatladderJob["needs"] = [
354
353
  ...(needsFromStages ?? []),
355
354
  ...(needs ?? []),
356
- // pull in legacy needs from other component, which is now identical to needs
357
- ...(needsOtherComponent ?? []),
358
355
  ];
359
356
 
360
357
  return cleanedNeeds
@@ -73,14 +73,6 @@ export type EnvVars = {
73
73
  * secret env vars. These vars can be managed with catladder/cli
74
74
  */
75
75
  secret?: string[];
76
- /**
77
- * @deprecated, use ${componentName:variableName} instead
78
- *
79
- * With fromComponents you can inject env vars from other components.
80
- */
81
- fromComponents?: {
82
- [otherApp: string]: Record<string, string>;
83
- };
84
76
  };
85
77
 
86
78
  export type DefaultEnvConfig = {