@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.
@@ -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
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "1.124.4",
55
+ "version": "1.125.1",
56
56
  "scripts": {
57
57
  "build:tsc": "yarn tsc",
58
58
  "build": "yarn build:compile && yarn build:inline-variables && yarn build:bundle",
@@ -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: command ? '"' + command.split(" ").join(",") + '"' : '""',
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.