@catladder/pipeline 1.99.1 โ†’ 1.100.0

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.
@@ -43,6 +43,7 @@ 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");
46
47
  var utils_1 = require("../../utils");
47
48
  var types_1 = require("../types");
48
49
  var RUNNER_CUSTOM_TEST_VARIABLES = {
@@ -52,7 +53,7 @@ var RUNNER_CUSTOM_TEST_VARIABLES = {
52
53
  KUBERNETES_MEMORY_LIMIT: "4Gi"
53
54
  };
54
55
  var createCustomTestJobs = function (context) {
55
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
56
57
  // don't run tests after release
57
58
  if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
58
59
  return [];
@@ -71,26 +72,39 @@ var createCustomTestJobs = function (context) {
71
72
  needs: [],
72
73
  envMode: "none"
73
74
  };
74
- var auditJob = buildConfig.audit ? __assign(__assign({
75
+ var auditJob = buildConfig.audit ? __assign(__assign(__assign({
75
76
  name: "๐Ÿ›ก audit"
76
77
  }, base), {
77
78
  image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : buildConfig.jobImage,
78
79
  cache: undefined,
79
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),
80
81
  allow_failure: true
81
- }) : null;
82
- var lintJob = buildConfig.lint ? __assign(__assign({
82
+ }), createArtifactsConfig(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports)) : null;
83
+ var lintJob = buildConfig.lint ? __assign(__assign(__assign({
83
84
  name: "๐Ÿ‘ฎ lint"
84
85
  }, base), {
85
- image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage,
86
- script: __spreadArray([], __read((_k = (0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : []), false)
87
- }) : null;
88
- var testJob = buildConfig.test ? __assign(__assign({
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;
89
+ var testJob = buildConfig.test ? __assign(__assign(__assign({
89
90
  name: "๐Ÿงช test"
90
91
  }, base), {
91
- image: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : buildConfig.jobImage,
92
- script: __spreadArray([], __read((_p = (0, utils_1.ensureArray)((_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.command)) !== null && _p !== void 0 ? _p : []), false)
93
- }) : null;
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;
94
95
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
95
96
  };
96
- exports.createCustomTestJobs = createCustomTestJobs;
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
+ };
@@ -1,5 +1,14 @@
1
1
  import type { GitlabJobImage, GitlabJobService } from "../types";
2
2
  import type { CatladderJob } from "../types/jobs";
3
+ export declare type BuildConfigArtifactsReports = {
4
+ /**
5
+ * The junit report collects JUnit report format XML files.
6
+ * The collected Unit test reports upload to GitLab as an artifact.
7
+ * Paths are prefixed with component's root folder.
8
+ * eg. `["dist/test-results/TEST-*.xml", "dist/rspec.xml", ...]`
9
+ */
10
+ junit?: string[];
11
+ };
3
12
  export declare type BuildConfigBase = {
4
13
  /**
5
14
  * command to run on the image to start the app (e.g. yarn start)
@@ -50,15 +59,7 @@ export declare type BuildConfigBase = {
50
59
  * additional CI/CD artifacts reports,
51
60
  * use to display information in merge requests, pipeline views and security dashboards.
52
61
  */
53
- artifactsReports?: {
54
- /**
55
- * The junit report collects JUnit report format XML files.
56
- * The collected Unit test reports upload to GitLab as an artifact.
57
- * Paths are prefixed with component's root folder.
58
- * eg. `["dist/test-results/TEST-*.xml", "dist/rspec.xml", ...]`
59
- */
60
- junit?: string[];
61
- };
62
+ artifactsReports?: BuildConfigArtifactsReports;
62
63
  };
63
64
  export declare type BuildConfigNodeBase = BuildConfigBase;
64
65
  export declare type BuildConfigNode = {
@@ -102,6 +103,11 @@ export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" |
102
103
  lint?: {
103
104
  command?: string | string[];
104
105
  jobImage?: GitlabJobImage;
106
+ /**
107
+ * additional CI/CD artifacts reports,
108
+ * use to display information in merge requests, pipeline views and security dashboards.
109
+ */
110
+ artifactsReports?: BuildConfigArtifactsReports;
105
111
  };
106
112
  /**
107
113
  * custom test, disabled when not set
@@ -109,6 +115,11 @@ export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" |
109
115
  test?: {
110
116
  command?: string | string[];
111
117
  jobImage?: GitlabJobImage;
118
+ /**
119
+ * additional CI/CD artifacts reports,
120
+ * use to display information in merge requests, pipeline views and security dashboards.
121
+ */
122
+ artifactsReports?: BuildConfigArtifactsReports;
112
123
  };
113
124
  /**
114
125
  * custom audit, disabled when not set
@@ -116,6 +127,11 @@ export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" |
116
127
  audit?: {
117
128
  command?: string | string[];
118
129
  jobImage?: GitlabJobImage;
130
+ /**
131
+ * additional CI/CD artifacts reports,
132
+ * use to display information in merge requests, pipeline views and security dashboards.
133
+ */
134
+ artifactsReports?: BuildConfigArtifactsReports;
119
135
  };
120
136
  /**
121
137
  * custom sbom (software bill of materials), set false to disable