@catladder/pipeline 0.0.0-refactor-gcloud-api-5bd4bbed → 0.0.0-refactor-needs-aae6e67d

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 (69) hide show
  1. package/dist/build/custom/buildJob.js +1 -0
  2. package/dist/build/index.js +7 -1
  3. package/dist/build/rails/build.js +41 -16
  4. package/dist/build/rails/index.d.ts +2 -2
  5. package/dist/build/types.d.ts +36 -4
  6. package/dist/bundles/catladder-gitlab/index.js +125 -54
  7. package/dist/constants.js +1 -1
  8. package/dist/context/__tests__/resolveReferences.test.js +15 -20
  9. package/dist/context/getEnvironment.js +1 -0
  10. package/dist/context/getEnvironmentContext.js +5 -3
  11. package/dist/context/getEnvironmentVariables.js +2 -2
  12. package/dist/context/resolveReferences.d.ts +1 -1
  13. package/dist/context/resolveReferences.js +3 -1
  14. package/dist/deploy/base.js +1 -1
  15. package/dist/deploy/cloudRun/deployJob.js +9 -7
  16. package/dist/deploy/cloudRun/index.js +7 -6
  17. package/dist/deploy/cloudRun/utils/createArgsString.d.ts +1 -1
  18. package/dist/deploy/cloudRun/utils/createArgsString.js +6 -1
  19. package/dist/deploy/kubernetes/deployJob.js +4 -4
  20. package/dist/deploy/kubernetes/kubeValues.d.ts +3 -0
  21. package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +3 -0
  22. package/dist/deploy/types/custom.d.ts +2 -1
  23. package/dist/deploy/types/googleCloudRun.d.ts +11 -2
  24. package/dist/deploy/types/kubernetes.d.ts +11 -0
  25. package/dist/pipeline/createJobs.js +4 -9
  26. package/dist/pipeline/gitlab/makeGitlabJob.js +33 -2
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/dist/types/context.d.ts +1 -0
  29. package/dist/types/environmentContext.d.ts +7 -0
  30. package/dist/types/gitlab-types.d.ts +25 -1
  31. package/dist/types/jobs.d.ts +9 -2
  32. package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +1572 -0
  33. package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +1572 -0
  34. package/examples/__snapshots__/cloud-run-non-public.ts.snap +48 -48
  35. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +3116 -0
  36. package/examples/__snapshots__/cloud-run-with-sql.ts.snap +108 -108
  37. package/examples/__snapshots__/custom-build-job.ts.snap +48 -48
  38. package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +24 -24
  39. package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +1911 -0
  40. package/examples/cloud-run-memory-limit.ts +28 -0
  41. package/examples/cloud-run-no-cpu-throttling.ts +33 -0
  42. package/examples/cloud-run-with-sql-reuse-db.ts +54 -0
  43. package/examples/cloud-run-with-sql.ts +1 -1
  44. package/examples/rails-k8s-with-worker.ts +95 -0
  45. package/package.json +1 -1
  46. package/src/build/custom/buildJob.ts +1 -0
  47. package/src/build/index.ts +7 -1
  48. package/src/build/rails/build.ts +17 -10
  49. package/src/build/rails/index.ts +2 -2
  50. package/src/build/types.ts +40 -5
  51. package/src/context/__tests__/resolveReferences.test.ts +15 -30
  52. package/src/context/getEnvironment.ts +1 -0
  53. package/src/context/getEnvironmentContext.ts +6 -6
  54. package/src/context/getEnvironmentVariables.ts +7 -5
  55. package/src/context/resolveReferences.ts +3 -6
  56. package/src/deploy/base.ts +1 -1
  57. package/src/deploy/cloudRun/deployJob.ts +9 -11
  58. package/src/deploy/cloudRun/index.ts +5 -4
  59. package/src/deploy/cloudRun/utils/createArgsString.ts +9 -2
  60. package/src/deploy/kubernetes/deployJob.ts +1 -1
  61. package/src/deploy/types/custom.ts +2 -1
  62. package/src/deploy/types/googleCloudRun.ts +14 -2
  63. package/src/deploy/types/kubernetes.ts +12 -0
  64. package/src/pipeline/createJobs.ts +14 -17
  65. package/src/pipeline/gitlab/makeGitlabJob.ts +3 -1
  66. package/src/types/context.ts +1 -0
  67. package/src/types/environmentContext.ts +7 -0
  68. package/src/types/gitlab-types.ts +18 -1
  69. package/src/types/jobs.ts +11 -2
@@ -4,20 +4,22 @@ exports.__esModule = true;
4
4
  exports.getEnvironmentContext = void 0;
5
5
  var getEnvConfig_1 = require("./getEnvConfig");
6
6
  var getEnvType_1 = require("./getEnvType");
7
- var getEnvironmentSlug = function (envConfig, env, componentName, commitInfo) {
7
+ var getEnvironmentSlugPrefix = function (envConfig, env, commitInfo) {
8
8
  var envType = (0, getEnvType_1.getEnvType)(env, envConfig);
9
- return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug, "-").concat(componentName) : "".concat(env, "-").concat(componentName);
9
+ return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug) : "".concat(env);
10
10
  };
11
11
  var getEnvironmentContext = function (config, env, componentName, commitInfo) {
12
12
  var envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
13
13
  var envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw);
14
- var environmentSlug = getEnvironmentSlug(envConfigRaw, env, componentName, commitInfo);
14
+ var environmentSlugPrefix = getEnvironmentSlugPrefix(envConfigRaw, env, commitInfo);
15
+ var environmentSlug = "".concat(environmentSlugPrefix, "-").concat(componentName);
15
16
  var gitlabEnvironmentName = envType === "review" && commitInfo ? "".concat(env, "/").concat(commitInfo.refName, "/").concat(componentName) : "".concat(env, "/").concat(componentName);
16
17
  var fullName = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
17
18
  return {
18
19
  envConfigRaw: envConfigRaw,
19
20
  deployConfigRaw: envConfigRaw.deploy,
20
21
  buildConfigRaw: envConfigRaw.build,
22
+ environmentSlugPrefix: environmentSlugPrefix,
21
23
  environmentSlug: environmentSlug,
22
24
  gitlabEnvironmentName: gitlabEnvironmentName,
23
25
  fullName: fullName,
@@ -215,7 +215,7 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
215
215
  return [key, (0, lodash_1.isObject)(value) ? JSON.stringify(value) : "".concat(value)];
216
216
  }));
217
217
  envVarsRaw = addIndexVar(__assign(__assign(__assign({}, predefinedVariables), secretEnvVars), publicEnvVarsRawSanitized));
218
- return [4 /*yield*/, (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (otherComponentName, variableName, alreadyVisited) {
218
+ return [4 /*yield*/, (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (otherComponentName, alreadyVisited) {
219
219
  return __awaiter(void 0, void 0, void 0, function () {
220
220
  var otherEnvVars;
221
221
  return __generator(this, function (_a) {
@@ -224,7 +224,7 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
224
224
  return [4 /*yield*/, (0, exports.getEnvironmentVariables)(config, otherComponentName, env, commitInfo, alreadyVisited)];
225
225
  case 1:
226
226
  otherEnvVars = _a.sent().envVars;
227
- return [2 /*return*/, otherEnvVars[variableName]];
227
+ return [2 /*return*/, otherEnvVars];
228
228
  }
229
229
  });
230
230
  });
@@ -1,4 +1,4 @@
1
- export declare const resolveReferences: (vars: Record<string, string>, getOtherVariables?: ((componentName: string, variableName: string, alreadyVisited: Record<string, Record<string, boolean>>) => Promise<string | null>) | undefined, alreadyVisitedBase?: Record<string, Record<string, boolean>>) => Promise<Record<string, string>>;
1
+ export declare const resolveReferences: (vars: Record<string, string>, getOtherVariables?: ((componentName: string, alreadyVisited: Record<string, Record<string, boolean>>) => Promise<Record<string, string | null>>) | undefined, alreadyVisitedBase?: Record<string, Record<string, boolean>>) => Promise<Record<string, string>>;
2
2
  export declare const translateLegacyFromComponents: (fromComponents: Record<string, Record<string, string>>) => {
3
3
  [k: string]: string;
4
4
  };
@@ -179,7 +179,9 @@ var resolveReferences = function (vars, getOtherVariables, alreadyVisitedBase) {
179
179
 
180
180
  newAlreadyVisited = (0, lodash_1.merge)({}, alreadyVisited, (_c = {}, _c[componentName] = (_d = {}, _d[variableName] = true, _d), _c));
181
181
  if (!componentName) return [3 /*break*/, 2];
182
- return [4 /*yield*/, getOtherVariables === null || getOtherVariables === void 0 ? void 0 : getOtherVariables(componentName, variableName, newAlreadyVisited)];
182
+ return [4 /*yield*/, getOtherVariables === null || getOtherVariables === void 0 ? void 0 : getOtherVariables(componentName, newAlreadyVisited).then(function (r) {
183
+ return r === null || r === void 0 ? void 0 : r[variableName];
184
+ })];
183
185
  case 1:
184
186
  _a = (_f = _g.sent()) !== null && _f !== void 0 ? _f : null;
185
187
  return [3 /*break*/, 3];
@@ -38,7 +38,7 @@ var getBaseDeploymentJob = function (context) {
38
38
  return {
39
39
  name: exports.DEPLOY_JOB_NAME,
40
40
  envMode: "stagePerEnv",
41
- needsOtherComponent: context.componentConfig.deploy ? (_c = (_b = context.componentConfig.deploy.waitFor) === null || _b === void 0 ? void 0 : _b.map(function (c) {
41
+ needs: context.componentConfig.deploy ? (_c = (_b = context.componentConfig.deploy.waitFor) === null || _b === void 0 ? void 0 : _b.map(function (c) {
42
42
  return {
43
43
  componentName: c,
44
44
  job: exports.DEPLOY_JOB_NAME,
@@ -120,19 +120,21 @@ var createGoogleCloudRunDeployJobs = function (context) {
120
120
  };
121
121
  });
122
122
  var getServiceDeployScript = function (service, nameSuffix) {
123
- var _a, _b;
123
+ var _a, _b, _c, _d;
124
124
  var customConfig = service !== true ? service : undefined;
125
125
  var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
126
126
  var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
127
- command: command ? '"' + command.split(" ").join(",") + '"' : undefined
127
+ // command as empty string resets it to default (uses the image's entrypoint)
128
+ command: command ? '"' + command.split(" ").join(",") + '"' : '""'
128
129
  }, commonDeployArgs), {
129
130
  "env-vars-file": "____envvars.yaml",
130
- "min-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances,
131
- "max-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances,
132
- "no-cpu-throttling": customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling
131
+ "min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
132
+ "max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
133
+ "cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
134
+ memory: customConfig === null || customConfig === void 0 ? void 0 : customConfig.memory,
135
+ "allow-unauthenticated": (_d = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _d !== void 0 ? _d : true
133
136
  }));
134
- var authenticationString = ((_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _b !== void 0 ? _b : true) ? "--allow-unauthenticated" : "--no-allow-unauthenticated";
135
- return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(argsString, " ").concat(authenticationString);
137
+ return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(argsString);
136
138
  };
137
139
  var getJobCreateScriptsForJob = function (jobName, job) {
138
140
  // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
@@ -50,15 +50,15 @@ var jobName_1 = require("./utils/jobName");
50
50
  exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
51
51
  exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
52
52
  var getCloudSqlVariables = function (_a) {
53
- var _b, _c, _d;
53
+ var _b, _c, _d, _e;
54
54
  var deployConfigRaw = _a.deployConfigRaw,
55
- environmentSlug = _a.environmentSlug,
55
+ environmentSlugPrefix = _a.environmentSlugPrefix,
56
56
  env = _a.env,
57
57
  componentName = _a.componentName,
58
58
  fullConfig = _a.fullConfig;
59
59
  if (deployConfigRaw && deployConfigRaw.cloudSql) {
60
- var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlug].filter(Boolean).join("-");
61
- var additionalQueryParamsString = Object.entries((_c = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _c !== void 0 ? _c : {}).map(function (_a) {
60
+ var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlugPrefix, (_c = deployConfigRaw.cloudSql.dbBaseName) !== null && _c !== void 0 ? _c : componentName].filter(Boolean).join("-");
61
+ var additionalQueryParamsString = Object.entries((_d = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
62
62
  var _b = __read(_a, 2),
63
63
  key = _b[0],
64
64
  value = _b[1];
@@ -67,7 +67,7 @@ var getCloudSqlVariables = function (_a) {
67
67
  return {
68
68
  CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
69
69
  DB_NAME: DB_NAME,
70
- DB_USER: (_d = deployConfigRaw.cloudSql.dbUser) !== null && _d !== void 0 ? _d : "postgres",
70
+ DB_USER: (_e = deployConfigRaw.cloudSql.dbUser) !== null && _e !== void 0 ? _e : "postgres",
71
71
  DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
72
72
  DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
73
73
  DATABASE_JDBC_URL: "jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD".concat(additionalQueryParamsString)
@@ -93,11 +93,12 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
93
93
  return __spreadArray([exports.GCLOUD_DEPLOY_CREDENTIALS_KEY], __read(ctx.deployConfigRaw && ctx.deployConfigRaw.cloudSql ? ["DB_PASSWORD"] : []), false);
94
94
  },
95
95
  getAdditionalEnvVars: function (ctx) {
96
+ var _a;
96
97
  var fullName = ctx.fullName,
97
98
  env = ctx.env,
98
99
  componentName = ctx.componentName,
99
100
  deployConfigRaw = ctx.deployConfigRaw;
100
- var HOST_CANONICAL = fullName.toLowerCase() + "-" + process.env[(0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)];
101
+ var HOST_CANONICAL = fullName.toLowerCase() + "-" + ((_a = process.env[(0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)]) !== null && _a !== void 0 ? _a : "unknown-host.example.com");
101
102
  var jobTriggers = deployConfigRaw && deployConfigRaw.jobs ? Object.fromEntries(Object.entries(deployConfigRaw.jobs).map(function (_a) {
102
103
  var _b = __read(_a, 2),
103
104
  name = _b[0],
@@ -8,4 +8,4 @@
8
8
  * @param args args record
9
9
  * @returns
10
10
  */
11
- export declare const createArgsString: (args: Record<string, string | number | true | undefined>) => string;
11
+ export declare const createArgsString: (args: Record<string, string | number | true | false | undefined>) => string;
@@ -44,7 +44,12 @@ var createArgsString = function (args) {
44
44
  var _b = __read(_a, 2),
45
45
  key = _b[0],
46
46
  value = _b[1];
47
- return "--".concat(key).concat(value !== true ? "=".concat(value) : "");
47
+ if (value === true) {
48
+ return "--".concat(key);
49
+ } else if (value === false) {
50
+ return "--no-".concat(key);
51
+ }
52
+ return "--".concat(key, "=").concat(value);
48
53
  }).join(" ");
49
54
  };
50
55
  exports.createArgsString = createArgsString;
@@ -51,7 +51,7 @@ var base_1 = require("../base");
51
51
  var types_1 = require("../types");
52
52
  var kubeValues_1 = require("./kubeValues");
53
53
  var createKubernetesDeployJobs = function (context) {
54
- var _a, _b;
54
+ var _a, _b, _c;
55
55
  var deployConfig = context.componentConfig.deploy;
56
56
  if (deployConfig === false) {
57
57
  return [];
@@ -75,10 +75,10 @@ var createKubernetesDeployJobs = function (context) {
75
75
  quotingType: "'",
76
76
  forceQuotes: true
77
77
  }),
78
- HELM_GITLAB_CHART_NAME: "the-panter-chart",
79
- HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_a = deployConfig.additionalHelmArgs) !== null && _a !== void 0 ? _a : []), false).join(" "),
78
+ HELM_GITLAB_CHART_NAME: (_a = deployConfig.chartName) !== null && _a !== void 0 ? _a : "/helm-charts/the-panter-chart",
79
+ HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_b = deployConfig.additionalHelmArgs) !== null && _b !== void 0 ? _b : []), false).join(" "),
80
80
  COMPONENT_NAME: context.componentName,
81
- BUILD_ID: (_b = context.commitInfo) === null || _b === void 0 ? void 0 : _b.buildId
81
+ BUILD_ID: (_c = context.commitInfo) === null || _c === void 0 ? void 0 : _c.buildId
82
82
  })
83
83
  };
84
84
  var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
@@ -58,6 +58,9 @@ export declare const createKubeValues: (context: Context) => never[] | ({
58
58
  } | undefined;
59
59
  } | undefined;
60
60
  worker?: import("../types").KubernetesWorkerDef | undefined;
61
+ jobDefaults?: {
62
+ resources: import("../types").KubernetesResourcesDef;
63
+ } | undefined;
61
64
  }> | undefined;
62
65
  } & {
63
66
  cloudsql?: {
@@ -76,6 +76,9 @@ export declare const processSecretsAsFiles: <T extends {
76
76
  } | undefined;
77
77
  } | undefined;
78
78
  worker?: import("../types").KubernetesWorkerDef | undefined;
79
+ jobDefaults?: {
80
+ resources: import("../types").KubernetesResourcesDef;
81
+ } | undefined;
79
82
  }> | undefined;
80
83
  secretsFromOtherComponent?: {
81
84
  [envVar: string]: string;
@@ -1,3 +1,4 @@
1
+ import type { GitlabJobImage } from "../../types";
1
2
  import type { CatladderJob } from "../../types/jobs";
2
3
  import type { DeployConfigBase } from "./base";
3
4
  export declare type DeployConfigCustom = {
@@ -24,7 +25,7 @@ export declare type DeployConfigCustom = {
24
25
  /**
25
26
  * image to use
26
27
  */
27
- jobImage?: string;
28
+ jobImage?: GitlabJobImage;
28
29
  /**
29
30
  * customize cache for the job
30
31
  */
@@ -8,11 +8,15 @@ export declare type DeployConfigCloudRunCloudSql = {
8
8
  */
9
9
  dbUser?: string;
10
10
  /**
11
- * the prefix of the database, the full db name is this plus the environment slug
11
+ * the prefix of the database, the full db name is this plus the environment slug prefix plus the componentName
12
12
  *
13
13
  * defaults to customerName-appName
14
14
  */
15
15
  dbNamePrefix?: string | false;
16
+ /**
17
+ * the base name of the db, defaults to the componentName
18
+ */
19
+ dbBaseName?: string;
16
20
  /**
17
21
  * whether to delete the database if the environment is stopped
18
22
  * defaults to true for review envs, to false for every other environment
@@ -28,6 +32,7 @@ export declare type DeployConfigCloudRunCloudSql = {
28
32
  statement_cache_size?: number;
29
33
  };
30
34
  };
35
+ declare type Memory = `${number}${"M" | "G" | "Mi" | "Gi"}`;
31
36
  export declare type DeployConfigCloudRunService = {
32
37
  /**
33
38
  * command / entrypoint, fallsback to buildConfig.startcommand
@@ -43,13 +48,17 @@ export declare type DeployConfigCloudRunService = {
43
48
  */
44
49
  maxInstances?: number;
45
50
  /**
46
- * set to true for workers
51
+ * set to true to allways allocate cpu, e.g. for workers. Careful that this is expensive!
47
52
  */
48
53
  noCpuThrottling?: true;
49
54
  /**
50
55
  * whether to allow public access (defaults to true)
51
56
  */
52
57
  allowUnauthenticated?: boolean;
58
+ /**
59
+ * memory limit. Defaults to 512MB
60
+ */
61
+ memory?: Memory;
53
62
  };
54
63
  export declare type DeployConfigCloudRunJobBase = {
55
64
  /**
@@ -213,6 +213,12 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
213
213
  * It has the same environment variables as the application and an additional IS_WORKER="true" variable
214
214
  */
215
215
  worker?: KubernetesWorkerDef;
216
+ /**
217
+ * kubernetes resources for jobs and cronjobs
218
+ */
219
+ jobDefaults?: {
220
+ resources: KubernetesResourcesDef;
221
+ };
216
222
  }>;
217
223
  /**
218
224
  * load secrets from other components.
@@ -257,5 +263,10 @@ export declare type DeployConfigKubernetes = {
257
263
  * values to configure the app
258
264
  */
259
265
  values?: DeployConfigKubernetesValues;
266
+ /**
267
+ * Custom Helm chart location.
268
+ * Not recommended to use.
269
+ */
270
+ chartName?: string;
260
271
  } & DeployConfigBase;
261
272
  export {};
@@ -221,19 +221,14 @@ var getFullReferencedJobName = function (referencedJobName, componentName, env,
221
221
  var replaceReferences = function (job, componentName, env, allRawJobs) {
222
222
  var _a, _b, _c;
223
223
  var stage = job.envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
224
- var needsFromNeeds = (_a = job.needs) === null || _a === void 0 ? void 0 : _a.map(function (n) {
224
+ var cleanedNeeds = __spreadArray(__spreadArray([], __read((_a = job.needs) !== null && _a !== void 0 ? _a : []), false), __read((_b = job.needsOtherComponent) !== null && _b !== void 0 ? _b : []), false);
225
+ var needs = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
226
+ var _a;
225
227
  return (0, lodash_1.isObject)(n) ? {
226
- job: getFullReferencedJobName(n.job, componentName, env, allRawJobs),
228
+ job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allRawJobs),
227
229
  artifacts: n.artifacts
228
230
  } : getFullReferencedJobName(n, componentName, env, allRawJobs);
229
231
  });
230
- var needsFromOtherComponents = (_b = job.needsOtherComponent) === null || _b === void 0 ? void 0 : _b.map(function (other) {
231
- return {
232
- artifacts: other.artifacts,
233
- job: getFullReferencedJobName(other.job, other.componentName, env, allRawJobs)
234
- };
235
- });
236
- var needs = __spreadArray(__spreadArray([], __read(needsFromNeeds !== null && needsFromNeeds !== void 0 ? needsFromNeeds : []), false), __read(needsFromOtherComponents !== null && needsFromOtherComponents !== void 0 ? needsFromOtherComponents : []), false);
237
232
  return __assign(__assign({}, job), {
238
233
  stage: stage,
239
234
  needs: needs,
@@ -18,6 +18,37 @@ var __rest = this && this.__rest || function (s, e) {
18
18
  }
19
19
  return t;
20
20
  };
21
+ var __read = this && this.__read || function (o, n) {
22
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
23
+ if (!m) return o;
24
+ var i = m.call(o),
25
+ r,
26
+ ar = [],
27
+ e;
28
+ try {
29
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
30
+ } catch (error) {
31
+ e = {
32
+ error: error
33
+ };
34
+ } finally {
35
+ try {
36
+ if (r && !r.done && (m = i["return"])) m.call(i);
37
+ } finally {
38
+ if (e) throw e.error;
39
+ }
40
+ }
41
+ return ar;
42
+ };
43
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
44
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
45
+ if (ar || !(i in from)) {
46
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
47
+ ar[i] = from[i];
48
+ }
49
+ }
50
+ return to.concat(ar || Array.prototype.slice.call(from));
51
+ };
21
52
  exports.__esModule = true;
22
53
  exports.makeGitlabJob = void 0;
23
54
  var lodash_1 = require("lodash");
@@ -34,9 +65,9 @@ var makeGitlabJob = function (_a) {
34
65
  rest = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
35
66
  return __assign(__assign({}, rest), {
36
67
  // sort in a predictable manner for snapshot tests
37
- needs: needs === null || needs === void 0 ? void 0 : needs.sort(function (a, b) {
68
+ needs: needs ? __spreadArray([], __read(needs), false).sort(function (a, b) {
38
69
  return getJobName(a).localeCompare(getJobName(b));
39
- }),
70
+ }) : undefined,
40
71
  retry: defaults_1.BASE_RETRY,
41
72
  interruptible: true
42
73
  });