@catladder/pipeline 0.0.0-perf-cli-reduce-bundle-size-with-tsconfig-optimization-c14723ff → 0.0.0-perf-cli-reduce-bundle-size-with-tsconfig-optimization-3556aaa4

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 (76) hide show
  1. package/README.md +15 -1
  2. package/dist/bundles/catladder-gitlab/index.js +45 -24
  3. package/dist/constants.js +1 -1
  4. package/dist/pipeline/generatePipelineFiles.d.ts +38 -0
  5. package/dist/pipeline/generatePipelineFiles.js +44 -23
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +1341 -0
  8. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +1325 -0
  9. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +1341 -0
  10. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +1393 -0
  11. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +1341 -0
  12. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +1352 -0
  13. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +1341 -0
  14. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +1341 -0
  15. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +1385 -0
  16. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +1225 -0
  17. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +1341 -0
  18. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +2825 -0
  19. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +2572 -0
  20. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +1349 -0
  21. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +1196 -0
  22. package/examples/__snapshots__/custom-build-job.test.ts.snap +1085 -0
  23. package/examples/__snapshots__/custom-deploy.test.ts.snap +1103 -0
  24. package/examples/__snapshots__/custom-envs.test.ts.snap +709 -0
  25. package/examples/__snapshots__/custom-sbom-java.test.ts.snap +1093 -0
  26. package/examples/__snapshots__/git-submodule.test.ts.snap +1342 -0
  27. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +1778 -0
  28. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.test.ts.snap +1790 -0
  29. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +1798 -0
  30. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +3352 -0
  31. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +1902 -0
  32. package/examples/__snapshots__/local-dot-env.test.ts.snap +1341 -0
  33. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +1839 -0
  34. package/examples/__snapshots__/multiline-var.test.ts.snap +3376 -0
  35. package/examples/__snapshots__/native-app.test.ts.snap +2149 -0
  36. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +1341 -0
  37. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +1349 -0
  38. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +1470 -0
  39. package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +1275 -0
  40. package/examples/__utils__/helpers.ts +14 -1
  41. package/examples/cloud-run-memory-limit.test.ts +9 -1
  42. package/examples/cloud-run-meteor-with-worker.test.ts +9 -1
  43. package/examples/cloud-run-no-cpu-throttling.test.ts +9 -1
  44. package/examples/cloud-run-no-service.test.ts +9 -1
  45. package/examples/cloud-run-non-public.test.ts +9 -1
  46. package/examples/cloud-run-post-stop-job.test.ts +9 -1
  47. package/examples/cloud-run-service-gen2.test.ts +9 -1
  48. package/examples/cloud-run-service-increase-timout.test.ts +9 -1
  49. package/examples/cloud-run-service-with-volumes.test.ts +9 -1
  50. package/examples/cloud-run-storybook.test.ts +9 -1
  51. package/examples/cloud-run-with-ngnix.test.ts +9 -1
  52. package/examples/cloud-run-with-sql-reuse-db.test.ts +9 -1
  53. package/examples/cloud-run-with-sql.test.ts +9 -1
  54. package/examples/cloud-run-with-worker.test.ts +9 -1
  55. package/examples/custom-build-job-with-tests.test.ts +9 -1
  56. package/examples/custom-build-job.test.ts +9 -1
  57. package/examples/custom-deploy.test.ts +9 -1
  58. package/examples/custom-envs.test.ts +9 -1
  59. package/examples/custom-sbom-java.test.ts +9 -1
  60. package/examples/git-submodule.test.ts +9 -1
  61. package/examples/kubernetes-application-customization.test.ts +9 -1
  62. package/examples/kubernetes-with-cloud-sql-legacy.test.ts +9 -1
  63. package/examples/kubernetes-with-cloud-sql.test.ts +9 -1
  64. package/examples/kubernetes-with-jobs.test.ts +9 -1
  65. package/examples/kubernetes-with-mongodb.test.ts +9 -1
  66. package/examples/local-dot-env.test.ts +9 -1
  67. package/examples/meteor-kubernetes.test.ts +9 -1
  68. package/examples/multiline-var.test.ts +9 -1
  69. package/examples/native-app.test.ts +9 -1
  70. package/examples/node-build-with-custom-image.test.ts +9 -1
  71. package/examples/node-build-with-docker-additions.test.ts +9 -1
  72. package/examples/rails-k8s-with-worker.test.ts +9 -1
  73. package/examples/wait-for-other-deploy.test.ts +9 -1
  74. package/package.json +4 -3
  75. package/scripts/generate-examples-test.ts +7 -5
  76. package/src/pipeline/generatePipelineFiles.ts +61 -36
package/README.md CHANGED
@@ -1,3 +1,17 @@
1
1
  ## @catladder/pipeline 🐱 🔧
2
2
 
3
- See [@catladder/cli](https://www.npmjs.com/package/@catladder/cli).
3
+ Panter workflow for cloud CI/CD and DevOps.
4
+
5
+ **It just works™**
6
+
7
+ ## Getting started
8
+
9
+ [See the documentation][docs-getting-started].
10
+
11
+ [docs-getting-started]: https://catladder.git.panter.biz/catladder/docs/getting_started "Getting started"
12
+
13
+ ## Contribution
14
+
15
+ [See contribution guide][docs-contribute].
16
+
17
+ [docs-contribute]: https://catladder.git.panter.biz/catladder/docs/contribute "Contribution guide"
@@ -25523,7 +25523,7 @@ Object.defineProperty(exports, "__esModule", ({
25523
25523
  value: true
25524
25524
  }));
25525
25525
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
25526
- exports.PIPELINE_IMAGE_TAG = "perf-cli-reduce-bundle-size-with-tsconfig-optimization-c14723ff" || 0;
25526
+ exports.PIPELINE_IMAGE_TAG = "perf-cli-reduce-bundle-size-with-tsconfig-optimization-3556aaa4" || 0;
25527
25527
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
25528
25528
 
25529
25529
  /***/ }),
@@ -31133,64 +31133,85 @@ var __read = this && this.__read || function (o, n) {
31133
31133
  Object.defineProperty(exports, "__esModule", ({
31134
31134
  value: true
31135
31135
  }));
31136
- exports.generatePipelineFiles = void 0;
31136
+ exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
31137
31137
  var writeFiles_1 = __nccwpck_require__(3946);
31138
31138
  var createChildPipeline_1 = __nccwpck_require__(4244);
31139
31139
  var createMainPipeline_1 = __nccwpck_require__(7373);
31140
31140
  var getPipelineTriggerForGitlabChildPipeline_1 = __nccwpck_require__(8587);
31141
31141
  var sortGitLabJobDefProps_1 = __nccwpck_require__(7560);
31142
- function generatePipelineFiles(config, pipelineType, mode) {
31142
+ function generateChildPipelineContent(config, pipelineType) {
31143
31143
  return __awaiter(this, void 0, void 0, function () {
31144
- var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps, _b, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
31145
- return __generator(this, function (_c) {
31146
- switch (_c.label) {
31144
+ var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
31145
+ return __generator(this, function (_b) {
31146
+ switch (_b.label) {
31147
31147
  case 0:
31148
- if (!(mode === "childpipeline")) return [3 /*break*/, 3];
31149
31148
  trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
31150
31149
  return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
31151
31150
  case 1:
31152
- _a = _c.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
31151
+ _a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
31153
31152
  jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
31154
31153
  var _b = __read(_a, 2),
31155
31154
  jobName = _b[0],
31156
31155
  job = _b[1];
31157
31156
  return [jobName, (0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job)];
31158
31157
  }));
31159
- return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({
31158
+ return [2 /*return*/, __assign(__assign({
31160
31159
  image: image,
31161
31160
  stages: stages,
31162
31161
  variables: variables,
31163
31162
  workflow: workflow
31164
- }, pipelineRest), jobsWithSortedProps))];
31165
- case 2:
31166
- _c.sent();
31167
- return [3 /*break*/, 6];
31168
- case 3:
31163
+ }, pipelineRest), jobsWithSortedProps)];
31164
+ }
31165
+ });
31166
+ });
31167
+ }
31168
+ exports.generateChildPipelineContent = generateChildPipelineContent;
31169
+ function generateLocalPipelineContent(config, pipelineType) {
31170
+ return __awaiter(this, void 0, void 0, function () {
31171
+ var _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
31172
+ return __generator(this, function (_b) {
31173
+ switch (_b.label) {
31174
+ case 0:
31169
31175
  return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
31170
- case 4:
31171
- _b = _c.sent(), jobs = _b.jobs, image = _b.image, stages = _b.stages, variables = _b.variables, workflow = _b.workflow, pipelineRest = __rest(_b, ["jobs", "image", "stages", "variables", "workflow"]);
31176
+ case 1:
31177
+ _a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
31172
31178
  jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
31173
31179
  var _b = __read(_a, 2),
31174
31180
  jobName = _b[0],
31175
31181
  job = _b[1];
31176
31182
  return [jobName, (0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job)];
31177
31183
  }));
31178
- return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({
31184
+ return [2 /*return*/, __assign(__assign({
31179
31185
  image: image,
31180
31186
  stages: stages,
31181
31187
  variables: variables,
31182
31188
  workflow: workflow
31183
- }, pipelineRest), jobsWithSortedProps))];
31184
- case 5:
31185
- _c.sent();
31186
- _c.label = 6;
31187
- case 6:
31188
- return [2 /*return*/];
31189
+ }, pipelineRest), jobsWithSortedProps)];
31190
+ }
31191
+ });
31192
+ });
31193
+ }
31194
+ exports.generateLocalPipelineContent = generateLocalPipelineContent;
31195
+ function generatePipelineFiles(config, pipelineType, mode) {
31196
+ return __awaiter(this, void 0, void 0, function () {
31197
+ var pipelineContent_1, pipelineContent;
31198
+ return __generator(this, function (_a) {
31199
+ switch (_a.label) {
31200
+ case 0:
31201
+ if (!(mode === "childpipeline")) return [3 /*break*/, 2];
31202
+ return [4 /*yield*/, generateChildPipelineContent(config, pipelineType)];
31203
+ case 1:
31204
+ pipelineContent_1 = _a.sent();
31205
+ return [2 /*return*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", pipelineContent_1)];
31206
+ case 2:
31207
+ return [4 /*yield*/, generateLocalPipelineContent(config, pipelineType)];
31208
+ case 3:
31209
+ pipelineContent = _a.sent();
31210
+ return [2 /*return*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", pipelineContent)];
31189
31211
  }
31190
31212
  });
31191
31213
  });
31192
31214
  }
31193
-
31194
31215
  exports.generatePipelineFiles = generatePipelineFiles;
31195
31216
 
31196
31217
  /***/ }),
package/dist/constants.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
7
- exports.PIPELINE_IMAGE_TAG = "perf-cli-reduce-bundle-size-with-tsconfig-optimization-c14723ff" || "latest";
7
+ exports.PIPELINE_IMAGE_TAG = "perf-cli-reduce-bundle-size-with-tsconfig-optimization-3556aaa4" || "latest";
8
8
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
@@ -1,2 +1,40 @@
1
1
  import type { Config, PipelineMode, PipelineType } from "../types";
2
+ export declare function generateChildPipelineContent<T extends PipelineType>(config: Config, pipelineType: T): Promise<{
3
+ image: string;
4
+ stages: string[];
5
+ variables: import("../types/gitlab-ci-yml").JobVariables1 | undefined;
6
+ workflow: {
7
+ rules: {
8
+ if?: string | undefined;
9
+ changes?: import("../types/gitlab-ci-yml").Changes | undefined;
10
+ exists?: import("../types/gitlab-ci-yml").Exists | undefined;
11
+ variables?: import("../types/gitlab-ci-yml").RulesVariables | undefined;
12
+ when?: import("../types/gitlab-ci-yml").When | undefined;
13
+ start_in?: string | undefined;
14
+ allow_failure?: import("../types/gitlab-ci-yml").AllowFailure | undefined;
15
+ needs?: import("../types/gitlab-ci-yml").RulesNeeds | undefined;
16
+ }[];
17
+ } | undefined;
18
+ } & Omit<import("../types").Pipeline<T>, "image" | "jobs" | "variables" | "workflow" | "stages"> & {
19
+ [k: string]: import("../types").GitlabJobDef;
20
+ }>;
21
+ export declare function generateLocalPipelineContent<T extends PipelineType>(config: Config, pipelineType: T): Promise<{
22
+ image: string;
23
+ stages: string[];
24
+ variables: import("../types/gitlab-ci-yml").JobVariables1 | undefined;
25
+ workflow: {
26
+ rules: {
27
+ if?: string | undefined;
28
+ changes?: import("../types/gitlab-ci-yml").Changes | undefined;
29
+ exists?: import("../types/gitlab-ci-yml").Exists | undefined;
30
+ variables?: import("../types/gitlab-ci-yml").RulesVariables | undefined;
31
+ when?: import("../types/gitlab-ci-yml").When | undefined;
32
+ start_in?: string | undefined;
33
+ allow_failure?: import("../types/gitlab-ci-yml").AllowFailure | undefined;
34
+ needs?: import("../types/gitlab-ci-yml").RulesNeeds | undefined;
35
+ }[];
36
+ } | undefined;
37
+ } & Omit<import("../types").Pipeline<T>, "image" | "jobs" | "variables" | "workflow" | "stages"> & {
38
+ [k: string]: import("../types").GitlabJobDef;
39
+ }>;
2
40
  export declare function generatePipelineFiles<T extends PipelineType>(config: Config, pipelineType: T, mode: PipelineMode<T>): Promise<void>;
@@ -158,62 +158,83 @@ var __read = this && this.__read || function (o, n) {
158
158
  Object.defineProperty(exports, "__esModule", {
159
159
  value: true
160
160
  });
161
- exports.generatePipelineFiles = void 0;
161
+ exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
162
162
  var writeFiles_1 = require("../utils/writeFiles");
163
163
  var createChildPipeline_1 = require("./createChildPipeline");
164
164
  var createMainPipeline_1 = require("./createMainPipeline");
165
165
  var getPipelineTriggerForGitlabChildPipeline_1 = require("./gitlab/getPipelineTriggerForGitlabChildPipeline");
166
166
  var sortGitLabJobDefProps_1 = require("./gitlab/sortGitLabJobDefProps");
167
- function generatePipelineFiles(config, pipelineType, mode) {
167
+ function generateChildPipelineContent(config, pipelineType) {
168
168
  return __awaiter(this, void 0, void 0, function () {
169
- var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps, _b, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
170
- return __generator(this, function (_c) {
171
- switch (_c.label) {
169
+ var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
170
+ return __generator(this, function (_b) {
171
+ switch (_b.label) {
172
172
  case 0:
173
- if (!(mode === "childpipeline")) return [3 /*break*/, 3];
174
173
  trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
175
174
  return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
176
175
  case 1:
177
- _a = _c.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
176
+ _a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
178
177
  jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
179
178
  var _b = __read(_a, 2),
180
179
  jobName = _b[0],
181
180
  job = _b[1];
182
181
  return [jobName, (0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job)];
183
182
  }));
184
- return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({
183
+ return [2 /*return*/, __assign(__assign({
185
184
  image: image,
186
185
  stages: stages,
187
186
  variables: variables,
188
187
  workflow: workflow
189
- }, pipelineRest), jobsWithSortedProps))];
190
- case 2:
191
- _c.sent();
192
- return [3 /*break*/, 6];
193
- case 3:
188
+ }, pipelineRest), jobsWithSortedProps)];
189
+ }
190
+ });
191
+ });
192
+ }
193
+ exports.generateChildPipelineContent = generateChildPipelineContent;
194
+ function generateLocalPipelineContent(config, pipelineType) {
195
+ return __awaiter(this, void 0, void 0, function () {
196
+ var _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
197
+ return __generator(this, function (_b) {
198
+ switch (_b.label) {
199
+ case 0:
194
200
  return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
195
- case 4:
196
- _b = _c.sent(), jobs = _b.jobs, image = _b.image, stages = _b.stages, variables = _b.variables, workflow = _b.workflow, pipelineRest = __rest(_b, ["jobs", "image", "stages", "variables", "workflow"]);
201
+ case 1:
202
+ _a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
197
203
  jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
198
204
  var _b = __read(_a, 2),
199
205
  jobName = _b[0],
200
206
  job = _b[1];
201
207
  return [jobName, (0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job)];
202
208
  }));
203
- return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({
209
+ return [2 /*return*/, __assign(__assign({
204
210
  image: image,
205
211
  stages: stages,
206
212
  variables: variables,
207
213
  workflow: workflow
208
- }, pipelineRest), jobsWithSortedProps))];
209
- case 5:
210
- _c.sent();
211
- _c.label = 6;
212
- case 6:
213
- return [2 /*return*/];
214
+ }, pipelineRest), jobsWithSortedProps)];
215
+ }
216
+ });
217
+ });
218
+ }
219
+ exports.generateLocalPipelineContent = generateLocalPipelineContent;
220
+ function generatePipelineFiles(config, pipelineType, mode) {
221
+ return __awaiter(this, void 0, void 0, function () {
222
+ var pipelineContent_1, pipelineContent;
223
+ return __generator(this, function (_a) {
224
+ switch (_a.label) {
225
+ case 0:
226
+ if (!(mode === "childpipeline")) return [3 /*break*/, 2];
227
+ return [4 /*yield*/, generateChildPipelineContent(config, pipelineType)];
228
+ case 1:
229
+ pipelineContent_1 = _a.sent();
230
+ return [2 /*return*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", pipelineContent_1)];
231
+ case 2:
232
+ return [4 /*yield*/, generateLocalPipelineContent(config, pipelineType)];
233
+ case 3:
234
+ pipelineContent = _a.sent();
235
+ return [2 /*return*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", pipelineContent)];
214
236
  }
215
237
  });
216
238
  });
217
239
  }
218
-
219
240
  exports.generatePipelineFiles = generatePipelineFiles;