@catladder/pipeline 1.149.4 → 1.150.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/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.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/tsconfig.tsbuildinfo +1 -1
- 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/deploy/cloudRun/createJobs/cloudRunServices.ts +1 -0
- package/src/deploy/types/googleCloudRun.ts +9 -0
- package/src/pipeline/createAllJobs.ts +37 -43
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Config } from "../src";
|
|
2
|
+
import { createAllPipelines } from "./__utils__/helpers";
|
|
3
|
+
const config: Config = {
|
|
4
|
+
appName: "test-app",
|
|
5
|
+
customerName: "pan",
|
|
6
|
+
components: {
|
|
7
|
+
api: {
|
|
8
|
+
dir: "api",
|
|
9
|
+
build: {
|
|
10
|
+
type: "node",
|
|
11
|
+
},
|
|
12
|
+
deploy: {
|
|
13
|
+
type: "google-cloudrun",
|
|
14
|
+
projectId: "google-project-id",
|
|
15
|
+
region: "europe-west6",
|
|
16
|
+
|
|
17
|
+
service: {
|
|
18
|
+
timeout: "10m20s",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it("matches snapshot", async () => {
|
|
26
|
+
expect(await createAllPipelines(config)).toMatchSnapshot();
|
|
27
|
+
});
|
package/package.json
CHANGED
|
@@ -49,6 +49,7 @@ export const getServiceDeployScript = (
|
|
|
49
49
|
"cpu-throttling": customConfig?.noCpuThrottling !== true,
|
|
50
50
|
cpu: customConfig?.cpu,
|
|
51
51
|
memory: customConfig?.memory,
|
|
52
|
+
timeout: customConfig?.timeout,
|
|
52
53
|
"allow-unauthenticated": customConfig?.allowUnauthenticated ?? true,
|
|
53
54
|
ingress: customConfig?.ingress ?? "all",
|
|
54
55
|
"cpu-boost": true,
|
|
@@ -139,6 +139,15 @@ export type DeployConfigCloudRunService = {
|
|
|
139
139
|
*/
|
|
140
140
|
memory?: Memory;
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* timeout of the service, defaults to 5 minutes.
|
|
144
|
+
*
|
|
145
|
+
* you can specify something like 10m30s. if its just a number, it will be interpreted as seconds
|
|
146
|
+
*
|
|
147
|
+
* max supported is 60min
|
|
148
|
+
*/
|
|
149
|
+
timeout?: string;
|
|
150
|
+
|
|
142
151
|
/**
|
|
143
152
|
*
|
|
144
153
|
* set the execution environment.
|
|
@@ -21,41 +21,36 @@ export type AllJobsContext = {
|
|
|
21
21
|
pipelineType: PipelineType;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
type AllComponentContext = {
|
|
25
|
-
[componentName: string]: {
|
|
26
|
-
[env: string]: ComponentContext;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
24
|
const createAllComponentContext = async ({
|
|
31
25
|
config,
|
|
32
26
|
trigger,
|
|
33
27
|
pipelineType,
|
|
34
|
-
}: AllJobsContext): Promise<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
}: AllJobsContext): Promise<
|
|
29
|
+
Array<{
|
|
30
|
+
env: string;
|
|
31
|
+
componentName: string;
|
|
32
|
+
context: ComponentContext;
|
|
33
|
+
}>
|
|
34
|
+
> => {
|
|
35
|
+
return await Promise.all(
|
|
36
|
+
Object.keys(config.components).flatMap((componentName) => {
|
|
37
|
+
const envs = getAllEnvsByTrigger(config, componentName, trigger);
|
|
38
|
+
return envs.map(async (env) => {
|
|
39
|
+
const context = await createComponentContext({
|
|
40
|
+
config,
|
|
40
41
|
componentName,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
config,
|
|
46
|
-
componentName,
|
|
47
|
-
env,
|
|
48
|
-
trigger,
|
|
49
|
-
pipelineType,
|
|
50
|
-
});
|
|
42
|
+
env,
|
|
43
|
+
trigger,
|
|
44
|
+
pipelineType,
|
|
45
|
+
});
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
})
|
|
58
|
-
),
|
|
47
|
+
return {
|
|
48
|
+
env,
|
|
49
|
+
componentName,
|
|
50
|
+
context,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}),
|
|
59
54
|
);
|
|
60
55
|
};
|
|
61
56
|
|
|
@@ -70,18 +65,17 @@ export const createAllJobs = async ({
|
|
|
70
65
|
pipelineType,
|
|
71
66
|
});
|
|
72
67
|
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
componentName
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
);
|
|
68
|
+
return allComponentContext.reduce((acc, { componentName, env, context }) => {
|
|
69
|
+
if (!acc[componentName]) {
|
|
70
|
+
acc[componentName] = {};
|
|
71
|
+
}
|
|
72
|
+
acc[componentName][env] = createJobsForComponentContext(context).map(
|
|
73
|
+
(job) => ({
|
|
74
|
+
...job,
|
|
75
|
+
context,
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return acc;
|
|
80
|
+
}, {} as AllCatladderJobs);
|
|
87
81
|
};
|