@catladder/pipeline 1.149.4 → 1.150.1

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/constants.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
7
- exports.PIPELINE_IMAGE_TAG = "v1-149-4-4fb763a0" || "latest";
7
+ exports.PIPELINE_IMAGE_TAG = "v1-150-1-76b8c1d7" || "latest";
8
8
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
@@ -145,7 +145,7 @@ var createComponentContext = function (ctx) {
145
145
  if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
146
146
  throw new Error("componentName may only contain lower case letters, numbers and -");
147
147
  }
148
- return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(ctx.config, ctx.componentName)];
148
+ return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfoForComponent)(ctx.config, ctx.componentName)];
149
149
  case 1:
150
150
  packageManagerInfo = _a.sent();
151
151
  envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
@@ -72,6 +72,7 @@ var getServiceDeployScript = function (context, service, nameSuffix) {
72
72
  "cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
73
73
  cpu: customConfig === null || customConfig === void 0 ? void 0 : customConfig.cpu,
74
74
  memory: customConfig === null || customConfig === void 0 ? void 0 : customConfig.memory,
75
+ timeout: customConfig === null || customConfig === void 0 ? void 0 : customConfig.timeout,
75
76
  "allow-unauthenticated": (_d = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _d !== void 0 ? _d : true,
76
77
  ingress: (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _e !== void 0 ? _e : "all",
77
78
  "cpu-boost": true,
@@ -89,6 +89,14 @@ export type DeployConfigCloudRunService = {
89
89
  * memory limit. Defaults to 512MB
90
90
  */
91
91
  memory?: Memory;
92
+ /**
93
+ * timeout of the service, defaults to 5 minutes.
94
+ *
95
+ * you can specify something like 10m30s. if its just a number, it will be interpreted as seconds
96
+ *
97
+ * max supported is 60min
98
+ */
99
+ timeout?: string;
92
100
  /**
93
101
  *
94
102
  * set the execution environment.
@@ -125,28 +125,6 @@ var __generator = this && this.__generator || function (thisArg, body) {
125
125
  };
126
126
  }
127
127
  };
128
- var __read = this && this.__read || function (o, n) {
129
- var m = typeof Symbol === "function" && o[Symbol.iterator];
130
- if (!m) return o;
131
- var i = m.call(o),
132
- r,
133
- ar = [],
134
- e;
135
- try {
136
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
137
- } catch (error) {
138
- e = {
139
- error: error
140
- };
141
- } finally {
142
- try {
143
- if (r && !r.done && (m = i["return"])) m.call(i);
144
- } finally {
145
- if (e) throw e.error;
146
- }
147
- }
148
- return ar;
149
- };
150
128
  Object.defineProperty(exports, "__esModule", {
151
129
  value: true
152
130
  });
@@ -156,51 +134,41 @@ var context_1 = require("../context");
156
134
  var createJobsForComponent_1 = require("./createJobsForComponent");
157
135
  var createAllComponentContext = function (_a) {
158
136
  return __awaiter(void 0, [_a], void 0, function (_b) {
159
- var _c, _d;
160
137
  var config = _b.config,
161
138
  trigger = _b.trigger,
162
139
  pipelineType = _b.pipelineType;
163
- return __generator(this, function (_e) {
164
- switch (_e.label) {
140
+ return __generator(this, function (_c) {
141
+ switch (_c.label) {
165
142
  case 0:
166
- _d = (_c = Object).fromEntries;
167
- return [4 /*yield*/, Promise.all(Object.keys(config.components).map(function (componentName) {
168
- return __awaiter(void 0, void 0, void 0, function () {
169
- var envs, _a, _b, _c;
170
- return __generator(this, function (_d) {
171
- switch (_d.label) {
172
- case 0:
173
- envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
174
- _a = [componentName];
175
- _c = (_b = Object).fromEntries;
176
- return [4 /*yield*/, Promise.all(envs.map(function (env) {
177
- return __awaiter(void 0, void 0, void 0, function () {
178
- var context;
179
- return __generator(this, function (_a) {
180
- switch (_a.label) {
181
- case 0:
182
- return [4 /*yield*/, (0, context_1.createComponentContext)({
183
- config: config,
184
- componentName: componentName,
185
- env: env,
186
- trigger: trigger,
187
- pipelineType: pipelineType
188
- })];
189
- case 1:
190
- context = _a.sent();
191
- return [2 /*return*/, [env, context]];
192
- }
193
- });
194
- });
195
- }))];
196
- case 1:
197
- return [2 /*return*/, _a.concat([_c.apply(_b, [_d.sent()])])];
198
- }
143
+ return [4 /*yield*/, Promise.all(Object.keys(config.components).flatMap(function (componentName) {
144
+ var envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
145
+ return envs.map(function (env) {
146
+ return __awaiter(void 0, void 0, void 0, function () {
147
+ var context;
148
+ return __generator(this, function (_a) {
149
+ switch (_a.label) {
150
+ case 0:
151
+ return [4 /*yield*/, (0, context_1.createComponentContext)({
152
+ config: config,
153
+ componentName: componentName,
154
+ env: env,
155
+ trigger: trigger,
156
+ pipelineType: pipelineType
157
+ })];
158
+ case 1:
159
+ context = _a.sent();
160
+ return [2 /*return*/, {
161
+ env: env,
162
+ componentName: componentName,
163
+ context: context
164
+ }];
165
+ }
166
+ });
199
167
  });
200
168
  });
201
169
  }))];
202
170
  case 1:
203
- return [2 /*return*/, _d.apply(_c, [_e.sent()])];
171
+ return [2 /*return*/, _c.sent()];
204
172
  }
205
173
  });
206
174
  });
@@ -221,21 +189,20 @@ var createAllJobs = function (_a) {
221
189
  })];
222
190
  case 1:
223
191
  allComponentContext = _c.sent();
224
- return [2 /*return*/, Object.fromEntries(Object.entries(allComponentContext).map(function (_a) {
225
- var _b = __read(_a, 2),
226
- componentName = _b[0],
227
- envs = _b[1];
228
- return [componentName, Object.fromEntries(Object.entries(envs).map(function (_a) {
229
- var _b = __read(_a, 2),
230
- env = _b[0],
231
- context = _b[1];
232
- return [env, (0, createJobsForComponent_1.createJobsForComponentContext)(context).map(function (job) {
233
- return __assign(__assign({}, job), {
234
- context: context
235
- });
236
- })];
237
- }))];
238
- }))];
192
+ return [2 /*return*/, allComponentContext.reduce(function (acc, _a) {
193
+ var componentName = _a.componentName,
194
+ env = _a.env,
195
+ context = _a.context;
196
+ if (!acc[componentName]) {
197
+ acc[componentName] = {};
198
+ }
199
+ acc[componentName][env] = (0, createJobsForComponent_1.createJobsForComponentContext)(context).map(function (job) {
200
+ return __assign(__assign({}, job), {
201
+ context: context
202
+ });
203
+ });
204
+ return acc;
205
+ }, {})];
239
206
  }
240
207
  });
241
208
  });
@@ -1,2 +1,2 @@
1
- import type { Config, PackageManagerInfo } from "../types";
2
- export declare const getPackageManagerInfo: (config: Config, componentName: string) => Promise<PackageManagerInfo>;
1
+ import type { Config, PackageManagerInfoComponent } from "../types";
2
+ export declare const getPackageManagerInfoForComponent: (config: Config, componentName: string) => Promise<PackageManagerInfoComponent>;
@@ -149,12 +149,12 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
149
149
  Object.defineProperty(exports, "__esModule", {
150
150
  value: true
151
151
  });
152
- exports.getPackageManagerInfo = void 0;
152
+ exports.getPackageManagerInfoForComponent = void 0;
153
153
  var fs_1 = require("fs");
154
154
  var path_1 = require("path");
155
155
  var path_equal_1 = require("path-equal");
156
156
  var yarnUtils_1 = require("./yarn/yarnUtils");
157
- var getPackageManagerInfo = function (config, componentName) {
157
+ var getPackageManagerInfoForComponent = function (config, componentName) {
158
158
  return __awaiter(void 0, void 0, void 0, function () {
159
159
  var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, configFilePaths, currentWorkspaceDependencies, pathsToCopyInDocker;
160
160
  return __generator(this, function (_a) {
@@ -199,4 +199,4 @@ var getPackageManagerInfo = function (config, componentName) {
199
199
  });
200
200
  });
201
201
  };
202
- exports.getPackageManagerInfo = getPackageManagerInfo;
202
+ exports.getPackageManagerInfoForComponent = getPackageManagerInfoForComponent;
@@ -1,5 +1,5 @@
1
1
  import memoizee from "memoizee";
2
- import type { PackageManagerInfo, YarnWorkspace } from "../../types";
2
+ import type { YarnWorkspace } from "../../types";
3
3
  export declare const getYarnVersion: (() => Promise<string>) & memoizee.Memoized<() => Promise<string>>;
4
- export declare const getWorkspaces: ((isClassic: boolean) => Promise<PackageManagerInfo["workspaces"]>) & memoizee.Memoized<(isClassic: boolean) => Promise<PackageManagerInfo["workspaces"]>>;
4
+ export declare const getWorkspaces: ((isClassic: boolean) => Promise<Array<YarnWorkspace>>) & memoizee.Memoized<(isClassic: boolean) => Promise<Array<YarnWorkspace>>>;
5
5
  export declare const getWorkspaceDependencies: (ws: YarnWorkspace, allWorkspaces: YarnWorkspace[]) => string[];