@catladder/cli 1.146.1 → 1.147.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.
Files changed (185) hide show
  1. package/dist/bundles/catenv/index.js +1 -1
  2. package/dist/bundles/cli/index.js +1 -1
  3. package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +22 -19
  4. package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
  5. package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js +10 -9
  6. package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js.map +1 -1
  7. package/dist/cli/src/apps/cli/commands/project/commandPortForward.js +18 -16
  8. package/dist/cli/src/apps/cli/commands/project/commandPortForward.js.map +1 -1
  9. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.d.ts +2 -2
  10. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js +10 -9
  11. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
  12. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
  13. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +9 -8
  14. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
  15. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.d.ts +2 -2
  16. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +23 -22
  17. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
  18. package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js +10 -9
  19. package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js.map +1 -1
  20. package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.d.ts +2 -2
  21. package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
  22. package/dist/cli/src/config/getProjectConfig.d.ts +2 -2
  23. package/dist/cli/src/config/getProjectConfig.js +1 -1
  24. package/dist/cli/src/config/getProjectConfig.js.map +1 -1
  25. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.d.ts +2 -2
  26. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js +6 -5
  27. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -1
  28. package/dist/cli/src/gcloud/serviceAccounts.d.ts +2 -2
  29. package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
  30. package/dist/cli/src/kubernetes/openKubernetesDashboards.d.ts +3 -3
  31. package/dist/cli/src/kubernetes/openKubernetesDashboards.js +10 -8
  32. package/dist/cli/src/kubernetes/openKubernetesDashboards.js.map +1 -1
  33. package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +2 -2
  34. package/dist/pipeline/src/build/base/createAppBuildJob.js +8 -6
  35. package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
  36. package/dist/pipeline/src/build/base/index.d.ts +2 -2
  37. package/dist/pipeline/src/build/base/index.js.map +1 -1
  38. package/dist/pipeline/src/build/base/writeBuildInfo.d.ts +2 -2
  39. package/dist/pipeline/src/build/base/writeBuildInfo.js +1 -1
  40. package/dist/pipeline/src/build/base/writeBuildInfo.js.map +1 -1
  41. package/dist/pipeline/src/build/base/writeDotEnv.d.ts +2 -2
  42. package/dist/pipeline/src/build/base/writeDotEnv.js +1 -1
  43. package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
  44. package/dist/pipeline/src/build/custom/buildJob.d.ts +2 -2
  45. package/dist/pipeline/src/build/custom/buildJob.js +6 -6
  46. package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
  47. package/dist/pipeline/src/build/custom/index.d.ts +2 -2
  48. package/dist/pipeline/src/build/custom/index.js.map +1 -1
  49. package/dist/pipeline/src/build/custom/testJob.d.ts +2 -2
  50. package/dist/pipeline/src/build/custom/testJob.js +5 -5
  51. package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
  52. package/dist/pipeline/src/build/docker.d.ts +32 -11
  53. package/dist/pipeline/src/build/docker.js +50 -17
  54. package/dist/pipeline/src/build/docker.js.map +1 -1
  55. package/dist/pipeline/src/build/index.d.ts +2 -2
  56. package/dist/pipeline/src/build/node/buildJob.d.ts +2 -2
  57. package/dist/pipeline/src/build/node/buildJob.js +11 -11
  58. package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
  59. package/dist/pipeline/src/build/node/cache.d.ts +5 -5
  60. package/dist/pipeline/src/build/node/cache.js +5 -5
  61. package/dist/pipeline/src/build/node/cache.js.map +1 -1
  62. package/dist/pipeline/src/build/node/index.d.ts +4 -4
  63. package/dist/pipeline/src/build/node/index.js.map +1 -1
  64. package/dist/pipeline/src/build/node/meteor.d.ts +2 -2
  65. package/dist/pipeline/src/build/node/meteor.js +10 -10
  66. package/dist/pipeline/src/build/node/meteor.js.map +1 -1
  67. package/dist/pipeline/src/build/node/testJob.d.ts +2 -2
  68. package/dist/pipeline/src/build/node/testJob.js +12 -12
  69. package/dist/pipeline/src/build/node/testJob.js.map +1 -1
  70. package/dist/pipeline/src/build/node/yarn.d.ts +4 -4
  71. package/dist/pipeline/src/build/node/yarn.js +1 -3
  72. package/dist/pipeline/src/build/node/yarn.js.map +1 -1
  73. package/dist/pipeline/src/build/rails/build.d.ts +2 -2
  74. package/dist/pipeline/src/build/rails/build.js +3 -3
  75. package/dist/pipeline/src/build/rails/build.js.map +1 -1
  76. package/dist/pipeline/src/build/rails/index.d.ts +2 -2
  77. package/dist/pipeline/src/build/rails/index.js.map +1 -1
  78. package/dist/pipeline/src/build/rails/test.d.ts +2 -2
  79. package/dist/pipeline/src/build/rails/test.js +4 -4
  80. package/dist/pipeline/src/build/rails/test.js.map +1 -1
  81. package/dist/pipeline/src/build/sbom.d.ts +2 -2
  82. package/dist/pipeline/src/build/sbom.js +3 -3
  83. package/dist/pipeline/src/build/sbom.js.map +1 -1
  84. package/dist/pipeline/src/build/types.d.ts +33 -25
  85. package/dist/pipeline/src/build/types.js.map +1 -1
  86. package/dist/pipeline/src/context/getEnvironment.d.ts +2 -2
  87. package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
  88. package/dist/pipeline/src/context/getEnvironmentContext.d.ts +2 -2
  89. package/dist/pipeline/src/context/getEnvironmentContext.js.map +1 -1
  90. package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +4 -4
  91. package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
  92. package/dist/pipeline/src/context/getLabels.d.ts +2 -2
  93. package/dist/pipeline/src/context/getLabels.js +1 -1
  94. package/dist/pipeline/src/context/getLabels.js.map +1 -1
  95. package/dist/pipeline/src/context/index.d.ts +7 -3
  96. package/dist/pipeline/src/context/index.js +46 -15
  97. package/dist/pipeline/src/context/index.js.map +1 -1
  98. package/dist/pipeline/src/deploy/base/deploy.d.ts +2 -2
  99. package/dist/pipeline/src/deploy/base/deploy.js +10 -17
  100. package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
  101. package/dist/pipeline/src/deploy/base/index.d.ts +2 -2
  102. package/dist/pipeline/src/deploy/base/index.js.map +1 -1
  103. package/dist/pipeline/src/deploy/base/rollback.d.ts +2 -2
  104. package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
  105. package/dist/pipeline/src/deploy/base/stop.d.ts +2 -2
  106. package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
  107. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.d.ts +7 -7
  108. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js +8 -9
  109. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js.map +1 -1
  110. package/dist/pipeline/src/deploy/cloudRun/cleanup.d.ts +2 -2
  111. package/dist/pipeline/src/deploy/cloudRun/cleanup.js.map +1 -1
  112. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.d.ts +2 -2
  113. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js +4 -5
  114. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js.map +1 -1
  115. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +6 -6
  116. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
  117. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.d.ts +3 -3
  118. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js +1 -1
  119. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
  120. package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js +2 -1
  121. package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js.map +1 -1
  122. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +2 -2
  123. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
  124. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +2 -2
  125. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
  126. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.d.ts +2 -2
  127. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js +2 -4
  128. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js.map +1 -1
  129. package/dist/pipeline/src/deploy/cloudRun/utils/database.d.ts +3 -3
  130. package/dist/pipeline/src/deploy/cloudRun/utils/database.js.map +1 -1
  131. package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -2
  132. package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js.map +1 -1
  133. package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +2 -2
  134. package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js.map +1 -1
  135. package/dist/pipeline/src/deploy/custom/deployJob.d.ts +2 -2
  136. package/dist/pipeline/src/deploy/custom/deployJob.js +9 -10
  137. package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
  138. package/dist/pipeline/src/deploy/dockerTag/deployJob.d.ts +2 -2
  139. package/dist/pipeline/src/deploy/dockerTag/deployJob.js +3 -5
  140. package/dist/pipeline/src/deploy/dockerTag/deployJob.js.map +1 -1
  141. package/dist/pipeline/src/deploy/index.d.ts +2 -2
  142. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.d.ts +3 -3
  143. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +11 -9
  144. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
  145. package/dist/pipeline/src/deploy/kubernetes/deployJob.d.ts +2 -2
  146. package/dist/pipeline/src/deploy/kubernetes/deployJob.js +3 -6
  147. package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
  148. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.d.ts +2 -2
  149. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js +2 -1
  150. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js.map +1 -1
  151. package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +2 -2
  152. package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +6 -6
  153. package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
  154. package/dist/pipeline/src/deploy/kubernetes/mongodb.d.ts +2 -2
  155. package/dist/pipeline/src/deploy/kubernetes/mongodb.js +11 -11
  156. package/dist/pipeline/src/deploy/kubernetes/mongodb.js.map +1 -1
  157. package/dist/pipeline/src/deploy/sbom.d.ts +4 -4
  158. package/dist/pipeline/src/deploy/sbom.js +1 -2
  159. package/dist/pipeline/src/deploy/sbom.js.map +1 -1
  160. package/dist/pipeline/src/deploy/types/index.d.ts +1 -1
  161. package/dist/pipeline/src/deploy/types/index.js +1 -1
  162. package/dist/pipeline/src/deploy/types/index.js.map +1 -1
  163. package/dist/pipeline/src/deploy/utils.d.ts +2 -2
  164. package/dist/pipeline/src/deploy/utils.js +2 -1
  165. package/dist/pipeline/src/deploy/utils.js.map +1 -1
  166. package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +2 -2
  167. package/dist/pipeline/src/pipeline/createJobsForComponent.js +7 -9
  168. package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
  169. package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
  170. package/dist/pipeline/src/types/config.d.ts +2 -2
  171. package/dist/pipeline/src/types/context.d.ts +28 -2
  172. package/dist/tsconfig.tsbuildinfo +1 -1
  173. package/package.json +1 -1
  174. package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +9 -12
  175. package/src/apps/cli/commands/project/commandOpenDashboard.ts +2 -2
  176. package/src/apps/cli/commands/project/commandPortForward.ts +9 -6
  177. package/src/apps/cli/commands/project/setup/setupCloudRun.ts +4 -4
  178. package/src/apps/cli/commands/project/setup/setupContext.ts +4 -4
  179. package/src/apps/cli/commands/project/setup/setupKubernetes.ts +3 -3
  180. package/src/apps/cli/commands/project/utils/ensureCluster.ts +2 -4
  181. package/src/apps/cli/commands/project/utils/ensureNamespace.ts +2 -2
  182. package/src/config/getProjectConfig.ts +2 -2
  183. package/src/gcloud/cloudRun/openCloudRunDashboards.ts +4 -4
  184. package/src/gcloud/serviceAccounts.ts +3 -3
  185. package/src/kubernetes/openKubernetesDashboards.ts +5 -5
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "1.146.1",
55
+ "version": "1.147.0",
56
56
  "scripts": {
57
57
  "lint": "eslint \"src/**/*.ts\"",
58
58
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import {
3
3
  createKubernetesCloudsqlBaseValues,
4
4
  isOfDeployType,
@@ -38,11 +38,9 @@ export default async (vorpal: Vorpal) =>
38
38
  "⚠️ connection string does not include mr information on review environments",
39
39
  );
40
40
  }
41
- if (isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
41
+ if (isOfDeployType(context.deploy?.config, "kubernetes")) {
42
42
  proxyInfo = await getProxyInfoForKubernetes(this, context);
43
- } else if (
44
- isOfDeployType(context.componentConfig.deploy, "google-cloudrun")
45
- ) {
43
+ } else if (isOfDeployType(context.deploy?.config, "google-cloudrun")) {
46
44
  proxyInfo = await getProxyInfoForCloudRun(this, context);
47
45
  } else {
48
46
  throw new Error("unsupported environment");
@@ -79,9 +77,9 @@ export default async (vorpal: Vorpal) =>
79
77
 
80
78
  const getProxyInfoForKubernetes = async (
81
79
  vorpal: CommandInstance,
82
- context: Context,
80
+ context: ComponentContext,
83
81
  ): Promise<ProxyInfo> => {
84
- if (!isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
82
+ if (!isOfDeployType(context.deploy?.config, "kubernetes")) {
85
83
  throw new Error("unsupported");
86
84
  }
87
85
 
@@ -109,11 +107,11 @@ const getProxyInfoForKubernetes = async (
109
107
 
110
108
  const getProxyInfoForCloudRun = async (
111
109
  vorpal: CommandInstance,
112
- context: Context,
110
+ context: ComponentContext,
113
111
  ): Promise<ProxyInfo> => {
114
112
  if (
115
- !isOfDeployType(context.componentConfig.deploy, "google-cloudrun") ||
116
- !context.componentConfig.deploy.cloudSql
113
+ !isOfDeployType(context.deploy?.config, "google-cloudrun") ||
114
+ !context.deploy?.config.cloudSql
117
115
  ) {
118
116
  throw new Error("unsupported");
119
117
  }
@@ -130,8 +128,7 @@ const getProxyInfoForCloudRun = async (
130
128
  const DB_NAME = context.environment.envVars.DB_NAME.toString();
131
129
 
132
130
  return {
133
- instanceName:
134
- context.componentConfig.deploy.cloudSql.instanceConnectionName,
131
+ instanceName: context.deploy?.config.cloudSql.instanceConnectionName,
135
132
  DB_PASSWORD,
136
133
  DB_NAME,
137
134
  DB_USER,
@@ -19,10 +19,10 @@ export default async (vorpal: Vorpal) =>
19
19
  .action(async function ({ envComponent }) {
20
20
  const { env, componentName } = parseChoice(envComponent);
21
21
  const context = await getPipelineContextByChoice(env, componentName);
22
- if (isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
22
+ if (isOfDeployType(context.deploy?.config, "kubernetes")) {
23
23
  await openGoogleCloudKubernetesDashboard(this, context);
24
24
  }
25
- if (isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
25
+ if (isOfDeployType(context.deploy?.config, "google-cloudrun")) {
26
26
  await openGoogleCloudRunDashboard(this, context);
27
27
  }
28
28
  });
@@ -8,7 +8,7 @@ import ensureCluster from "./utils/ensureCluster";
8
8
  import type { CommandInstance } from "vorpal";
9
9
  import { parseChoice } from "../../../../config/parseChoice";
10
10
  import { getPipelineContextByChoice } from "../../../../config/getProjectConfig";
11
- import type { Context } from "@catladder/pipeline";
11
+ import type { ComponentContext } from "@catladder/pipeline";
12
12
  import { isOfDeployType } from "@catladder/pipeline";
13
13
  import { startPortForwardCommand } from "../../../../utils/portForwards";
14
14
  import open from "open";
@@ -44,8 +44,11 @@ const kubePortForward = async (cmd: CommandInstance, envComponent: string) => {
44
44
  return startKubePortForward(podName, localPort, remotePort, namespace);
45
45
  };
46
46
 
47
- const cloudRunPortForward = async (cmd: CommandInstance, context: Context) => {
48
- if (!isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
47
+ const cloudRunPortForward = async (
48
+ cmd: CommandInstance,
49
+ context: ComponentContext,
50
+ ) => {
51
+ if (!isOfDeployType(context.deploy?.config, "google-cloudrun")) {
49
52
  throw new Error("not cloud run");
50
53
  }
51
54
 
@@ -64,7 +67,7 @@ const cloudRunPortForward = async (cmd: CommandInstance, context: Context) => {
64
67
  .replace("-review-", "-review-mr" + mr + "-");
65
68
  }
66
69
 
67
- const { projectId, region } = context.componentConfig.deploy;
70
+ const { projectId, region } = context.deploy.config;
68
71
 
69
72
  const command = `gcloud beta run services proxy ${serviceName} --project ${projectId} --region ${region}`;
70
73
 
@@ -79,10 +82,10 @@ export default async (vorpal: Vorpal) =>
79
82
  const { env, componentName } = parseChoice(envComponent);
80
83
  const context = await getPipelineContextByChoice(env, componentName);
81
84
 
82
- if (isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
85
+ if (isOfDeployType(context.deploy?.config, "kubernetes")) {
83
86
  await kubePortForward(this, envComponent);
84
87
  }
85
- if (isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
88
+ if (isOfDeployType(context.deploy?.config, "google-cloudrun")) {
86
89
  await cloudRunPortForward(this, context);
87
90
  }
88
91
  });
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import {
3
3
  GCLOUD_DEPLOY_CREDENTIALS_KEY,
4
4
  GCLOUD_RUN_CANONICAL_HOST_SUFFIX,
@@ -14,13 +14,13 @@ import { upsertAllVariables } from "../../../../../utils/gitlab";
14
14
 
15
15
  export const setupCloudRun = async (
16
16
  instance: CommandInstance,
17
- context: Context,
17
+ context: ComponentContext,
18
18
  ) => {
19
- if (!isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
19
+ if (!isOfDeployType(context.deploy?.config, "google-cloudrun")) {
20
20
  throw new Error("deploy config is not of type 'google-cloudrun'");
21
21
  }
22
22
 
23
- const config = context.componentConfig.deploy;
23
+ const config = context.deploy?.config;
24
24
 
25
25
  // enable services
26
26
 
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { isOfDeployType } from "@catladder/pipeline";
3
3
  import type { CommandInstance } from "vorpal";
4
4
  import { setupCloudRun } from "./setupCloudRun";
@@ -7,7 +7,7 @@ import { setupKubernetes } from "./setupKubernetes";
7
7
 
8
8
  export const setupContext = async (
9
9
  instance: CommandInstance,
10
- context: Context,
10
+ context: ComponentContext,
11
11
  ) => {
12
12
  instance.log("");
13
13
  instance.log(
@@ -22,11 +22,11 @@ export const setupContext = async (
22
22
  "...",
23
23
  );
24
24
  instance.log("");
25
- if (isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
25
+ if (isOfDeployType(context.deploy?.config, "google-cloudrun")) {
26
26
  await setupCloudRun(instance, context);
27
27
  }
28
28
 
29
- const deployConfig = context.componentConfig.deploy;
29
+ const deployConfig = context.deploy?.config;
30
30
  if (isOfDeployType(deployConfig, "kubernetes")) {
31
31
  await setupKubernetes(instance, context);
32
32
  }
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import {
3
3
  getFullKubernetesClusterName,
4
4
  isOfDeployType,
@@ -15,9 +15,9 @@ import ensureNamespace from "../utils/ensureNamespace";
15
15
 
16
16
  export const setupKubernetes = async (
17
17
  instance: CommandInstance,
18
- context: Context,
18
+ context: ComponentContext,
19
19
  ) => {
20
- const deployConfig = context.componentConfig.deploy;
20
+ const deployConfig = context.deploy?.config;
21
21
  if (!isOfDeployType(deployConfig, "kubernetes")) {
22
22
  throw new Error("cannot run setupKubernetes on non-kubernetes deployments");
23
23
  }
@@ -13,12 +13,10 @@ import {
13
13
  export default async function (envComponent: string) {
14
14
  const { env, componentName } = parseChoice(envComponent);
15
15
  const context = await getPipelineContextByChoice(env, componentName);
16
- if (!isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
16
+ if (!isOfDeployType(context.deploy?.config, "kubernetes")) {
17
17
  throw new Error("can't ensure cluster for non-kubernetes deployments");
18
18
  }
19
- const cluster = getFullKubernetesClusterName(
20
- context.componentConfig.deploy.cluster,
21
- );
19
+ const cluster = getFullKubernetesClusterName(context.deploy?.config.cluster);
22
20
  const connectedClusterName = await getCurrentConnectedClusterName();
23
21
 
24
22
  if (cluster !== connectedClusterName) {
@@ -1,10 +1,10 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { getKubernetesNamespace } from "@catladder/pipeline";
3
3
  import type { V1ObjectMeta } from "@kubernetes/client-node";
4
4
  import { V1Namespace } from "@kubernetes/client-node";
5
5
  import { getk8sApi } from "../../../../../k8sApi";
6
6
 
7
- export default async function (context: Context) {
7
+ export default async function (context: ComponentContext) {
8
8
  const namespace = getKubernetesNamespace(
9
9
  context.fullConfig,
10
10
  context.environment.shortName,
@@ -3,7 +3,7 @@ import {
3
3
  readConfigSync,
4
4
  getAllEnvs,
5
5
  getEnvironment as _getEnvironment,
6
- createContext,
6
+ createComponentContext,
7
7
  getSecretVarName,
8
8
  } from "@catladder/pipeline";
9
9
 
@@ -53,7 +53,7 @@ export const getPipelineContextByChoice = async (
53
53
  componentName: string,
54
54
  ) => {
55
55
  const config = await getProjectConfig();
56
- return await createContext({
56
+ return await createComponentContext({
57
57
  config,
58
58
  componentName,
59
59
  env,
@@ -1,17 +1,17 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { isOfDeployType } from "@catladder/pipeline";
3
3
  import type { CommandInstance } from "vorpal";
4
4
  import { openGoogleCloudDashboard } from "../openDashboard";
5
5
 
6
6
  export const openGoogleCloudRunDashboard = async (
7
7
  instance: CommandInstance,
8
- context: Context,
8
+ context: ComponentContext,
9
9
  ) => {
10
- if (!isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
10
+ if (!isOfDeployType(context.deploy?.config, "google-cloudrun")) {
11
11
  throw new Error("deploy type is not google-cloudrun ");
12
12
  }
13
13
  const { fullName } = context.environment;
14
- const { region, projectId } = context.componentConfig.deploy;
14
+ const { region, projectId } = context.deploy.config;
15
15
  await openGoogleCloudDashboard(
16
16
  instance,
17
17
  `run/detail/${region}/${fullName}/metrics`,
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
 
3
3
  import { exec } from "child-process-promise";
4
4
  import { createHmac } from "crypto";
@@ -22,7 +22,7 @@ type ServiceAccount = {
22
22
  description: string;
23
23
  };
24
24
  const upsertGcloudServiceAccount = async (
25
- context: Context,
25
+ context: ComponentContext,
26
26
  account: ServiceAccount,
27
27
  ): Promise<string> => {
28
28
  const { projectId, name, displayName, roles, description } = account;
@@ -76,7 +76,7 @@ const upsertGcloudServiceAccount = async (
76
76
 
77
77
  export const upsertGcloudServiceAccountAndSaveSecret = async (
78
78
  instance: CommandInstance,
79
- context: Context,
79
+ context: ComponentContext,
80
80
  account: ServiceAccount,
81
81
  secretName: string,
82
82
  ): Promise<void> => {
@@ -1,13 +1,13 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { isOfDeployType } from "@catladder/pipeline";
3
3
  import type { CommandInstance } from "vorpal";
4
4
  import { openGoogleCloudDashboard } from "../gcloud/openDashboard";
5
5
 
6
6
  export const openGoogleCloudLogs = async (
7
7
  instance: CommandInstance,
8
- context: Context,
8
+ context: ComponentContext,
9
9
  ) => {
10
- const deployConfig = context.componentConfig.deploy;
10
+ const deployConfig = context.deploy?.config;
11
11
  if (!isOfDeployType(deployConfig, "kubernetes")) {
12
12
  throw new Error("context is not of type kubernetes");
13
13
  }
@@ -31,9 +31,9 @@ export const openGoogleCloudLogs = async (
31
31
 
32
32
  export const openGoogleCloudKubernetesDashboard = async (
33
33
  instance: CommandInstance,
34
- context: Context,
34
+ context: ComponentContext,
35
35
  ) => {
36
- const deployConfig = context.componentConfig.deploy;
36
+ const deployConfig = context.deploy?.config;
37
37
  if (!isOfDeployType(deployConfig, "kubernetes")) {
38
38
  throw new Error("context is not of type kubernetes");
39
39
  }