@catladder/pipeline 1.109.2 โ 1.110.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.
- package/dist/build/node/buildJob.js +10 -7
- package/dist/build/rails/test.js +7 -7
- package/dist/build/types.d.ts +5 -1
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/node-build-with-custom-image.ts.snap +1808 -0
- package/examples/node-build-with-custom-image.ts +25 -0
- package/package.json +1 -1
- package/src/build/node/buildJob.ts +3 -0
- package/src/build/rails/test.ts +6 -3
- package/src/build/types.ts +5 -1
|
@@ -52,21 +52,24 @@ var types_1 = require("../types");
|
|
|
52
52
|
var cache_1 = require("./cache");
|
|
53
53
|
var constants_2 = require("./constants");
|
|
54
54
|
var yarn_1 = require("./yarn");
|
|
55
|
+
var runner_1 = require("../../runner");
|
|
55
56
|
var createNodeBuildJobs = function (context) {
|
|
56
|
-
var _a, _b, _c, _d, _e, _f;
|
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
57
58
|
var buildConfig = context.componentConfig.build;
|
|
58
59
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
59
60
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
60
61
|
}
|
|
62
|
+
var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
|
|
61
63
|
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
62
64
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
65
|
+
image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
|
|
63
66
|
variables: __assign({}, constants_2.NODE_RUNNER_BUILD_VARIABLES),
|
|
64
|
-
cache: __spreadArray(__spreadArray(__spreadArray([], __read((
|
|
65
|
-
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((
|
|
67
|
+
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),
|
|
68
|
+
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
|
|
66
69
|
artifacts: {
|
|
67
|
-
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((
|
|
70
|
+
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((_e = (_d = buildConfig.artifactsPaths) === null || _d === void 0 ? void 0 : _d.map(function (path) {
|
|
68
71
|
return (0, path_1.join)(context.componentConfig.dir, path);
|
|
69
|
-
})) !== null &&
|
|
72
|
+
})) !== null && _e !== void 0 ? _e : []), false),
|
|
70
73
|
expire_in: "1 day"
|
|
71
74
|
},
|
|
72
75
|
jobTags: buildConfig.jobTags
|
|
@@ -77,9 +80,9 @@ var createNodeBuildJobs = function (context) {
|
|
|
77
80
|
variables: {
|
|
78
81
|
// only required for non static
|
|
79
82
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
80
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
83
|
+
DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
|
|
81
84
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
82
|
-
})) === null ||
|
|
85
|
+
})) === null || _g === void 0 ? void 0 : _g.join("\n")
|
|
83
86
|
},
|
|
84
87
|
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
85
88
|
})] : []), false);
|
package/dist/build/rails/test.js
CHANGED
|
@@ -45,7 +45,7 @@ exports.__esModule = true;
|
|
|
45
45
|
exports.createRailsTestJobs = void 0;
|
|
46
46
|
var utils_1 = require("../../utils");
|
|
47
47
|
var createRailsTestJobs = function (context) {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
49
49
|
// don't run tests after release
|
|
50
50
|
if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
|
|
51
51
|
return [];
|
|
@@ -71,23 +71,23 @@ var createRailsTestJobs = function (context) {
|
|
|
71
71
|
name: "๐ก audit"
|
|
72
72
|
}, base), {
|
|
73
73
|
cache: undefined,
|
|
74
|
-
image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
|
|
75
|
-
script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((
|
|
74
|
+
image: (_e = (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : buildConfig.jobImage) !== null && _e !== void 0 ? _e : defaultImage,
|
|
75
|
+
script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_g = (0, utils_1.ensureArray)((_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.command)) !== null && _g !== void 0 ? _g : ["gem install bundler-audit", "bundle audit check"]), false),
|
|
76
76
|
allow_failure: true
|
|
77
77
|
}) : null;
|
|
78
78
|
var lintJob = buildConfig.lint !== false ? __assign(__assign({
|
|
79
79
|
name: "๐ฎ lint"
|
|
80
80
|
}, base), {
|
|
81
81
|
cache: bundlerCache,
|
|
82
|
-
image: (
|
|
83
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((
|
|
82
|
+
image: (_k = (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage) !== null && _k !== void 0 ? _k : defaultImage,
|
|
83
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_m = (0, utils_1.ensureArray)((_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.command)) !== null && _m !== void 0 ? _m : ["bundle exec rubocop"]), false)
|
|
84
84
|
}) : null;
|
|
85
85
|
var testJob = buildConfig.test !== false ? __assign(__assign({
|
|
86
86
|
name: "๐งช test"
|
|
87
87
|
}, base), {
|
|
88
88
|
cache: bundlerCache,
|
|
89
|
-
image: (
|
|
90
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((
|
|
89
|
+
image: (_q = (_p = (_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : buildConfig.jobImage) !== null && _q !== void 0 ? _q : defaultImage,
|
|
90
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_s = (0, utils_1.ensureArray)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["bundle exec rspec"]), false)
|
|
91
91
|
}) : null;
|
|
92
92
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
93
93
|
};
|
package/dist/build/types.d.ts
CHANGED
|
@@ -75,6 +75,10 @@ export declare type BuildConfigBase = {
|
|
|
75
75
|
* tags for the underlying job runner (e.g gitlab)
|
|
76
76
|
*/
|
|
77
77
|
jobTags?: string[];
|
|
78
|
+
/**
|
|
79
|
+
* custom image to use
|
|
80
|
+
*/
|
|
81
|
+
jobImage?: GitlabJobImage;
|
|
78
82
|
};
|
|
79
83
|
export declare type BuildConfigNodeBase = BuildConfigBase & {
|
|
80
84
|
/**
|
|
@@ -111,7 +115,7 @@ export declare type BuildConfigCustomDocker = BuildConfigBase["docker"] & ({
|
|
|
111
115
|
});
|
|
112
116
|
export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" | "audit"> & {
|
|
113
117
|
type: "custom";
|
|
114
|
-
jobImage:
|
|
118
|
+
jobImage: GitlabJobImage;
|
|
115
119
|
jobServices?: GitlabJobService[];
|
|
116
120
|
docker: BuildConfigCustomDocker;
|
|
117
121
|
/**
|