@catladder/cli 1.41.2 → 1.41.3

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/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "node": ">=12.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@catladder/pipeline": "1.41.2",
27
+ "@catladder/pipeline": "1.41.3",
28
28
  "@kubernetes/client-node": "^0.16.2",
29
29
  "@tsconfig/node14": "^1.0.1",
30
30
  "@types/common-tags": "^1.8.0",
@@ -58,5 +58,5 @@
58
58
  "update-notifier": "^5",
59
59
  "vorpal": "^1.12.0"
60
60
  },
61
- "version": "1.41.2"
61
+ "version": "1.41.3"
62
62
  }
@@ -0,0 +1,19 @@
1
+ import type { Context } from "@catladder/pipeline";
2
+ import { getCloudSQLConfig, hasCloudSQL } from "@catladder/pipeline";
3
+ import type { CommandInstance } from "vorpal";
4
+
5
+ export const setupCloudSQL = async (
6
+ instance: CommandInstance,
7
+ context: Context
8
+ ) => {
9
+ if (!hasCloudSQL(context)) {
10
+ throw new Error("cannot setup cloudsql, as it has none");
11
+ }
12
+ const config = getCloudSQLConfig(context);
13
+ instance.log("");
14
+ instance.log(
15
+ "! make sure to provide cloudsqlProxyCredentials for the cloud sql service account in " +
16
+ config.projectId
17
+ );
18
+ instance.log("");
19
+ };
@@ -1,6 +1,8 @@
1
- import type { Context} from "@catladder/pipeline";
2
- import { isOfDeployType } from "@catladder/pipeline";
1
+ import type { Context } from "@catladder/pipeline";
2
+ import { isOfDeployType, hasCloudSQL } from "@catladder/pipeline";
3
3
  import type { CommandInstance } from "vorpal";
4
+ import { setupCloudSQL } from "./setupCloudSQL";
5
+
4
6
  import { setupKubernetes } from "./setupKubernetes";
5
7
 
6
8
  export const setupContext = async (
@@ -20,6 +22,10 @@ export const setupContext = async (
20
22
  "..."
21
23
  );
22
24
  instance.log("");
25
+ if (hasCloudSQL(context)) {
26
+ await setupCloudSQL(instance, context);
27
+ }
28
+
23
29
  const deployConfig = context.componentConfig.deploy;
24
30
  if (isOfDeployType(deployConfig, "kubernetes")) {
25
31
  await setupKubernetes(instance, context);