@catladder/pipeline 0.0.0-main-e7ef37ac โ†’ 0.0.0-main-8f79dd9f

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 (38) hide show
  1. package/dist/build/base/__tests__/createArtifactsConfig.test.d.ts +1 -0
  2. package/dist/build/base/__tests__/createArtifactsConfig.test.js +40 -0
  3. package/dist/build/base/createArtifactsConfig.d.ts +4 -0
  4. package/dist/build/base/createArtifactsConfig.js +63 -0
  5. package/dist/build/custom/__tests__/testJob.test.d.ts +1 -0
  6. package/dist/build/custom/__tests__/testJob.test.js +37 -0
  7. package/dist/build/custom/testJob.d.ts +5 -1
  8. package/dist/build/custom/testJob.js +10 -23
  9. package/dist/build/node/testJob.js +15 -11
  10. package/dist/build/types.d.ts +39 -40
  11. package/dist/bundles/catladder-gitlab/index.js +95 -34
  12. package/dist/constants.js +1 -1
  13. package/dist/tsconfig.tsbuildinfo +1 -1
  14. package/dist/types/gitlab-types.d.ts +13 -22
  15. package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +4 -0
  16. package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +4 -0
  17. package/examples/__snapshots__/cloud-run-non-public.ts.snap +4 -0
  18. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +8 -0
  19. package/examples/__snapshots__/cloud-run-with-sql.ts.snap +8 -0
  20. package/examples/__snapshots__/custom-deploy.ts.snap +4 -0
  21. package/examples/__snapshots__/custom-envs.ts.snap +4 -0
  22. package/examples/__snapshots__/kubernetes-application-customization.ts.snap +4 -0
  23. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +4 -0
  24. package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +4 -0
  25. package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +8 -0
  26. package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +4 -0
  27. package/examples/__snapshots__/native-app.ts.snap +8 -0
  28. package/examples/__snapshots__/node-build-with-custom-image.ts.snap +4 -0
  29. package/examples/__snapshots__/wait-for-other-deploy.ts.snap +8 -0
  30. package/package.json +1 -1
  31. package/src/build/base/__tests__/__snapshots__/createArtifactsConfig.test.ts.snap +49 -0
  32. package/src/build/base/__tests__/createArtifactsConfig.test.ts +41 -0
  33. package/src/build/base/createArtifactsConfig.ts +34 -0
  34. package/src/build/custom/__tests__/testJob.test.ts +32 -0
  35. package/src/build/custom/testJob.ts +8 -21
  36. package/src/build/node/testJob.ts +21 -4
  37. package/src/build/types.ts +45 -46
  38. package/src/types/gitlab-types.ts +12 -12
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var createArtifactsConfig_1 = require("../createArtifactsConfig");
5
+ describe("createArtifactsConfig", function () {
6
+ it("returns undefined if no artifacts or artifactsReports", function () {
7
+ expect((0, createArtifactsConfig_1.createArtifactsConfig)(".")).toBeUndefined();
8
+ });
9
+ it("returns artifacts if no artifactsReports", function () {
10
+ expect((0, createArtifactsConfig_1.createArtifactsConfig)(".", undefined, {
11
+ paths: ["testpath"],
12
+ reports: {
13
+ coverage_report: {
14
+ coverage_format: "cobertura",
15
+ path: "some"
16
+ },
17
+ terraform: "something"
18
+ }
19
+ })).toMatchSnapshot();
20
+ });
21
+ it("returns junit parts of artifactsReports", function () {
22
+ expect((0, createArtifactsConfig_1.createArtifactsConfig)(".", {
23
+ junit: ["report.xml"]
24
+ })).toMatchSnapshot();
25
+ });
26
+ it("merges junit files if both given", function () {
27
+ var _a, _b;
28
+ var result = (0, createArtifactsConfig_1.createArtifactsConfig)(".", {
29
+ junit: ["partial-report.xml"]
30
+ }, {
31
+ paths: ["testpath"],
32
+ reports: {
33
+ junit: "full-report.xml",
34
+ terraform: "something"
35
+ }
36
+ });
37
+ expect(result).toMatchSnapshot();
38
+ expect((_b = (_a = result === null || result === void 0 ? void 0 : result.artifacts) === null || _a === void 0 ? void 0 : _a.reports) === null || _b === void 0 ? void 0 : _b.junit).toHaveLength(2);
39
+ });
40
+ });
@@ -0,0 +1,4 @@
1
+ import type { BuildConfigArtifactsReports } from "../types";
2
+ import type { Artifacts } from "../../types";
3
+ import type { OptionalArtifacts } from "../custom/testJob";
4
+ export declare const createArtifactsConfig: (rootPath: string, artifactsReports?: BuildConfigArtifactsReports | undefined, artifacts?: Artifacts | undefined) => OptionalArtifacts;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ var __assign = this && this.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __read = this && this.__read || function (o, n) {
14
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
15
+ if (!m) return o;
16
+ var i = m.call(o),
17
+ r,
18
+ ar = [],
19
+ e;
20
+ try {
21
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
22
+ } catch (error) {
23
+ e = {
24
+ error: error
25
+ };
26
+ } finally {
27
+ try {
28
+ if (r && !r.done && (m = i["return"])) m.call(i);
29
+ } finally {
30
+ if (e) throw e.error;
31
+ }
32
+ }
33
+ return ar;
34
+ };
35
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
36
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
37
+ if (ar || !(i in from)) {
38
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
39
+ ar[i] = from[i];
40
+ }
41
+ }
42
+ return to.concat(ar || Array.prototype.slice.call(from));
43
+ };
44
+ exports.__esModule = true;
45
+ exports.createArtifactsConfig = void 0;
46
+ var path_1 = require("path");
47
+ var createArtifactsConfig = function (rootPath, artifactsReports, artifacts) {
48
+ var _a, _b, _c, _d;
49
+ return artifactsReports || artifacts ? {
50
+ artifacts: __assign(__assign({
51
+ paths: []
52
+ }, artifacts), {
53
+ reports: __assign(__assign({}, artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports), {
54
+ junit: [artifactsReports === null || artifactsReports === void 0 ? void 0 : artifactsReports.junit, Array.isArray((_a = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _a === void 0 ? void 0 : _a.junit) && ((_b = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _b === void 0 ? void 0 : _b.junit), typeof ((_c = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _c === void 0 ? void 0 : _c.junit) === "string" && [(_d = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _d === void 0 ? void 0 : _d.junit]].filter(Array.isArray).reduce(function (acc, curr) {
55
+ return __spreadArray(__spreadArray([], __read(acc), false), __read(curr.map(function (p) {
56
+ return (0, path_1.join)(rootPath, p);
57
+ })), false);
58
+ }, [])
59
+ })
60
+ })
61
+ } : undefined;
62
+ };
63
+ exports.createArtifactsConfig = createArtifactsConfig;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var testJob_1 = require("../testJob");
5
+ describe("createCustomTestJobs", function () {
6
+ var componentConfig = {
7
+ dir: ".",
8
+ build: {
9
+ type: "custom",
10
+ docker: {
11
+ type: "custom"
12
+ },
13
+ jobImage: ""
14
+ },
15
+ deploy: {}
16
+ };
17
+ var baseContext = {
18
+ componentName: "testComponent",
19
+ environment: {
20
+ jobOnlyVars: {
21
+ build: {}
22
+ }
23
+ },
24
+ componentConfig: componentConfig
25
+ };
26
+ it("throws error when not build type custom", function () {
27
+ componentConfig.build.type = "node";
28
+ expect(function () {
29
+ return (0, testJob_1.createCustomTestJobs)(baseContext);
30
+ }).toThrowError("deploy config is not custom");
31
+ componentConfig.build.type = "custom";
32
+ });
33
+ it("returns empty array if no audit, lint, and test definition", function () {
34
+ var jobs = (0, testJob_1.createCustomTestJobs)(baseContext);
35
+ expect(jobs).toEqual([]);
36
+ });
37
+ });
@@ -1,3 +1,7 @@
1
1
  import type { Context } from "../../types/context";
2
2
  import type { CatladderJob } from "../../types/jobs";
3
- export declare const createCustomTestJobs: (context: Context) => CatladderJob[];
3
+ import type { Artifacts } from "../../types";
4
+ export declare const createCustomTestJobs: (context: Context) => CatladderJob[];
5
+ export declare type OptionalArtifacts = {
6
+ artifacts: Artifacts;
7
+ } | undefined;
@@ -43,9 +43,9 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
43
43
  };
44
44
  exports.__esModule = true;
45
45
  exports.createCustomTestJobs = void 0;
46
- var path_1 = require("path");
47
46
  var utils_1 = require("../../utils");
48
47
  var types_1 = require("../types");
48
+ var createArtifactsConfig_1 = require("../base/createArtifactsConfig");
49
49
  var RUNNER_CUSTOM_TEST_VARIABLES = {
50
50
  KUBERNETES_CPU_REQUEST: "0.5",
51
51
  KUBERNETES_CPU_LIMIT: "2",
@@ -53,7 +53,7 @@ var RUNNER_CUSTOM_TEST_VARIABLES = {
53
53
  KUBERNETES_MEMORY_LIMIT: "4Gi"
54
54
  };
55
55
  var createCustomTestJobs = function (context) {
56
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
57
57
  // don't run tests after release
58
58
  if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
59
59
  return [];
@@ -79,32 +79,19 @@ var createCustomTestJobs = function (context) {
79
79
  cache: undefined,
80
80
  script: __spreadArray([], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : []), false),
81
81
  allow_failure: true
82
- }), createArtifactsConfig(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports)) : null;
82
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports, (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.artifacts)) : null;
83
83
  var lintJob = buildConfig.lint ? __assign(__assign(__assign({
84
84
  name: "๐Ÿ‘ฎ lint"
85
85
  }, base), {
86
- image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage,
87
- script: __spreadArray([], __read((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : []), false)
88
- }), createArtifactsConfig(context.componentConfig.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports)) : null;
86
+ image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : buildConfig.jobImage,
87
+ script: __spreadArray([], __read((_m = (0, utils_1.ensureArray)((_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.command)) !== null && _m !== void 0 ? _m : []), false)
88
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifactsReports, (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.artifacts)) : null;
89
89
  var testJob = buildConfig.test ? __assign(__assign(__assign({
90
90
  name: "๐Ÿงช test"
91
91
  }, base), {
92
- image: (_p = (_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : buildConfig.jobImage,
93
- script: __spreadArray([], __read((_r = (0, utils_1.ensureArray)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : []), false)
94
- }), createArtifactsConfig(context.componentConfig.dir, (_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.artifactsReports)) : null;
92
+ image: (_r = (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.jobImage) !== null && _r !== void 0 ? _r : buildConfig.jobImage,
93
+ script: __spreadArray([], __read((_t = (0, utils_1.ensureArray)((_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.command)) !== null && _t !== void 0 ? _t : []), false)
94
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifactsReports, (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.artifacts)) : null;
95
95
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
96
96
  };
97
- exports.createCustomTestJobs = createCustomTestJobs;
98
- var createArtifactsConfig = function (rootPath, artifactsReports) {
99
- var _a, _b;
100
- return artifactsReports ? {
101
- artifacts: {
102
- paths: [],
103
- reports: {
104
- junit: (_b = (_a = artifactsReports === null || artifactsReports === void 0 ? void 0 : artifactsReports.junit) === null || _a === void 0 ? void 0 : _a.map(function (p) {
105
- return (0, path_1.join)(rootPath, p);
106
- })) !== null && _b !== void 0 ? _b : []
107
- }
108
- }
109
- } : undefined;
110
- };
97
+ exports.createCustomTestJobs = createCustomTestJobs;
@@ -48,13 +48,15 @@ var utils_1 = require("../../utils");
48
48
  var cache_1 = require("./cache");
49
49
  var constants_1 = require("./constants");
50
50
  var yarn_1 = require("./yarn");
51
+ var createArtifactsConfig_1 = require("../base/createArtifactsConfig");
51
52
  var createNodeTestJobs = function (context) {
52
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
53
54
  // don't run tests after release
54
55
  if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
55
56
  return [];
56
57
  }
57
58
  var buildConfig = context.componentConfig.build;
59
+ var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
58
60
  var base = {
59
61
  variables: __assign(__assign(__assign({
60
62
  APP_PATH: context.componentConfig.dir
@@ -64,27 +66,29 @@ var createNodeTestJobs = function (context) {
64
66
  envMode: "none"
65
67
  };
66
68
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
67
- var auditJob = buildConfig.audit !== false ? __assign(__assign({
69
+ var auditJob = buildConfig.audit !== false ? __assign(__assign(__assign({
68
70
  name: "๐Ÿ›ก audit"
69
71
  }, base), {
72
+ image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
70
73
  cache: undefined,
71
- script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_d = (0, utils_1.ensureArray)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : [((_e = context.packageManagerInfo) === null || _e === void 0 ? void 0 : _e.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
74
+ script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [((_g = context.packageManagerInfo) === null || _g === void 0 ? void 0 : _g.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
72
75
  ]), false),
73
76
  allow_failure: true
74
- }) : null;
75
- var lintJob = buildConfig.lint !== false ? __assign(__assign({
77
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.artifactsReports, (_j = buildConfig.audit) === null || _j === void 0 ? void 0 : _j.artifacts)) : null;
78
+ var lintJob = buildConfig.lint !== false ? __assign(__assign(__assign({
76
79
  name: "๐Ÿ‘ฎ lint"
77
80
  }, base), {
81
+ image: (_l = (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.jobImage) !== null && _l !== void 0 ? _l : defaultImage,
78
82
  cache: (0, cache_1.getNodeCache)(context),
79
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_g = (0, utils_1.ensureArray)((_f = buildConfig.lint) === null || _f === void 0 ? void 0 : _f.command)) !== null && _g !== void 0 ? _g : ["yarn lint"]), false)
80
- }) : null;
81
- var testJob = buildConfig.test !== false ? __assign(__assign({
83
+ script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_o = (0, utils_1.ensureArray)((_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.command)) !== null && _o !== void 0 ? _o : ["yarn lint"]), false)
84
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.artifactsReports, (_q = buildConfig.lint) === null || _q === void 0 ? void 0 : _q.artifacts)) : null;
85
+ var testJob = buildConfig.test !== false ? __assign(__assign(__assign({
82
86
  name: "๐Ÿงช test"
83
87
  }, base), {
84
- image: (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
88
+ image: (_s = (_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.jobImage) !== null && _s !== void 0 ? _s : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
85
89
  cache: (0, cache_1.getNodeCache)(context),
86
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_j = (0, utils_1.ensureArray)((_h = buildConfig.test) === null || _h === void 0 ? void 0 : _h.command)) !== null && _j !== void 0 ? _j : ["yarn test"]), false)
87
- }) : null;
90
+ script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_u = (0, utils_1.ensureArray)((_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.command)) !== null && _u !== void 0 ? _u : ["yarn test"]), false)
91
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.artifactsReports, (_w = buildConfig.test) === null || _w === void 0 ? void 0 : _w.artifacts)) : null;
88
92
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
89
93
  };
90
94
  exports.createNodeTestJobs = createNodeTestJobs;
@@ -1,4 +1,4 @@
1
- import type { EnvVars, GitlabJobImage, GitlabJobService } from "../types";
1
+ import type { Artifacts, EnvVars, GitlabJobImage, GitlabJobService } from "../types";
2
2
  import type { CatladderJob } from "../types/jobs";
3
3
  export declare type BuildConfigArtifactsReports = {
4
4
  /**
@@ -9,6 +9,21 @@ export declare type BuildConfigArtifactsReports = {
9
9
  */
10
10
  junit?: string[];
11
11
  };
12
+ export declare type TestJobCustom = {
13
+ command?: string | string[];
14
+ jobImage?: GitlabJobImage;
15
+ /**
16
+ * additional CI/CD artifacts reports,
17
+ * use to display information in merge requests, pipeline views and security dashboards.
18
+ */
19
+ artifactsReports?: BuildConfigArtifactsReports;
20
+ /**
21
+ * GitLab {@link Artifacts} configuration.
22
+ *
23
+ * {@link TestJobCustom.artifacts}.reports.junit is merged with {@link TestJobCustom.artifactsReports} in case both given.
24
+ */
25
+ artifacts?: Artifacts;
26
+ };
12
27
  export declare type BuildConfigBase = {
13
28
  /**
14
29
  * command to run on the image to start the app (e.g. yarn start)
@@ -33,30 +48,35 @@ export declare type BuildConfigBase = {
33
48
  * customize docker build
34
49
  */
35
50
  docker?: {
51
+ /**
52
+ * Custom Dockerfile lines integrated in the generated Dockerfile before the standard build steps.
53
+ *
54
+ * - [runner-images/docker-build/scripts/ensureNodeDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNodeDockerfile)
55
+ * - [runner-images/docker-build/scripts/ensureNginxDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNginxDockerfile)
56
+ * - [runner-images/docker-build/scripts/ensureMeteorDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureMeteorDockerfile)
57
+ */
36
58
  additionsBegin?: string[];
59
+ /**
60
+ * Custom Dockerfile lines integrated in the generated Dockerfile after the standard build steps.
61
+ *
62
+ * - [runner-images/docker-build/scripts/ensureNodeDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNodeDockerfile)
63
+ * - [runner-images/docker-build/scripts/ensureNginxDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNginxDockerfile)
64
+ * - [runner-images/docker-build/scripts/ensureMeteorDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureMeteorDockerfile)
65
+ */
37
66
  additionsEnd?: string[];
38
67
  };
39
68
  /**
40
69
  * customize lint, set false to disable
41
70
  */
42
- lint?: false | {
43
- command?: string | string[];
44
- jobImage?: GitlabJobImage;
45
- };
71
+ lint?: false | TestJobCustom;
46
72
  /**
47
73
  * customize test, set false to disable
48
74
  */
49
- test?: false | {
50
- command?: string | string[];
51
- jobImage?: GitlabJobImage;
52
- };
75
+ test?: false | TestJobCustom;
53
76
  /**
54
77
  * customize audit, set false to disable
55
78
  */
56
- audit?: false | {
57
- command?: string | string[];
58
- jobImage?: GitlabJobImage;
59
- };
79
+ audit?: false | TestJobCustom;
60
80
  /**
61
81
  * additional paths for artifacts,
62
82
  * by default "dist" and ".next" are allways included
@@ -116,44 +136,23 @@ export declare type BuildConfigCustomDocker = BuildConfigBase["docker"] & ({
116
136
  export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" | "audit"> & {
117
137
  type: "custom";
118
138
  jobImage: GitlabJobImage;
139
+ /**
140
+ * {@link GitlabJobService}s used in lint, test, audit, and build jobs.
141
+ */
119
142
  jobServices?: GitlabJobService[];
120
143
  docker: BuildConfigCustomDocker;
121
144
  /**
122
145
  * custom lint, disabled when not set
123
146
  */
124
- lint?: {
125
- command?: string | string[];
126
- jobImage?: GitlabJobImage;
127
- /**
128
- * additional CI/CD artifacts reports,
129
- * use to display information in merge requests, pipeline views and security dashboards.
130
- */
131
- artifactsReports?: BuildConfigArtifactsReports;
132
- };
147
+ lint?: TestJobCustom;
133
148
  /**
134
149
  * custom test, disabled when not set
135
150
  */
136
- test?: {
137
- command?: string | string[];
138
- jobImage?: GitlabJobImage;
139
- /**
140
- * additional CI/CD artifacts reports,
141
- * use to display information in merge requests, pipeline views and security dashboards.
142
- */
143
- artifactsReports?: BuildConfigArtifactsReports;
144
- };
151
+ test?: TestJobCustom;
145
152
  /**
146
153
  * custom audit, disabled when not set
147
154
  */
148
- audit?: {
149
- command?: string | string[];
150
- jobImage?: GitlabJobImage;
151
- /**
152
- * additional CI/CD artifacts reports,
153
- * use to display information in merge requests, pipeline views and security dashboards.
154
- */
155
- artifactsReports?: BuildConfigArtifactsReports;
156
- };
155
+ audit?: TestJobCustom;
157
156
  /**
158
157
  * custom sbom (software bill of materials), set false to disable
159
158
  */
@@ -26893,6 +26893,76 @@ exports.RUNNER_BUILD_RESOURCE_VARIABLES = {
26893
26893
 
26894
26894
  /***/ }),
26895
26895
 
26896
+ /***/ 1446:
26897
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
26898
+
26899
+ "use strict";
26900
+
26901
+
26902
+ var __assign = this && this.__assign || function () {
26903
+ __assign = Object.assign || function (t) {
26904
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26905
+ s = arguments[i];
26906
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
26907
+ }
26908
+ return t;
26909
+ };
26910
+ return __assign.apply(this, arguments);
26911
+ };
26912
+ var __read = this && this.__read || function (o, n) {
26913
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
26914
+ if (!m) return o;
26915
+ var i = m.call(o),
26916
+ r,
26917
+ ar = [],
26918
+ e;
26919
+ try {
26920
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
26921
+ } catch (error) {
26922
+ e = {
26923
+ error: error
26924
+ };
26925
+ } finally {
26926
+ try {
26927
+ if (r && !r.done && (m = i["return"])) m.call(i);
26928
+ } finally {
26929
+ if (e) throw e.error;
26930
+ }
26931
+ }
26932
+ return ar;
26933
+ };
26934
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
26935
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
26936
+ if (ar || !(i in from)) {
26937
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
26938
+ ar[i] = from[i];
26939
+ }
26940
+ }
26941
+ return to.concat(ar || Array.prototype.slice.call(from));
26942
+ };
26943
+ exports.__esModule = true;
26944
+ exports.createArtifactsConfig = void 0;
26945
+ var path_1 = __nccwpck_require__(1017);
26946
+ var createArtifactsConfig = function (rootPath, artifactsReports, artifacts) {
26947
+ var _a, _b, _c, _d;
26948
+ return artifactsReports || artifacts ? {
26949
+ artifacts: __assign(__assign({
26950
+ paths: []
26951
+ }, artifacts), {
26952
+ reports: __assign(__assign({}, artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports), {
26953
+ junit: [artifactsReports === null || artifactsReports === void 0 ? void 0 : artifactsReports.junit, Array.isArray((_a = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _a === void 0 ? void 0 : _a.junit) && ((_b = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _b === void 0 ? void 0 : _b.junit), typeof ((_c = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _c === void 0 ? void 0 : _c.junit) === "string" && [(_d = artifacts === null || artifacts === void 0 ? void 0 : artifacts.reports) === null || _d === void 0 ? void 0 : _d.junit]].filter(Array.isArray).reduce(function (acc, curr) {
26954
+ return __spreadArray(__spreadArray([], __read(acc), false), __read(curr.map(function (p) {
26955
+ return (0, path_1.join)(rootPath, p);
26956
+ })), false);
26957
+ }, [])
26958
+ })
26959
+ })
26960
+ } : undefined;
26961
+ };
26962
+ exports.createArtifactsConfig = createArtifactsConfig;
26963
+
26964
+ /***/ }),
26965
+
26896
26966
  /***/ 7681:
26897
26967
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
26898
26968
 
@@ -27240,9 +27310,9 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
27240
27310
  };
27241
27311
  exports.__esModule = true;
27242
27312
  exports.createCustomTestJobs = void 0;
27243
- var path_1 = __nccwpck_require__(1017);
27244
27313
  var utils_1 = __nccwpck_require__(1815);
27245
27314
  var types_1 = __nccwpck_require__(6575);
27315
+ var createArtifactsConfig_1 = __nccwpck_require__(1446);
27246
27316
  var RUNNER_CUSTOM_TEST_VARIABLES = {
27247
27317
  KUBERNETES_CPU_REQUEST: "0.5",
27248
27318
  KUBERNETES_CPU_LIMIT: "2",
@@ -27250,7 +27320,7 @@ var RUNNER_CUSTOM_TEST_VARIABLES = {
27250
27320
  KUBERNETES_MEMORY_LIMIT: "4Gi"
27251
27321
  };
27252
27322
  var createCustomTestJobs = function (context) {
27253
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
27323
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
27254
27324
  // don't run tests after release
27255
27325
  if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
27256
27326
  return [];
@@ -27276,35 +27346,22 @@ var createCustomTestJobs = function (context) {
27276
27346
  cache: undefined,
27277
27347
  script: __spreadArray([], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : []), false),
27278
27348
  allow_failure: true
27279
- }), createArtifactsConfig(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports)) : null;
27349
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports, (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.artifacts)) : null;
27280
27350
  var lintJob = buildConfig.lint ? __assign(__assign(__assign({
27281
27351
  name: "๐Ÿ‘ฎ lint"
27282
27352
  }, base), {
27283
- image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage,
27284
- script: __spreadArray([], __read((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : []), false)
27285
- }), createArtifactsConfig(context.componentConfig.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports)) : null;
27353
+ image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : buildConfig.jobImage,
27354
+ script: __spreadArray([], __read((_m = (0, utils_1.ensureArray)((_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.command)) !== null && _m !== void 0 ? _m : []), false)
27355
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifactsReports, (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.artifacts)) : null;
27286
27356
  var testJob = buildConfig.test ? __assign(__assign(__assign({
27287
27357
  name: "๐Ÿงช test"
27288
27358
  }, base), {
27289
- image: (_p = (_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : buildConfig.jobImage,
27290
- script: __spreadArray([], __read((_r = (0, utils_1.ensureArray)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : []), false)
27291
- }), createArtifactsConfig(context.componentConfig.dir, (_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.artifactsReports)) : null;
27359
+ image: (_r = (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.jobImage) !== null && _r !== void 0 ? _r : buildConfig.jobImage,
27360
+ script: __spreadArray([], __read((_t = (0, utils_1.ensureArray)((_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.command)) !== null && _t !== void 0 ? _t : []), false)
27361
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifactsReports, (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.artifacts)) : null;
27292
27362
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
27293
27363
  };
27294
27364
  exports.createCustomTestJobs = createCustomTestJobs;
27295
- var createArtifactsConfig = function (rootPath, artifactsReports) {
27296
- var _a, _b;
27297
- return artifactsReports ? {
27298
- artifacts: {
27299
- paths: [],
27300
- reports: {
27301
- junit: (_b = (_a = artifactsReports === null || artifactsReports === void 0 ? void 0 : artifactsReports.junit) === null || _a === void 0 ? void 0 : _a.map(function (p) {
27302
- return (0, path_1.join)(rootPath, p);
27303
- })) !== null && _b !== void 0 ? _b : []
27304
- }
27305
- }
27306
- } : undefined;
27307
- };
27308
27365
 
27309
27366
  /***/ }),
27310
27367
 
@@ -27949,13 +28006,15 @@ var utils_1 = __nccwpck_require__(1815);
27949
28006
  var cache_1 = __nccwpck_require__(3646);
27950
28007
  var constants_1 = __nccwpck_require__(4899);
27951
28008
  var yarn_1 = __nccwpck_require__(312);
28009
+ var createArtifactsConfig_1 = __nccwpck_require__(1446);
27952
28010
  var createNodeTestJobs = function (context) {
27953
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
28011
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
27954
28012
  // don't run tests after release
27955
28013
  if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
27956
28014
  return [];
27957
28015
  }
27958
28016
  var buildConfig = context.componentConfig.build;
28017
+ var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
27959
28018
  var base = {
27960
28019
  variables: __assign(__assign(__assign({
27961
28020
  APP_PATH: context.componentConfig.dir
@@ -27965,27 +28024,29 @@ var createNodeTestJobs = function (context) {
27965
28024
  envMode: "none"
27966
28025
  };
27967
28026
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
27968
- var auditJob = buildConfig.audit !== false ? __assign(__assign({
28027
+ var auditJob = buildConfig.audit !== false ? __assign(__assign(__assign({
27969
28028
  name: "๐Ÿ›ก audit"
27970
28029
  }, base), {
28030
+ image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
27971
28031
  cache: undefined,
27972
- script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_d = (0, utils_1.ensureArray)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : [((_e = context.packageManagerInfo) === null || _e === void 0 ? void 0 : _e.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
28032
+ script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [((_g = context.packageManagerInfo) === null || _g === void 0 ? void 0 : _g.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
27973
28033
  ]), false),
27974
28034
  allow_failure: true
27975
- }) : null;
27976
- var lintJob = buildConfig.lint !== false ? __assign(__assign({
28035
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.artifactsReports, (_j = buildConfig.audit) === null || _j === void 0 ? void 0 : _j.artifacts)) : null;
28036
+ var lintJob = buildConfig.lint !== false ? __assign(__assign(__assign({
27977
28037
  name: "๐Ÿ‘ฎ lint"
27978
28038
  }, base), {
28039
+ image: (_l = (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.jobImage) !== null && _l !== void 0 ? _l : defaultImage,
27979
28040
  cache: (0, cache_1.getNodeCache)(context),
27980
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_g = (0, utils_1.ensureArray)((_f = buildConfig.lint) === null || _f === void 0 ? void 0 : _f.command)) !== null && _g !== void 0 ? _g : ["yarn lint"]), false)
27981
- }) : null;
27982
- var testJob = buildConfig.test !== false ? __assign(__assign({
28041
+ script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_o = (0, utils_1.ensureArray)((_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.command)) !== null && _o !== void 0 ? _o : ["yarn lint"]), false)
28042
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.artifactsReports, (_q = buildConfig.lint) === null || _q === void 0 ? void 0 : _q.artifacts)) : null;
28043
+ var testJob = buildConfig.test !== false ? __assign(__assign(__assign({
27983
28044
  name: "๐Ÿงช test"
27984
28045
  }, base), {
27985
- image: (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
28046
+ image: (_s = (_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.jobImage) !== null && _s !== void 0 ? _s : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
27986
28047
  cache: (0, cache_1.getNodeCache)(context),
27987
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_j = (0, utils_1.ensureArray)((_h = buildConfig.test) === null || _h === void 0 ? void 0 : _h.command)) !== null && _j !== void 0 ? _j : ["yarn test"]), false)
27988
- }) : null;
28048
+ script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_u = (0, utils_1.ensureArray)((_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.command)) !== null && _u !== void 0 ? _u : ["yarn test"]), false)
28049
+ }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.artifactsReports, (_w = buildConfig.test) === null || _w === void 0 ? void 0 : _w.artifacts)) : null;
27989
28050
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
27990
28051
  };
27991
28052
  exports.createNodeTestJobs = createNodeTestJobs;
@@ -28545,7 +28606,7 @@ exports.readConfigSync = readConfigSync;
28545
28606
 
28546
28607
  exports.__esModule = true;
28547
28608
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
28548
- exports.PIPELINE_IMAGE_TAG = "main-e7ef37ac" || 0;
28609
+ exports.PIPELINE_IMAGE_TAG = "main-8f79dd9f" || 0;
28549
28610
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
28550
28611
 
28551
28612
  /***/ }),
package/dist/constants.js CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
5
- exports.PIPELINE_IMAGE_TAG = "main-e7ef37ac" || "";
5
+ exports.PIPELINE_IMAGE_TAG = "main-8f79dd9f" || "";
6
6
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "";