@catladder/cli 3.17.1 → 3.18.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.
- package/dist/bundles/cli/index.js +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/index.js +6 -3
- package/dist/cli/src/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.d.ts +2 -0
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.js +17 -0
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.js.map +1 -0
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +11 -15
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/cli/commands/project/setup/index.ts +8 -3
- package/src/apps/cli/commands/project/setup/logSection.ts +22 -0
- package/src/apps/cli/commands/project/setup/setupContext.ts +14 -19
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { setupAccessTokens } from "./setupAccessTokens";
|
|
|
4
4
|
import { setupContext } from "./setupContext";
|
|
5
5
|
import { setupTopic } from "./setupTopic";
|
|
6
6
|
import { setupAgents } from "./setupAgents";
|
|
7
|
+
import { logSection } from "./logSection";
|
|
7
8
|
|
|
8
9
|
export const setupProject = async (
|
|
9
10
|
instance: CommandInstance,
|
|
@@ -14,12 +15,16 @@ export const setupProject = async (
|
|
|
14
15
|
allContext.forEach((context) => {
|
|
15
16
|
instance.log(` - ${context.name}:${context.env}`);
|
|
16
17
|
});
|
|
18
|
+
|
|
19
|
+
await logSection(instance, "base setup", async () => {
|
|
20
|
+
await setupAccessTokens(instance);
|
|
21
|
+
await setupTopic(instance);
|
|
22
|
+
await setupAgents(instance);
|
|
23
|
+
});
|
|
17
24
|
for (const context of allContext) {
|
|
18
25
|
await setupContext(instance, context);
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
await setupTopic(instance);
|
|
22
|
-
await setupAgents(instance);
|
|
27
|
+
|
|
23
28
|
instance.log("");
|
|
24
29
|
instance.log("gitlab is ready! 🥂");
|
|
25
30
|
instance.log("\n");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CommandInstance } from "vorpal";
|
|
2
|
+
|
|
3
|
+
export const logSection = async (
|
|
4
|
+
instance: CommandInstance,
|
|
5
|
+
title: string,
|
|
6
|
+
work: () => Promise<void>,
|
|
7
|
+
) => {
|
|
8
|
+
instance.log("");
|
|
9
|
+
instance.log(
|
|
10
|
+
"==================================================================================",
|
|
11
|
+
);
|
|
12
|
+
instance.log("🐱 🔧 " + title + "...");
|
|
13
|
+
instance.log("");
|
|
14
|
+
await work();
|
|
15
|
+
instance.log("");
|
|
16
|
+
instance.log("✅ " + title + " done!");
|
|
17
|
+
instance.log("");
|
|
18
|
+
instance.log(
|
|
19
|
+
"==================================================================================",
|
|
20
|
+
);
|
|
21
|
+
instance.log("");
|
|
22
|
+
};
|
|
@@ -4,29 +4,24 @@ import type { CommandInstance } from "vorpal";
|
|
|
4
4
|
import { setupCloudRun } from "./setupCloudRun";
|
|
5
5
|
|
|
6
6
|
import { setupKubernetes } from "./setupKubernetes";
|
|
7
|
+
import { logSection } from "./logSection";
|
|
7
8
|
|
|
8
9
|
export const setupContext = async (
|
|
9
10
|
instance: CommandInstance,
|
|
10
11
|
context: ComponentContext,
|
|
11
12
|
) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (isOfDeployType(context.deploy?.config, "google-cloudrun")) {
|
|
20
|
-
await setupCloudRun(instance, context);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const deployConfig = context.deploy?.config;
|
|
24
|
-
if (isOfDeployType(deployConfig, "kubernetes")) {
|
|
25
|
-
await setupKubernetes(instance, context);
|
|
26
|
-
}
|
|
13
|
+
await logSection(
|
|
14
|
+
instance,
|
|
15
|
+
"setting up " + context.env + ":" + context.name,
|
|
16
|
+
async () => {
|
|
17
|
+
if (isOfDeployType(context.deploy?.config, "google-cloudrun")) {
|
|
18
|
+
await setupCloudRun(instance, context);
|
|
19
|
+
}
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
const deployConfig = context.deploy?.config;
|
|
22
|
+
if (isOfDeployType(deployConfig, "kubernetes")) {
|
|
23
|
+
await setupKubernetes(instance, context);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
);
|
|
32
27
|
};
|