@catladder/pipeline 1.150.1 โ 1.150.2
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.
- package/dist/build/base/createAppBuildJob.js +1 -1
- package/dist/build/node/buildJob.js +6 -6
- package/dist/build/node/cache.d.ts +4 -4
- package/dist/build/node/cache.js +5 -5
- package/dist/build/node/meteor.js +2 -2
- package/dist/build/node/testJob.js +6 -6
- package/dist/build/node/yarn.d.ts +4 -4
- package/dist/build/node/yarn.js +1 -1
- package/dist/build/sbom.js +1 -1
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/createComponentContext.js +0 -1
- package/dist/deploy/custom/deployJob.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +0 -7
- package/package.json +1 -1
- package/src/build/base/createAppBuildJob.ts +1 -1
- package/src/build/node/buildJob.ts +7 -9
- package/src/build/node/cache.ts +9 -9
- package/src/build/node/meteor.ts +2 -2
- package/src/build/node/testJob.ts +6 -6
- package/src/build/node/yarn.ts +8 -6
- package/src/build/sbom.ts +1 -1
- package/src/context/createComponentContext.ts +0 -1
- package/src/deploy/custom/deployJob.ts +1 -1
- package/src/types/context.ts +2 -7
|
@@ -76,7 +76,7 @@ var createAppBuildJob = function (context, _a) {
|
|
|
76
76
|
cache: [],
|
|
77
77
|
variables: __assign(__assign(__assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.build.config.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
78
78
|
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (_c = context.build.config.runnerVariables) !== null && _c !== void 0 ? _c : {}),
|
|
79
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(context) ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context
|
|
79
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(context) ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : []), false),
|
|
80
80
|
artifacts: {
|
|
81
81
|
paths: [(0, path_1.join)(context.build.dir, "__build_info.json")],
|
|
82
82
|
reports: {
|
|
@@ -51,15 +51,15 @@ var createNodeBuildJobs = function (context) {
|
|
|
51
51
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
52
52
|
}
|
|
53
53
|
var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
|
|
54
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context
|
|
54
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
55
55
|
return (0, base_1.createBuildJobs)(context, {
|
|
56
56
|
appBuild: buildConfig.buildCommand !== null ? {
|
|
57
57
|
image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
|
|
58
58
|
runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
|
|
59
|
-
cache: __spreadArray(__spreadArray(__spreadArray([], __read((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []), false), __read((0, cache_1.getNodeCache)(context
|
|
59
|
+
cache: __spreadArray(__spreadArray(__spreadArray([], __read((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
60
60
|
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
|
|
61
61
|
artifacts: {
|
|
62
|
-
paths: __spreadArray([context.build.dir], __read((_d = context.
|
|
62
|
+
paths: __spreadArray([context.build.dir], __read((_d = context.packageManagerInfo.currentWorkspaceDependencies) !== null && _d !== void 0 ? _d : []), false).flatMap(function (dir) {
|
|
63
63
|
var _a, _b;
|
|
64
64
|
return __spreadArray([(0, path_1.join)(dir, "__build_info.json"), (0, path_1.join)(dir, "dist"), (0, path_1.join)(dir, ".next")], __read((_b = (_a = buildConfig.artifactsPaths) === null || _a === void 0 ? void 0 : _a.map(function (path) {
|
|
65
65
|
return (0, path_1.join)(dir, path);
|
|
@@ -72,11 +72,11 @@ var createNodeBuildJobs = function (context) {
|
|
|
72
72
|
} : undefined,
|
|
73
73
|
dockerBuild: {
|
|
74
74
|
script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "nginx" : "node"),
|
|
75
|
-
cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context
|
|
75
|
+
cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
|
|
76
76
|
variables: {
|
|
77
77
|
// only required for non static
|
|
78
|
-
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context
|
|
79
|
-
DOCKER_COPY_WORKSPACE_FILES: (_e = context.
|
|
78
|
+
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
79
|
+
DOCKER_COPY_WORKSPACE_FILES: (_e = context.packageManagerInfo.pathsToCopyInDocker.map(function (dir) {
|
|
80
80
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
81
81
|
})) === null || _e === void 0 ? void 0 : _e.join("\n")
|
|
82
82
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext, Context } from "../../types/context";
|
|
2
2
|
import type { GitlabJobCache } from "../../types/gitlab-types";
|
|
3
|
-
export declare const getYarnCache: (context:
|
|
4
|
-
export declare const getNodeModulesCache: (context:
|
|
5
|
-
export declare const getNodeCache: (context:
|
|
3
|
+
export declare const getYarnCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
4
|
+
export declare const getNodeModulesCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
5
|
+
export declare const getNodeCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
6
6
|
export declare const getNextCache: (context: ComponentContext) => GitlabJobCache[];
|
package/dist/build/node/cache.js
CHANGED
|
@@ -40,9 +40,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
40
40
|
value: true
|
|
41
41
|
});
|
|
42
42
|
exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
43
|
+
var lodash_1 = require("lodash");
|
|
43
44
|
var path_1 = require("path");
|
|
44
45
|
var slugify_1 = __importDefault(require("slugify"));
|
|
45
|
-
var lodash_1 = require("lodash");
|
|
46
46
|
var getYarnCache = function (context, policy) {
|
|
47
47
|
if (policy === void 0) {
|
|
48
48
|
policy = "pull-push";
|
|
@@ -53,9 +53,9 @@ var getYarnCache = function (context, policy) {
|
|
|
53
53
|
policy: policy,
|
|
54
54
|
paths: [".yarn"]
|
|
55
55
|
} : {
|
|
56
|
-
key: (0, slugify_1.default)(context.dir) + "-yarn",
|
|
56
|
+
key: (0, slugify_1.default)(context.build.dir) + "-yarn",
|
|
57
57
|
policy: policy,
|
|
58
|
-
paths: [(0, path_1.join)(context.dir, ".yarn")]
|
|
58
|
+
paths: [(0, path_1.join)(context.build.dir, ".yarn")]
|
|
59
59
|
}];
|
|
60
60
|
};
|
|
61
61
|
exports.getYarnCache = getYarnCache;
|
|
@@ -69,12 +69,12 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
69
69
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
70
70
|
return [{
|
|
71
71
|
// if component is in a shared workspace, use workspace cache. use individual cache else
|
|
72
|
-
key: componentIsInWorkspace ? "node-modules-workspace" : (0, slugify_1.default)(context.dir) + "-node-modules",
|
|
72
|
+
key: componentIsInWorkspace ? "node-modules-workspace" : (0, slugify_1.default)(context.build.dir) + "-node-modules",
|
|
73
73
|
// we use the dirname, not the component name, because in certain cases we have two apps in the same directory and want to share the cache, e.g. when having storybook in the same package.json
|
|
74
74
|
policy: policy,
|
|
75
75
|
paths: __spreadArray([], __read(componentIsInWorkspace ? (0, lodash_1.uniq)(__spreadArray(["node_modules"], __read((_a = context.packageManagerInfo.workspaces.map(function (w) {
|
|
76
76
|
return (0, path_1.join)(w.location, "node_modules");
|
|
77
|
-
})) !== null && _a !== void 0 ? _a : []), false)) : [(0, path_1.join)(context.dir, "node_modules")]), false)
|
|
77
|
+
})) !== null && _a !== void 0 ? _a : []), false)) : [(0, path_1.join)(context.build.dir, "node_modules")]), false)
|
|
78
78
|
}];
|
|
79
79
|
};
|
|
80
80
|
exports.getNodeModulesCache = getNodeModulesCache;
|
|
@@ -54,10 +54,10 @@ var createMeteorBuildJobs = function (context) {
|
|
|
54
54
|
if (!(0, types_1.isOfBuildType)(buildConfig, "meteor")) {
|
|
55
55
|
throw new Error("deploy config is not meteor");
|
|
56
56
|
}
|
|
57
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context
|
|
57
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
58
58
|
return (0, base_1.createBuildJobs)(context, {
|
|
59
59
|
appBuild: buildConfig.buildCommand !== null ? {
|
|
60
|
-
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context
|
|
60
|
+
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
|
|
61
61
|
image: (0, runner_1.getRunnerImage)("jobs-meteor"),
|
|
62
62
|
variables: {
|
|
63
63
|
METEOR_DISABLE_OPTIMISTIC_CACHING: "1" // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
|
|
@@ -69,13 +69,13 @@ var createNodeTestJobs = function (context) {
|
|
|
69
69
|
needs: [],
|
|
70
70
|
envMode: "none"
|
|
71
71
|
};
|
|
72
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context
|
|
72
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
73
73
|
var auditJob = buildConfig.audit !== false ? __assign(__assign(__assign({
|
|
74
74
|
name: "๐ก audit"
|
|
75
75
|
}, base), {
|
|
76
76
|
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
|
|
77
77
|
cache: undefined,
|
|
78
|
-
script: __spreadArray(["cd ".concat(context.build.dir)], __read((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [context.
|
|
78
|
+
script: __spreadArray(["cd ".concat(context.build.dir)], __read((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [context.packageManagerInfo.isClassic ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
|
|
79
79
|
]), false),
|
|
80
80
|
allow_failure: true
|
|
81
81
|
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts)) : null;
|
|
@@ -83,15 +83,15 @@ var createNodeTestJobs = function (context) {
|
|
|
83
83
|
name: "๐ฎ lint"
|
|
84
84
|
}, base), {
|
|
85
85
|
image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
86
|
-
cache: (0, cache_1.getNodeCache)(context
|
|
87
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context
|
|
86
|
+
cache: (0, cache_1.getNodeCache)(context),
|
|
87
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"]), false)
|
|
88
88
|
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts)) : null;
|
|
89
89
|
var testJob = buildConfig.test !== false ? __assign(__assign(__assign({
|
|
90
90
|
name: "๐งช test"
|
|
91
91
|
}, base), {
|
|
92
92
|
image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
93
|
-
cache: (0, cache_1.getNodeCache)(context
|
|
94
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context
|
|
93
|
+
cache: (0, cache_1.getNodeCache)(context),
|
|
94
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((_s = (0, utils_1.ensureArray)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"]), false)
|
|
95
95
|
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts)) : null;
|
|
96
96
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
97
97
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BashExpression } from "../../bash/BashExpression";
|
|
2
|
-
import type {
|
|
3
|
-
export declare const ensureNodeVersion: (context:
|
|
4
|
-
export declare const getYarnInstall: (context:
|
|
2
|
+
import type { Context } from "../../types";
|
|
3
|
+
export declare const ensureNodeVersion: (context: Context) => string[];
|
|
4
|
+
export declare const getYarnInstall: (context: Context, options?: {
|
|
5
5
|
noCustomPostInstall: boolean;
|
|
6
6
|
}) => string[];
|
|
7
|
-
export declare const getDockerAppCopyAndBuildScript: (context:
|
|
7
|
+
export declare const getDockerAppCopyAndBuildScript: (context: Context) => BashExpression;
|
package/dist/build/node/yarn.js
CHANGED
|
@@ -53,7 +53,7 @@ var ensureNodeVersion = function (context) {
|
|
|
53
53
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
54
54
|
var getYarnInstall = function (context, options) {
|
|
55
55
|
var _a;
|
|
56
|
-
var postInstall = "postInstall" in context.config ? context.config.postInstall : null;
|
|
56
|
+
var postInstall = "postInstall" in context.build.config ? context.build.config.postInstall : null;
|
|
57
57
|
return __spreadArray(__spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), __read((0, gitlab_1.collapseableSection)("yarninstall", "Yarn install")([getYarnInstallCommand(context)])), false), __read(postInstall && !(options === null || options === void 0 ? void 0 : options.noCustomPostInstall) ? (0, gitlab_1.collapseableSection)("postinstall", "Custom post install")((_a = (0, utils_1.ensureArray)(postInstall)) !== null && _a !== void 0 ? _a : []) : []), false);
|
|
58
58
|
};
|
|
59
59
|
exports.getYarnInstall = getYarnInstall;
|
package/dist/build/sbom.js
CHANGED
|
@@ -11,7 +11,7 @@ var createSbomBuildJob = function (context) {
|
|
|
11
11
|
var _a, _b, _c, _d;
|
|
12
12
|
var buildConfig = context.build.config;
|
|
13
13
|
var defaultImage = "aquasec/trivy:0.38.3";
|
|
14
|
-
var defaultScript = ["trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(context.
|
|
14
|
+
var defaultScript = ["trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(context.packageManagerInfo.componentIsInWorkspace ? "." : context.build.dir)];
|
|
15
15
|
var image = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_b = (_a = buildConfig.sbom) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage : defaultImage;
|
|
16
16
|
var script = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_d = (0, utils_1.ensureArray)((_c = buildConfig.sbom) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : defaultScript : defaultScript;
|
|
17
17
|
return {
|