@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/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/createComponentContext.js +1 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +1 -0
- package/dist/deploy/types/googleCloudRun.d.ts +8 -0
- package/dist/pipeline/createAllJobs.js +41 -74
- package/dist/pipeline/packageManager.d.ts +2 -2
- package/dist/pipeline/packageManager.js +3 -3
- package/dist/pipeline/yarn/yarnUtils.d.ts +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +8 -7
- package/examples/__snapshots__/cloud-run-service-increase-timout.ts.snap +1950 -0
- package/examples/cloud-run-service-increase-timout.ts +27 -0
- package/package.json +1 -1
- package/src/context/createComponentContext.ts +2 -2
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +1 -0
- package/src/deploy/types/googleCloudRun.ts +9 -0
- package/src/pipeline/createAllJobs.ts +37 -43
- package/src/pipeline/packageManager.ts +3 -3
- package/src/pipeline/yarn/yarnUtils.ts +2 -2
- package/src/types/context.ts +8 -7
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-
|
|
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.
|
|
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 (
|
|
164
|
-
switch (
|
|
140
|
+
return __generator(this, function (_c) {
|
|
141
|
+
switch (_c.label) {
|
|
165
142
|
case 0:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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*/,
|
|
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*/,
|
|
225
|
-
var
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return
|
|
233
|
-
|
|
234
|
-
|
|
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,
|
|
2
|
-
export declare const
|
|
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.
|
|
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
|
|
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.
|
|
202
|
+
exports.getPackageManagerInfoForComponent = getPackageManagerInfoForComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memoizee from "memoizee";
|
|
2
|
-
import type {
|
|
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<
|
|
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[];
|