viza 1.8.2 → 1.8.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/src/cli/options.js +1 -2
- package/dist/src/commands/infra/{command-hub → deploy/command-hub}/command-hub.js +4 -5
- package/dist/src/commands/infra/{command-hub → deploy/command-hub}/register.js +2 -5
- package/dist/src/commands/infra/deploy/register.js +12 -0
- package/dist/src/commands/infra/register.js +6 -2
- package/dist/src/context/hubIntent.js +8 -4
- package/dist/src/types/runner.js +1 -0
- package/package.json +1 -1
package/dist/src/cli/options.js
CHANGED
|
@@ -2,6 +2,5 @@ export function registerGlobalOptions(program) {
|
|
|
2
2
|
program
|
|
3
3
|
.option("--status", "Show status only (no execution)")
|
|
4
4
|
.option("--remove-log", "Remove execution logs after completion", false)
|
|
5
|
-
.option("--self-hosted", "Use self-hosted runner (viza-builder)", false)
|
|
6
|
-
.option("--cloud-runner", "Use cloud managed runner (GitHub-hosted)", false);
|
|
5
|
+
.option("--self-hosted", "Use self-hosted runner (viza-builder)", false);
|
|
7
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolveEnv } from "
|
|
2
|
-
import { resolveHubIntent } from "
|
|
3
|
-
import { dispatchIntentAndWait } from "
|
|
1
|
+
import { resolveEnv } from "../../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../../context/hubIntent.js";
|
|
3
|
+
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
4
|
/**
|
|
5
5
|
* Target teams for `viza login aws`.
|
|
6
6
|
* This is a CLI-only UX constraint for fail-fast validation.
|
|
@@ -29,8 +29,7 @@ const TARGET_TEAMS = {
|
|
|
29
29
|
export async function deployCommandHubCommand(options) {
|
|
30
30
|
// 1) Resolve environment
|
|
31
31
|
const env = resolveEnv(options);
|
|
32
|
-
const
|
|
33
|
-
const intent = resolveHubIntent(cloudRunner);
|
|
32
|
+
const intent = resolveHubIntent(options.runner);
|
|
34
33
|
// Resolve allowed teams
|
|
35
34
|
// - Dispatch mode: restrict by targetEnv
|
|
36
35
|
// - Status mode: allow union of all env teams (read-only query)
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { deployCommandHubCommand } from "./command-hub.js";
|
|
2
|
-
import { getResolvedOptions } from "
|
|
2
|
+
import { getResolvedOptions } from "../../../../cli/resolveOptions.js";
|
|
3
3
|
/**
|
|
4
4
|
* Register:
|
|
5
5
|
* viza infra deploy command-hub
|
|
6
6
|
*/
|
|
7
7
|
export function registerCommandHubDeployCommand(program) {
|
|
8
8
|
program
|
|
9
|
-
.command("infra")
|
|
10
|
-
.description("Infrastructure commands")
|
|
11
|
-
.command("deploy")
|
|
12
|
-
.description("Deploy infrastructure components")
|
|
13
9
|
.command("command-hub")
|
|
14
10
|
.description("Deploy command hub worker to Cloudflare")
|
|
15
11
|
.option("--prod", "Use production environment")
|
|
16
12
|
.option("--dev", "Use development environment")
|
|
13
|
+
.option("--runner <type>", "Execution runner (hub | deployer | backer)", "hub")
|
|
17
14
|
.action(async (_opts, command) => {
|
|
18
15
|
const fullOpts = getResolvedOptions(command);
|
|
19
16
|
await deployCommandHubCommand(fullOpts);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { registerCommandHubDeployCommand } from "./command-hub/register.js";
|
|
2
|
+
/**
|
|
3
|
+
* Register:
|
|
4
|
+
* viza infra deploy command-hub
|
|
5
|
+
*/
|
|
6
|
+
export function registerDeployCommand(program) {
|
|
7
|
+
const deploy = program
|
|
8
|
+
.command("deploy")
|
|
9
|
+
.description("Deploy infrastructure components");
|
|
10
|
+
// Register subcommands under "infra"
|
|
11
|
+
registerCommandHubDeployCommand(deploy);
|
|
12
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { registerDeployCommand } from "./deploy/register.js";
|
|
2
2
|
export function registerInfraCommand(program) {
|
|
3
|
-
|
|
3
|
+
const infra = program
|
|
4
|
+
.command("infra")
|
|
5
|
+
.description("Infrastructure commands");
|
|
6
|
+
// Register subcommands under "infra"
|
|
7
|
+
registerDeployCommand(infra);
|
|
4
8
|
}
|
|
@@ -16,9 +16,13 @@ export const RESOURCE_BACKER_INTENT_BY_ENV = "backer";
|
|
|
16
16
|
* Single intent for both dev and prod (env derived at gateway)
|
|
17
17
|
*/
|
|
18
18
|
export const RUNTIME_HUB_INTENT = "hub-worker";
|
|
19
|
-
export function resolveHubIntent(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
export function resolveHubIntent(runner) {
|
|
20
|
+
switch (runner) {
|
|
21
|
+
case "backer":
|
|
22
|
+
return RESOURCE_BACKER_INTENT_BY_ENV;
|
|
23
|
+
case "deployer":
|
|
24
|
+
return RESOURCE_DEPLOYER_INTENT_BY_ENV;
|
|
25
|
+
default:
|
|
26
|
+
return RESOURCE_HUB_INTENT_BY_ENV;
|
|
22
27
|
}
|
|
23
|
-
return RESOURCE_HUB_INTENT_BY_ENV;
|
|
24
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const RUNNER_TYPES = ["hub", "deployer", "backer"];
|