@catladder/pipeline 0.0.0-main-e52d6632 โ†’ 0.0.0-main-344735ad

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.
@@ -24,6 +24,8 @@ var custom_1 = require("./custom");
24
24
 
25
25
  var node_1 = require("./node");
26
26
 
27
+ var rails_1 = require("./rails");
28
+
27
29
  __exportStar(require("./types"), exports);
28
30
 
29
31
  __exportStar(require("./node"), exports);
@@ -67,5 +69,11 @@ exports.BUILD_TYPES = {
67
69
  defaults: function () {
68
70
  return {};
69
71
  }
72
+ },
73
+ rails: {
74
+ jobs: rails_1.createRailsJobs,
75
+ defaults: function () {
76
+ return {};
77
+ }
70
78
  }
71
79
  };
@@ -0,0 +1,3 @@
1
+ import type { Context } from "../..";
2
+ import type { CatladderJob } from "../../types/jobs";
3
+ export declare const createRailsBuildJobs: (context: Context) => CatladderJob[];
@@ -0,0 +1,37 @@
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
+
8
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ };
16
+
17
+ exports.__esModule = true;
18
+ exports.createRailsBuildJobs = void 0;
19
+
20
+ var docker_1 = require("../docker");
21
+
22
+ var createRailsBuildJobs = function (context) {
23
+ return [(0, docker_1.createDockerBuildJobBase)(context, {
24
+ variables: __assign({
25
+ CNB_BUILDER: "heroku/buildpacks:18",
26
+ CNB_ENV_VARS: "BUNDLE_GIT__PANTER__CH",
27
+ CNB_EXTRA_ARGS: "",
28
+ CNB_PACK_VERSION: "0.20.0"
29
+ }, context.componentConfig.build.extraVars),
30
+ // custom script
31
+ script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v$CNB_PACK_VERSION/pack-v$CNB_PACK_VERSION-linux.tgz | tar -zx --directory /usr/local/bin pack", "chmod +x /usr/local/bin/pack", // replace private git ssh gem sources with https to make bundler with credentials via env var work
32
+ // eslint-disable-next-line no-useless-escape
33
+ "sed --in-place 's|git@([^:]*):|https://1/|g' Gemfile Gemfile.lock", "for v in $CNB_ENV_VARS; do env_args=\"$env_args --env $v\"; done", "pack build $DOCKER_IMAGE:$DOCKER_IMAGE_TAG --builder $CNB_BUILDER --publish --cache-image $DOCKER_CACHE_IMAGE $env_args $CNB_EXTRA_ARGS"]
34
+ })];
35
+ };
36
+
37
+ exports.createRailsBuildJobs = createRailsBuildJobs;
@@ -0,0 +1,3 @@
1
+ import { Context } from "../../types";
2
+ import { CatladderJob } from "../../types/jobs";
3
+ export declare const createRailsJobs: (context: Context) => CatladderJob[];
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var __read = this && this.__read || function (o, n) {
4
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5
+ if (!m) return o;
6
+ var i = m.call(o),
7
+ r,
8
+ ar = [],
9
+ e;
10
+
11
+ try {
12
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13
+ } catch (error) {
14
+ e = {
15
+ error: error
16
+ };
17
+ } finally {
18
+ try {
19
+ if (r && !r.done && (m = i["return"])) m.call(i);
20
+ } finally {
21
+ if (e) throw e.error;
22
+ }
23
+ }
24
+
25
+ return ar;
26
+ };
27
+
28
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
29
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
30
+ if (ar || !(i in from)) {
31
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32
+ ar[i] = from[i];
33
+ }
34
+ }
35
+ return to.concat(ar || Array.prototype.slice.call(from));
36
+ };
37
+
38
+ exports.__esModule = true;
39
+ exports.createRailsJobs = void 0;
40
+
41
+ var build_1 = require("./build");
42
+
43
+ var test_1 = require("./test");
44
+
45
+ var createRailsJobs = function (context) {
46
+ return __spreadArray(__spreadArray([], __read((0, test_1.createRailsTestJobs)(context)), false), __read((0, build_1.createRailsBuildJobs)(context)), false);
47
+ };
48
+
49
+ exports.createRailsJobs = createRailsJobs;
@@ -0,0 +1,3 @@
1
+ import type { Context } from "../..";
2
+ import type { CatladderJob } from "../../types/jobs";
3
+ export declare const createRailsTestJobs: (context: Context) => CatladderJob[];
@@ -0,0 +1,107 @@
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
+
8
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ };
16
+
17
+ var __read = this && this.__read || function (o, n) {
18
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
19
+ if (!m) return o;
20
+ var i = m.call(o),
21
+ r,
22
+ ar = [],
23
+ e;
24
+
25
+ try {
26
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
27
+ } catch (error) {
28
+ e = {
29
+ error: error
30
+ };
31
+ } finally {
32
+ try {
33
+ if (r && !r.done && (m = i["return"])) m.call(i);
34
+ } finally {
35
+ if (e) throw e.error;
36
+ }
37
+ }
38
+
39
+ return ar;
40
+ };
41
+
42
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
43
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
44
+ if (ar || !(i in from)) {
45
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
46
+ ar[i] = from[i];
47
+ }
48
+ }
49
+ return to.concat(ar || Array.prototype.slice.call(from));
50
+ };
51
+
52
+ exports.__esModule = true;
53
+ exports.createRailsTestJobs = void 0;
54
+
55
+ var utils_1 = require("../../utils");
56
+
57
+ var createRailsTestJobs = function (context) {
58
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; // don't run tests after release
59
+
60
+
61
+ if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
62
+ return [];
63
+ }
64
+
65
+ var buildConfig = context.componentConfig.build;
66
+ var base = {
67
+ variables: (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {},
68
+ stage: "test",
69
+ needs: [],
70
+ envMode: "none"
71
+ };
72
+ var defaultImage = "docker.io/ruby";
73
+ var bundlerCacheDir = "tmp/cache";
74
+ var bundlerInstall = ["bundle config set path '".concat(bundlerCacheDir, "'"), "bundle install -j $(nproc)"];
75
+ var bundlerCache = {
76
+ key: {
77
+ files: ["Gemfile.lock"],
78
+ prefix: "$CI_JOB_IMAGE"
79
+ },
80
+ paths: [bundlerCacheDir]
81
+ };
82
+ var auditJob = buildConfig.audit !== false ? __assign(__assign({
83
+ name: "๐Ÿ›ก audit"
84
+ }, base), {
85
+ cache: undefined,
86
+ image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
87
+ 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),
88
+ allow_failure: true
89
+ }) : null;
90
+ var lintJob = buildConfig.lint !== false ? __assign(__assign({
91
+ name: "๐Ÿ‘ฎ lint"
92
+ }, base), {
93
+ cache: bundlerCache,
94
+ image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
95
+ 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)
96
+ }) : null;
97
+ var testJob = buildConfig.test !== false ? __assign(__assign({
98
+ name: "๐Ÿงช test"
99
+ }, base), {
100
+ cache: bundlerCache,
101
+ image: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : defaultImage,
102
+ 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)
103
+ }) : null;
104
+ return [auditJob, lintJob, testJob].filter(utils_1.notNil);
105
+ };
106
+
107
+ exports.createRailsTestJobs = createRailsTestJobs;
@@ -28,6 +28,7 @@ export declare type BuildConfigBase = {
28
28
 
29
29
  lint?: false | {
30
30
  command?: string | string[];
31
+ jobImage?: string;
31
32
  };
32
33
  /**
33
34
  * customize test, set false to disable
@@ -35,6 +36,7 @@ export declare type BuildConfigBase = {
35
36
 
36
37
  test?: false | {
37
38
  command?: string | string[];
39
+ jobImage?: string;
38
40
  };
39
41
  /**
40
42
  * customize audit, set false to disable
@@ -42,6 +44,7 @@ export declare type BuildConfigBase = {
42
44
 
43
45
  audit?: false | {
44
46
  command?: string | string[];
47
+ jobImage?: string;
45
48
  };
46
49
  /**
47
50
  * additional paths for artifacts,
@@ -98,16 +101,19 @@ export declare type BuildConfigCustom = BuildConfigBase & {
98
101
  jobServices?: GitlabJobService[];
99
102
  docker: BuildConfigCustomDocker;
100
103
  };
104
+ export declare type BuildConfigRails = BuildConfigBase & {
105
+ type: "rails";
106
+ };
101
107
  export declare type BuildConfigStorybook = BuildConfigNodeBase & {
102
108
  type: "storybook";
103
109
  startCommand?: never;
104
110
  };
105
- export declare type BuildConfig = BuildConfigNode | BuildConfigNodeStatic | BuildConfigStorybook | BuildConfigMeteor | BuildConfigCustom;
111
+ export declare type BuildConfig = BuildConfigNode | BuildConfigNodeStatic | BuildConfigStorybook | BuildConfigMeteor | BuildConfigCustom | BuildConfigRails;
106
112
  export declare type BuildConfigType = BuildConfig["type"];
107
113
  export declare type BuildConfigGeneric<T extends BuildConfigType> = Extract<BuildConfig, {
108
114
  type: T;
109
115
  }>;
110
- export declare const isOfBuildType: <T extends ("node" | "node-static" | "meteor" | "custom" | "storybook")[]>(t: BuildConfig, ...types: T) => t is Extract<BuildConfigNode, {
116
+ export declare const isOfBuildType: <T extends ("node" | "node-static" | "meteor" | "custom" | "rails" | "storybook")[]>(t: BuildConfig, ...types: T) => t is Extract<BuildConfigNode, {
111
117
  type: T[number];
112
118
  }> | Extract<BuildConfigNodeStatic, {
113
119
  type: T[number];
@@ -115,6 +121,8 @@ export declare const isOfBuildType: <T extends ("node" | "node-static" | "meteor
115
121
  type: T[number];
116
122
  }> | Extract<BuildConfigCustom, {
117
123
  type: T[number];
124
+ }> | Extract<BuildConfigRails, {
125
+ type: T[number];
118
126
  }> | Extract<BuildConfigStorybook, {
119
127
  type: T[number];
120
128
  }>;
@@ -27398,6 +27398,8 @@ var custom_1 = __nccwpck_require__(4698);
27398
27398
 
27399
27399
  var node_1 = __nccwpck_require__(2168);
27400
27400
 
27401
+ var rails_1 = __nccwpck_require__(9066);
27402
+
27401
27403
  __exportStar(__nccwpck_require__(6575), exports);
27402
27404
 
27403
27405
  __exportStar(__nccwpck_require__(2168), exports);
@@ -27441,6 +27443,12 @@ exports.BUILD_TYPES = {
27441
27443
  defaults: function () {
27442
27444
  return {};
27443
27445
  }
27446
+ },
27447
+ rails: {
27448
+ jobs: rails_1.createRailsJobs,
27449
+ defaults: function () {
27450
+ return {};
27451
+ }
27444
27452
  }
27445
27453
  };
27446
27454
 
@@ -28055,6 +28063,220 @@ exports.getYarnInstall = getYarnInstall;
28055
28063
 
28056
28064
  /***/ }),
28057
28065
 
28066
+ /***/ 1366:
28067
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
28068
+
28069
+ "use strict";
28070
+
28071
+
28072
+ var __assign = this && this.__assign || function () {
28073
+ __assign = Object.assign || function (t) {
28074
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
28075
+ s = arguments[i];
28076
+
28077
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
28078
+ }
28079
+
28080
+ return t;
28081
+ };
28082
+
28083
+ return __assign.apply(this, arguments);
28084
+ };
28085
+
28086
+ exports.__esModule = true;
28087
+ exports.createRailsBuildJobs = void 0;
28088
+
28089
+ var docker_1 = __nccwpck_require__(9953);
28090
+
28091
+ var createRailsBuildJobs = function (context) {
28092
+ return [(0, docker_1.createDockerBuildJobBase)(context, {
28093
+ variables: __assign({
28094
+ CNB_BUILDER: "heroku/buildpacks:18",
28095
+ CNB_ENV_VARS: "BUNDLE_GIT__PANTER__CH",
28096
+ CNB_EXTRA_ARGS: "",
28097
+ CNB_PACK_VERSION: "0.20.0"
28098
+ }, context.componentConfig.build.extraVars),
28099
+ // custom script
28100
+ script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v$CNB_PACK_VERSION/pack-v$CNB_PACK_VERSION-linux.tgz | tar -zx --directory /usr/local/bin pack", "chmod +x /usr/local/bin/pack", // replace private git ssh gem sources with https to make bundler with credentials via env var work
28101
+ // eslint-disable-next-line no-useless-escape
28102
+ "sed --in-place 's|git@([^:]*):|https://1/|g' Gemfile Gemfile.lock", "for v in $CNB_ENV_VARS; do env_args=\"$env_args --env $v\"; done", "pack build $DOCKER_IMAGE:$DOCKER_IMAGE_TAG --builder $CNB_BUILDER --publish --cache-image $DOCKER_CACHE_IMAGE $env_args $CNB_EXTRA_ARGS"]
28103
+ })];
28104
+ };
28105
+
28106
+ exports.createRailsBuildJobs = createRailsBuildJobs;
28107
+
28108
+ /***/ }),
28109
+
28110
+ /***/ 9066:
28111
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
28112
+
28113
+ "use strict";
28114
+
28115
+
28116
+ var __read = this && this.__read || function (o, n) {
28117
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
28118
+ if (!m) return o;
28119
+ var i = m.call(o),
28120
+ r,
28121
+ ar = [],
28122
+ e;
28123
+
28124
+ try {
28125
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
28126
+ } catch (error) {
28127
+ e = {
28128
+ error: error
28129
+ };
28130
+ } finally {
28131
+ try {
28132
+ if (r && !r.done && (m = i["return"])) m.call(i);
28133
+ } finally {
28134
+ if (e) throw e.error;
28135
+ }
28136
+ }
28137
+
28138
+ return ar;
28139
+ };
28140
+
28141
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
28142
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
28143
+ if (ar || !(i in from)) {
28144
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
28145
+ ar[i] = from[i];
28146
+ }
28147
+ }
28148
+ return to.concat(ar || Array.prototype.slice.call(from));
28149
+ };
28150
+
28151
+ exports.__esModule = true;
28152
+ exports.createRailsJobs = void 0;
28153
+
28154
+ var build_1 = __nccwpck_require__(1366);
28155
+
28156
+ var test_1 = __nccwpck_require__(2808);
28157
+
28158
+ var createRailsJobs = function (context) {
28159
+ return __spreadArray(__spreadArray([], __read((0, test_1.createRailsTestJobs)(context)), false), __read((0, build_1.createRailsBuildJobs)(context)), false);
28160
+ };
28161
+
28162
+ exports.createRailsJobs = createRailsJobs;
28163
+
28164
+ /***/ }),
28165
+
28166
+ /***/ 2808:
28167
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
28168
+
28169
+ "use strict";
28170
+
28171
+
28172
+ var __assign = this && this.__assign || function () {
28173
+ __assign = Object.assign || function (t) {
28174
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
28175
+ s = arguments[i];
28176
+
28177
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
28178
+ }
28179
+
28180
+ return t;
28181
+ };
28182
+
28183
+ return __assign.apply(this, arguments);
28184
+ };
28185
+
28186
+ var __read = this && this.__read || function (o, n) {
28187
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
28188
+ if (!m) return o;
28189
+ var i = m.call(o),
28190
+ r,
28191
+ ar = [],
28192
+ e;
28193
+
28194
+ try {
28195
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
28196
+ } catch (error) {
28197
+ e = {
28198
+ error: error
28199
+ };
28200
+ } finally {
28201
+ try {
28202
+ if (r && !r.done && (m = i["return"])) m.call(i);
28203
+ } finally {
28204
+ if (e) throw e.error;
28205
+ }
28206
+ }
28207
+
28208
+ return ar;
28209
+ };
28210
+
28211
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
28212
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
28213
+ if (ar || !(i in from)) {
28214
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
28215
+ ar[i] = from[i];
28216
+ }
28217
+ }
28218
+ return to.concat(ar || Array.prototype.slice.call(from));
28219
+ };
28220
+
28221
+ exports.__esModule = true;
28222
+ exports.createRailsTestJobs = void 0;
28223
+
28224
+ var utils_1 = __nccwpck_require__(1815);
28225
+
28226
+ var createRailsTestJobs = function (context) {
28227
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; // don't run tests after release
28228
+
28229
+
28230
+ if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
28231
+ return [];
28232
+ }
28233
+
28234
+ var buildConfig = context.componentConfig.build;
28235
+ var base = {
28236
+ variables: (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {},
28237
+ stage: "test",
28238
+ needs: [],
28239
+ envMode: "none"
28240
+ };
28241
+ var defaultImage = "docker.io/ruby";
28242
+ var bundlerCacheDir = "tmp/cache";
28243
+ var bundlerInstall = ["bundle config set path '".concat(bundlerCacheDir, "'"), "bundle install -j $(nproc)"];
28244
+ var bundlerCache = {
28245
+ key: {
28246
+ files: ["Gemfile.lock"],
28247
+ prefix: "$CI_JOB_IMAGE"
28248
+ },
28249
+ paths: [bundlerCacheDir]
28250
+ };
28251
+ var auditJob = buildConfig.audit !== false ? __assign(__assign({
28252
+ name: "๐Ÿ›ก audit"
28253
+ }, base), {
28254
+ cache: undefined,
28255
+ image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
28256
+ 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),
28257
+ allow_failure: true
28258
+ }) : null;
28259
+ var lintJob = buildConfig.lint !== false ? __assign(__assign({
28260
+ name: "๐Ÿ‘ฎ lint"
28261
+ }, base), {
28262
+ cache: bundlerCache,
28263
+ image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
28264
+ 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)
28265
+ }) : null;
28266
+ var testJob = buildConfig.test !== false ? __assign(__assign({
28267
+ name: "๐Ÿงช test"
28268
+ }, base), {
28269
+ cache: bundlerCache,
28270
+ image: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : defaultImage,
28271
+ 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)
28272
+ }) : null;
28273
+ return [auditJob, lintJob, testJob].filter(utils_1.notNil);
28274
+ };
28275
+
28276
+ exports.createRailsTestJobs = createRailsTestJobs;
28277
+
28278
+ /***/ }),
28279
+
28058
28280
  /***/ 6575:
28059
28281
  /***/ ((__unused_webpack_module, exports) => {
28060
28282
 
@@ -28362,7 +28584,7 @@ exports.readConfigSync = readConfigSync;
28362
28584
 
28363
28585
  exports.__esModule = true;
28364
28586
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
28365
- exports.PIPELINE_IMAGE_TAG = "main-e52d6632" || 0;
28587
+ exports.PIPELINE_IMAGE_TAG = "main-344735ad" || 0;
28366
28588
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
28367
28589
 
28368
28590
  /***/ }),
@@ -28905,8 +29127,9 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
28905
29127
  additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
28906
29128
  host = (_c = (_b = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _b !== void 0 ? _b : additionalEnvVars.HOST_CANONICAL) !== null && _c !== void 0 ? _c : "unknown-host.example.com";
28907
29129
  url = "https://".concat(host);
28908
- predefinedVariables = __assign(__assign(__assign({}, basePredefinedVariables), {
28909
- HOST: host,
29130
+ predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), config.components[componentName].build.type === "rails" ? {} : {
29131
+ HOST: host
29132
+ }), {
28910
29133
  ROOT_URL: url
28911
29134
  }), additionalEnvVars);
28912
29135
  }
@@ -29844,7 +30067,7 @@ var setExtraVarsScripts = function (deployConfig) {
29844
30067
  };
29845
30068
 
29846
30069
  var createGoogleCloudRunDeployJobs = function (context) {
29847
- var _a;
30070
+ var _a, _b, _c;
29848
30071
 
29849
30072
  var deployConfig = context.componentConfig.deploy;
29850
30073
 
@@ -29904,12 +30127,31 @@ var createGoogleCloudRunDeployJobs = function (context) {
29904
30127
  };
29905
30128
  });
29906
30129
 
29907
- var getServiceDeployScript = function (service) {
30130
+ var getServiceDeployScript = function (service, nameSuffix) {
29908
30131
  var _a;
29909
30132
 
30133
+ var customConfig = service !== true ? service : undefined;
29910
30134
  var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
29911
30135
  var commandArg = command ? "--command=\"".concat(command.split(" ").join(","), "\"") : "";
29912
- return "gcloud run deploy ".concat(serviceName, " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml --allow-unauthenticated");
30136
+ var args = {
30137
+ "allow-unauthenticated": true,
30138
+ "min-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances,
30139
+ "max-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances,
30140
+ "no-cpu-throttling": customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling
30141
+ };
30142
+ var argsString = Object.entries(args).filter(function (_a) {
30143
+ var _b = __read(_a, 2),
30144
+ value = _b[1];
30145
+
30146
+ return !(0, lodash_1.isNil)(value);
30147
+ }).map(function (_a) {
30148
+ var _b = __read(_a, 2),
30149
+ key = _b[0],
30150
+ value = _b[1];
30151
+
30152
+ return "--".concat(key).concat(value !== true ? "=".concat(value) : "");
30153
+ }).join(" ");
30154
+ return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml ").concat(argsString);
29913
30155
  };
29914
30156
 
29915
30157
  var getJobCreateScriptsForJob = function (jobName, job) {
@@ -29966,10 +30208,21 @@ var createGoogleCloudRunDeployJobs = function (context) {
29966
30208
  });
29967
30209
  };
29968
30210
 
29969
- var deployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(setExtraVarsScripts(deployConfig)), false), __read(pushImageToArtifactsRegistry), false), ["echo \"$ENV_VARS\" > ____envvars.yaml"], false), __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
29970
- : []), false), __read(getCreateScheduleScripts()), false), __read(getJobCreateScripts()), false), __read(getJobRunScripts("preDeploy")), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(getJobRunScripts("postDeploy")), false), ["docker image rm ".concat(gcloudImageName)], false);
30211
+ var deployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(setExtraVarsScripts(deployConfig)), false), __read(pushImageToArtifactsRegistry), false), ["echo \"$ENV_VARS\" > ____envvars.yaml"], false), __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
30212
+ : []), false), __read(getCreateScheduleScripts()), false), __read(getJobCreateScripts()), false), __read(getJobRunScripts("preDeploy")), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(Object.entries((_b = deployConfig.additionalServices) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
30213
+ var _b = __read(_a, 2),
30214
+ name = _b[0],
30215
+ service = _b[1];
30216
+
30217
+ return getServiceDeployScript(service, "-" + name);
30218
+ })), false), __read(getJobRunScripts("postDeploy")), false), ["docker image rm ".concat(gcloudImageName)], false);
30219
+
30220
+ var stopScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName, " ").concat(commonArgs)] : []), false), __read(Object.entries((_c = deployConfig.additionalServices) !== null && _c !== void 0 ? _c : {}).map(function (_a) {
30221
+ var _b = __read(_a, 1),
30222
+ name = _b[0];
29971
30223
 
29972
- var stopScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName, " ").concat(commonArgs)] : []), false), __read(getDeleteSchedulesScripts()), false), __read(getDeleteJobsScripts()), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false);
30224
+ return "gcloud run services delete ".concat(serviceName, "-").concat(name, " ").concat(commonArgs);
30225
+ })), false), __read(getDeleteSchedulesScripts()), false), __read(getDeleteJobsScripts()), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false);
29973
30226
 
29974
30227
  return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
29975
30228
  artifacts: {
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-e52d6632" || "";
5
+ exports.PIPELINE_IMAGE_TAG = "main-344735ad" || "";
6
6
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "";
@@ -237,8 +237,9 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
237
237
  additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
238
238
  host = (_c = (_b = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _b !== void 0 ? _b : additionalEnvVars.HOST_CANONICAL) !== null && _c !== void 0 ? _c : "unknown-host.example.com";
239
239
  url = "https://".concat(host);
240
- predefinedVariables = __assign(__assign(__assign({}, basePredefinedVariables), {
241
- HOST: host,
240
+ predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), config.components[componentName].build.type === "rails" ? {} : {
241
+ HOST: host
242
+ }), {
242
243
  ROOT_URL: url
243
244
  }), additionalEnvVars);
244
245
  }