@catladder/pipeline 1.124.4 → 1.125.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/deploy/cloudRun/deployJob.js +2 -1
- package/dist/deploy/types/googleCloudRun.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-meteor-with-worker.ts.snap +1813 -0
- package/examples/__snapshots__/cloud-run-with-worker.ts.snap +1853 -0
- package/examples/cloud-run-meteor-with-worker.ts +35 -0
- package/examples/cloud-run-with-worker.ts +35 -0
- package/package.json +1 -1
- package/src/deploy/cloudRun/deployJob.ts +7 -1
- package/src/deploy/types/googleCloudRun.ts +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
web: {
|
|
8
|
+
dir: "web",
|
|
9
|
+
build: {
|
|
10
|
+
type: "meteor",
|
|
11
|
+
},
|
|
12
|
+
deploy: {
|
|
13
|
+
type: "google-cloudrun",
|
|
14
|
+
projectId: "google-project-id",
|
|
15
|
+
region: "europe-west6",
|
|
16
|
+
additionalServices: {
|
|
17
|
+
// its usually better to create another catladder component for the worker
|
|
18
|
+
// but in some legacy cases it might be easier to add an extra service
|
|
19
|
+
// notice that you can't use different secrets on the worker, it will receive the same env vars as the normal service
|
|
20
|
+
// you can specify extra vars though
|
|
21
|
+
worker: {
|
|
22
|
+
noCpuThrottling: true,
|
|
23
|
+
maxInstances: 1,
|
|
24
|
+
minInstances: 1,
|
|
25
|
+
command: ["/bin/sh -c", "BACKGROUND_JOBS_ENABLED=1 node main.js"],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
it("matches snapshot", async () => {
|
|
34
|
+
expect(await createAllPipelines(config)).toMatchSnapshot();
|
|
35
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
additionalServices: {
|
|
17
|
+
// its usually better to create another catladder component for the worker
|
|
18
|
+
// but in some legacy cases it might be easier to add an extra service
|
|
19
|
+
// notice that you can't use different secrets on the worker, it will receive the same env vars as the normal service
|
|
20
|
+
// you can specify extra vars though
|
|
21
|
+
worker: {
|
|
22
|
+
noCpuThrottling: true,
|
|
23
|
+
maxInstances: 1,
|
|
24
|
+
minInstances: 1,
|
|
25
|
+
command: "yarn start:worker",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
it("matches snapshot", async () => {
|
|
34
|
+
expect(await createAllPipelines(config)).toMatchSnapshot();
|
|
35
|
+
});
|
package/package.json
CHANGED
|
@@ -109,9 +109,15 @@ export const createGoogleCloudRunDeployJobs = (
|
|
|
109
109
|
? service?.command ?? context.componentConfig.build.startCommand
|
|
110
110
|
: undefined;
|
|
111
111
|
|
|
112
|
+
const commandArray = command
|
|
113
|
+
? Array.isArray(command)
|
|
114
|
+
? command
|
|
115
|
+
: command.split(" ")
|
|
116
|
+
: undefined;
|
|
117
|
+
|
|
112
118
|
const argsString = createArgsString({
|
|
113
119
|
// command as empty string resets it to default (uses the image's entrypoint)
|
|
114
|
-
command:
|
|
120
|
+
command: commandArray ? '"' + commandArray.join(",") + '"' : '""',
|
|
115
121
|
...commonDeployArgs,
|
|
116
122
|
"env-vars-file": "____envvars.yaml",
|
|
117
123
|
"min-instances": customConfig?.minInstances ?? 0,
|
|
@@ -78,7 +78,7 @@ export type DeployConfigCloudRunService = {
|
|
|
78
78
|
/**
|
|
79
79
|
* command / entrypoint, fallsback to buildConfig.startcommand
|
|
80
80
|
*/
|
|
81
|
-
command?: string;
|
|
81
|
+
command?: string | string[];
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* how many instances to keep around when there are no requests. defaults to 0.
|