@catladder/cli 1.41.2 → 1.41.4
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/apps/cli/commands/project/setup/setupCloudSQL.d.ts +3 -0
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.js +56 -0
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.js.map +1 -0
- package/dist/apps/cli/commands/project/setup/setupContext.js +10 -3
- package/dist/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/apps/cli/verify/migration/migrateSecrets.js +4 -3
- package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -1
- package/dist/bundles/catenv/index.js +3 -3
- package/dist/bundles/cli/index.js +3 -3
- package/dist/config/getProjectConfig.js +2 -1
- package/dist/config/getProjectConfig.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/apps/cli/commands/project/setup/setupCloudSQL.ts +19 -0
- package/src/apps/cli/commands/project/setup/setupContext.ts +8 -2
- package/src/apps/cli/verify/migration/migrateSecrets.ts +5 -1
- package/src/config/getProjectConfig.ts +3 -4
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"node": ">=12.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@catladder/pipeline": "1.41.
|
|
27
|
+
"@catladder/pipeline": "1.41.4",
|
|
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.
|
|
61
|
+
"version": "1.41.4"
|
|
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);
|
|
@@ -23,7 +23,11 @@ export const migrateSecrets = async (
|
|
|
23
23
|
const secrets = load(yamlstring);
|
|
24
24
|
|
|
25
25
|
Object.keys(newConfig.components).forEach(async (componentName) => {
|
|
26
|
-
const environment = getEnvironment(
|
|
26
|
+
const environment = await getEnvironment(
|
|
27
|
+
newConfig,
|
|
28
|
+
componentName,
|
|
29
|
+
newEnv
|
|
30
|
+
);
|
|
27
31
|
await upsertAllVariables(
|
|
28
32
|
vorpal,
|
|
29
33
|
pick(secrets, environment.secretEnvVarKeys),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Config} from "@catladder/pipeline";
|
|
1
|
+
import type { Config } from "@catladder/pipeline";
|
|
3
2
|
import {
|
|
4
3
|
readConfigSync,
|
|
5
4
|
getAllEnvs,
|
|
6
5
|
getEnvironment as _getEnvironment,
|
|
7
6
|
createContext,
|
|
8
|
-
getSecretVarName
|
|
7
|
+
getSecretVarName,
|
|
9
8
|
} from "@catladder/pipeline";
|
|
10
9
|
|
|
11
10
|
import type { CommandInstance } from "vorpal";
|
|
@@ -67,7 +66,7 @@ export const getPipelineContextByChoice = async (
|
|
|
67
66
|
componentName: string
|
|
68
67
|
) => {
|
|
69
68
|
const config = await getProjectConfig();
|
|
70
|
-
return createContext(config, componentName, env);
|
|
69
|
+
return await createContext(config, componentName, env);
|
|
71
70
|
};
|
|
72
71
|
export const getAllComponentsWithAllEnvsFlat = async (): Promise<
|
|
73
72
|
Array<{ env: string; componentName: string }>
|