@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.
@@ -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((_a = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _a !== void 0 ? _a : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
65
- script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_b = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _b !== void 0 ? _b : []), false),
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((_d = (_c = buildConfig.artifactsPaths) === null || _c === void 0 ? void 0 : _c.map(function (path) {
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 && _d !== void 0 ? _d : []), false),
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: (_f = (_e = context.packageManagerInfo) === null || _e === void 0 ? void 0 : _e.pathsToCopyInDocker.map(function (dir) {
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 || _f === void 0 ? void 0 : _f.join("\n")
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);
@@ -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((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : ["gem install bundler-audit", "bundle audit check"]), false),
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: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
83
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_k = (0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : ["bundle exec rubocop"]), false)
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: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : defaultImage,
90
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_p = (0, utils_1.ensureArray)((_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.command)) !== null && _p !== void 0 ? _p : ["bundle exec rspec"]), false)
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
  };
@@ -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: string;
118
+ jobImage: GitlabJobImage;
115
119
  jobServices?: GitlabJobService[];
116
120
  docker: BuildConfigCustomDocker;
117
121
  /**