hereya-cli 0.17.2 → 0.19.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/README.md +24 -24
- package/bin/dev.js +1 -1
- package/dist/backend/common.d.ts +4 -4
- package/dist/backend/local.js +10 -2
- package/dist/commands/add/index.d.ts +4 -4
- package/dist/commands/add/index.js +12 -21
- package/dist/commands/bootstrap/index.d.ts +2 -2
- package/dist/commands/deploy/index.d.ts +3 -3
- package/dist/commands/deploy/index.js +45 -36
- package/dist/commands/down/index.d.ts +4 -4
- package/dist/commands/down/index.js +16 -28
- package/dist/commands/env/index.d.ts +4 -4
- package/dist/commands/env/index.js +6 -2
- package/dist/commands/env/set/index.d.ts +4 -4
- package/dist/commands/init/index.d.ts +3 -3
- package/dist/commands/remove/index.d.ts +3 -3
- package/dist/commands/remove/index.js +9 -19
- package/dist/commands/run/index.d.ts +3 -3
- package/dist/commands/run/index.js +5 -1
- package/dist/commands/unbootstrap/index.d.ts +2 -2
- package/dist/commands/undeploy/index.d.ts +3 -3
- package/dist/commands/undeploy/index.js +21 -24
- package/dist/commands/up/index.d.ts +4 -4
- package/dist/commands/up/index.js +24 -32
- package/dist/commands/workspace/create/index.d.ts +1 -1
- package/dist/commands/workspace/delete/index.d.ts +1 -1
- package/dist/commands/workspace/env/index.d.ts +3 -3
- package/dist/commands/workspace/env/set/index.d.ts +5 -5
- package/dist/commands/workspace/env/unset/index.d.ts +2 -2
- package/dist/commands/workspace/install/index.d.ts +5 -5
- package/dist/commands/workspace/install/index.js +8 -3
- package/dist/commands/workspace/uninstall/index.d.ts +5 -5
- package/dist/commands/workspace/uninstall/index.js +8 -3
- package/dist/executor/index.d.ts +11 -0
- package/dist/executor/index.js +8 -0
- package/dist/executor/interface.d.ts +41 -0
- package/dist/executor/interface.js +1 -0
- package/dist/executor/local.d.ts +7 -0
- package/dist/executor/local.js +56 -0
- package/dist/iac/index.js +5 -5
- package/dist/iac/terraform.js +1 -1
- package/dist/infrastructure/common.d.ts +2 -2
- package/dist/infrastructure/index.d.ts +3 -3
- package/dist/infrastructure/index.js +6 -6
- package/dist/infrastructure/local.js +1 -1
- package/dist/lib/env/index.d.ts +4 -0
- package/dist/lib/env/index.js +11 -3
- package/dist/lib/env-utils.d.ts +0 -7
- package/dist/lib/env-utils.js +0 -18
- package/dist/lib/log.js +1 -1
- package/dist/lib/package/common.d.ts +1 -0
- package/dist/lib/package/github.d.ts +2 -0
- package/dist/lib/package/github.js +5 -1
- package/dist/lib/package/index.d.ts +4 -1
- package/dist/lib/package/index.js +28 -10
- package/dist/lib/package/local.d.ts +5 -0
- package/dist/lib/package/local.js +45 -0
- package/dist/lib/shell.d.ts +1 -3
- package/dist/lib/yaml-utils.js +1 -1
- package/oclif.manifest.json +40 -40
- package/package.json +37 -37
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Env extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
chdir: import("@oclif/core/
|
|
10
|
-
list: import("@oclif/core/
|
|
11
|
-
workspace: import("@oclif/core/
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
list: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
3
|
-
import { getEnvManager } from '../../lib/env/index.js';
|
|
4
3
|
import { logEnv } from '../../lib/env-utils.js';
|
|
4
|
+
import { getEnvManager } from '../../lib/env/index.js';
|
|
5
5
|
export default class Env extends Command {
|
|
6
6
|
static args = {
|
|
7
7
|
name: Args.string({ description: 'name of the env to display', required: false }),
|
|
@@ -47,10 +47,14 @@ export default class Env extends Command {
|
|
|
47
47
|
this.error('you must specify a workspace to print the env vars for');
|
|
48
48
|
}
|
|
49
49
|
const envManager = getEnvManager();
|
|
50
|
-
const
|
|
50
|
+
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
51
51
|
projectRootDir,
|
|
52
52
|
workspace,
|
|
53
53
|
});
|
|
54
|
+
if (!getProjectEnvOutput.success) {
|
|
55
|
+
this.error(getProjectEnvOutput.reason);
|
|
56
|
+
}
|
|
57
|
+
const { env } = getProjectEnvOutput;
|
|
54
58
|
if (args.name) {
|
|
55
59
|
if (env[args.name] === undefined) {
|
|
56
60
|
this.error(`Env var ${args.name} not found`);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class EnvSet extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
chdir: import("@oclif/core/
|
|
10
|
-
value: import("@oclif/core/
|
|
11
|
-
workspace: import("@oclif/core/
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
value: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Init extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
project: import("@oclif/core/
|
|
4
|
+
project: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
chdir: import("@oclif/core/
|
|
10
|
-
workspace: import("@oclif/core/
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Remove extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
package: import("@oclif/core/
|
|
4
|
+
package: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
chdir: import("@oclif/core/
|
|
10
|
-
debug: import("@oclif/core/
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { Listr,
|
|
2
|
+
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
3
|
import { getBackend } from '../../backend/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getExecutor } from '../../executor/index.js';
|
|
5
5
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
6
6
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
7
7
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
@@ -55,21 +55,6 @@ export default class Remove extends Command {
|
|
|
55
55
|
},
|
|
56
56
|
title: 'Loading project config',
|
|
57
57
|
},
|
|
58
|
-
{
|
|
59
|
-
async task(ctx) {
|
|
60
|
-
const backend = await getBackend();
|
|
61
|
-
const getWorkspaceEnvOutput = await backend.getWorkspaceEnv({
|
|
62
|
-
project: ctx.configOutput.config.project,
|
|
63
|
-
workspace: ctx.configOutput.config.workspace,
|
|
64
|
-
});
|
|
65
|
-
if (!getWorkspaceEnvOutput.success) {
|
|
66
|
-
throw new Error(getWorkspaceEnvOutput.reason);
|
|
67
|
-
}
|
|
68
|
-
ctx.workspaceEnvOutput = getWorkspaceEnvOutput;
|
|
69
|
-
await delay(500);
|
|
70
|
-
},
|
|
71
|
-
title: 'Loading workspace environment variables',
|
|
72
|
-
},
|
|
73
58
|
{
|
|
74
59
|
async task(ctx) {
|
|
75
60
|
const parameterManager = getParameterManager();
|
|
@@ -85,11 +70,16 @@ export default class Remove extends Command {
|
|
|
85
70
|
},
|
|
86
71
|
{
|
|
87
72
|
async task(ctx) {
|
|
88
|
-
const
|
|
89
|
-
|
|
73
|
+
const executor$ = getExecutor();
|
|
74
|
+
if (!executor$.success) {
|
|
75
|
+
throw new Error(executor$.reason);
|
|
76
|
+
}
|
|
77
|
+
const { executor } = executor$;
|
|
78
|
+
const destroyOutput = await executor.destroy({
|
|
90
79
|
package: ctx.package,
|
|
91
80
|
parameters: ctx.parametersOutput.parameters,
|
|
92
81
|
project: ctx.configOutput.config.project,
|
|
82
|
+
projectRootDir,
|
|
93
83
|
skipDeploy: true,
|
|
94
84
|
workspace: ctx.configOutput.config.workspace,
|
|
95
85
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Run extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
cmd: import("@oclif/core/
|
|
4
|
+
cmd: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
chdir: import("@oclif/core/
|
|
10
|
-
workspace: import("@oclif/core/
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
static strict: boolean;
|
|
13
13
|
run(): Promise<void>;
|
|
@@ -41,10 +41,14 @@ export default class Run extends Command {
|
|
|
41
41
|
this.error('you must specify a workspace to run the command in');
|
|
42
42
|
}
|
|
43
43
|
const envManager = getEnvManager();
|
|
44
|
-
const
|
|
44
|
+
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
45
45
|
projectRootDir,
|
|
46
46
|
workspace,
|
|
47
47
|
});
|
|
48
|
+
if (!getProjectEnvOutput.success) {
|
|
49
|
+
this.error(getProjectEnvOutput.reason);
|
|
50
|
+
}
|
|
51
|
+
const { env } = getProjectEnvOutput;
|
|
48
52
|
const { cmd } = args;
|
|
49
53
|
const cmdArgs = argv.slice(1);
|
|
50
54
|
this.log(`Running command "${cmd} ${cmdArgs.join(' ')}" ...`);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Unbootstrap extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
infrastructureType: import("@oclif/core/
|
|
4
|
+
infrastructureType: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
force: import("@oclif/core/
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
}
|
|
@@ -3,9 +3,9 @@ export default class Undeploy extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
chdir: import("@oclif/core/
|
|
7
|
-
debug: import("@oclif/core/
|
|
8
|
-
workspace: import("@oclif/core/
|
|
6
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
run(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import { Listr,
|
|
2
|
+
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { getBackend } from '../../backend/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getExecutor } from '../../executor/index.js';
|
|
6
6
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
7
7
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
8
8
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
@@ -42,35 +42,23 @@ export default class Undeploy extends Command {
|
|
|
42
42
|
throw new Error("Project not initialized. Run 'hereya init' first.");
|
|
43
43
|
}
|
|
44
44
|
ctx.configOutput = loadConfigOutput;
|
|
45
|
+
ctx.workspace = flags.workspace;
|
|
45
46
|
await delay(500);
|
|
46
47
|
},
|
|
47
48
|
title: 'Loading project config',
|
|
48
49
|
},
|
|
49
|
-
{
|
|
50
|
-
async task(ctx) {
|
|
51
|
-
const backend = await getBackend();
|
|
52
|
-
const { workspace } = flags;
|
|
53
|
-
const getWorkspaceEnvOutput = await backend.getWorkspaceEnv({
|
|
54
|
-
project: ctx.configOutput.config.project,
|
|
55
|
-
workspace,
|
|
56
|
-
});
|
|
57
|
-
if (!getWorkspaceEnvOutput.success) {
|
|
58
|
-
throw new Error(getWorkspaceEnvOutput.reason);
|
|
59
|
-
}
|
|
60
|
-
ctx.workspaceEnv = getWorkspaceEnvOutput.env;
|
|
61
|
-
ctx.workspace = workspace;
|
|
62
|
-
await delay(500);
|
|
63
|
-
},
|
|
64
|
-
title: 'Loading workspace environment variables',
|
|
65
|
-
},
|
|
66
50
|
{
|
|
67
51
|
async task(ctx) {
|
|
68
52
|
const envManager = getEnvManager();
|
|
69
|
-
const
|
|
53
|
+
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
70
54
|
markSecret: true,
|
|
71
55
|
projectRootDir,
|
|
72
56
|
workspace: ctx.workspace,
|
|
73
57
|
});
|
|
58
|
+
if (!getProjectEnvOutput.success) {
|
|
59
|
+
throw new Error(getProjectEnvOutput.reason);
|
|
60
|
+
}
|
|
61
|
+
const { env: projectEnv } = getProjectEnvOutput;
|
|
74
62
|
ctx.projectEnv = projectEnv;
|
|
75
63
|
await delay(500);
|
|
76
64
|
},
|
|
@@ -115,8 +103,12 @@ export default class Undeploy extends Command {
|
|
|
115
103
|
projectRootDir,
|
|
116
104
|
workspace: ctx.workspace,
|
|
117
105
|
});
|
|
118
|
-
const
|
|
119
|
-
|
|
106
|
+
const executor$ = getExecutor();
|
|
107
|
+
if (!executor$.success) {
|
|
108
|
+
throw new Error(executor$.reason);
|
|
109
|
+
}
|
|
110
|
+
const { executor } = executor$;
|
|
111
|
+
const destroyOutput = await executor.destroy({
|
|
120
112
|
isDeploying: true,
|
|
121
113
|
package: packageName,
|
|
122
114
|
parameters,
|
|
@@ -145,12 +137,17 @@ export default class Undeploy extends Command {
|
|
|
145
137
|
projectRootDir,
|
|
146
138
|
workspace: ctx.workspace,
|
|
147
139
|
});
|
|
148
|
-
const
|
|
149
|
-
|
|
140
|
+
const executor$ = getExecutor();
|
|
141
|
+
if (!executor$.success) {
|
|
142
|
+
throw new Error(executor$.reason);
|
|
143
|
+
}
|
|
144
|
+
const { executor } = executor$;
|
|
145
|
+
const destroyOutput = await executor.destroy({
|
|
150
146
|
isDeploying: true,
|
|
151
147
|
package: packageName,
|
|
152
148
|
parameters,
|
|
153
149
|
project: ctx.configOutput.config.project,
|
|
150
|
+
projectRootDir,
|
|
154
151
|
workspace: ctx.workspace,
|
|
155
152
|
});
|
|
156
153
|
if (!destroyOutput.success) {
|
|
@@ -3,10 +3,10 @@ export default class Up extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
chdir: import("@oclif/core/
|
|
7
|
-
debug: import("@oclif/core/
|
|
8
|
-
deploy: import("@oclif/core/
|
|
9
|
-
workspace: import("@oclif/core/
|
|
6
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
deploy: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import { Listr,
|
|
2
|
+
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
3
|
import { getBackend } from '../../backend/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getExecutor } from '../../executor/index.js';
|
|
5
5
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
6
6
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
7
7
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
@@ -45,27 +45,11 @@ export default class Up extends Command {
|
|
|
45
45
|
throw new Error("Project not initialized. Run 'hereya init' first.");
|
|
46
46
|
}
|
|
47
47
|
ctx.configOutput = loadConfigOutput;
|
|
48
|
+
ctx.workspace = flags.workspace || loadConfigOutput.config.workspace;
|
|
48
49
|
await delay(500);
|
|
49
50
|
},
|
|
50
51
|
title: 'Loading project config',
|
|
51
52
|
},
|
|
52
|
-
{
|
|
53
|
-
async task(ctx) {
|
|
54
|
-
const backend = await getBackend();
|
|
55
|
-
const workspace = flags.workspace || ctx.configOutput.config.workspace;
|
|
56
|
-
const getWorkspaceEnvOutput = await backend.getWorkspaceEnv({
|
|
57
|
-
project: ctx.configOutput.config.project,
|
|
58
|
-
workspace,
|
|
59
|
-
});
|
|
60
|
-
if (!getWorkspaceEnvOutput.success) {
|
|
61
|
-
throw new Error(getWorkspaceEnvOutput.reason);
|
|
62
|
-
}
|
|
63
|
-
ctx.workspaceEnvOutput = getWorkspaceEnvOutput;
|
|
64
|
-
ctx.workspace = workspace;
|
|
65
|
-
await delay(500);
|
|
66
|
-
},
|
|
67
|
-
title: 'Loading workspace environment variables',
|
|
68
|
-
},
|
|
69
53
|
{
|
|
70
54
|
async task(ctx) {
|
|
71
55
|
const backend = await getBackend();
|
|
@@ -94,7 +78,7 @@ export default class Up extends Command {
|
|
|
94
78
|
{
|
|
95
79
|
skip: (ctx) => !ctx.removedPackages || ctx.removedPackages.length === 0,
|
|
96
80
|
async task(ctx) {
|
|
97
|
-
const { configOutput, removed, removedPackages, workspace
|
|
81
|
+
const { configOutput, removed, removedPackages, workspace } = ctx;
|
|
98
82
|
if (!removedPackages || removedPackages.length === 0) {
|
|
99
83
|
return;
|
|
100
84
|
}
|
|
@@ -106,12 +90,17 @@ export default class Up extends Command {
|
|
|
106
90
|
projectRootDir,
|
|
107
91
|
workspace,
|
|
108
92
|
});
|
|
109
|
-
const
|
|
110
|
-
|
|
93
|
+
const executor$ = getExecutor();
|
|
94
|
+
if (!executor$.success) {
|
|
95
|
+
throw new Error(executor$.reason);
|
|
96
|
+
}
|
|
97
|
+
const { executor } = executor$;
|
|
98
|
+
const destroyOutput = await executor.destroy({
|
|
111
99
|
isDeploying: flags.deploy,
|
|
112
100
|
package: packageName,
|
|
113
101
|
parameters,
|
|
114
102
|
project: configOutput.config.project,
|
|
103
|
+
projectRootDir,
|
|
115
104
|
workspace,
|
|
116
105
|
});
|
|
117
106
|
if (!destroyOutput.success) {
|
|
@@ -141,12 +130,17 @@ export default class Up extends Command {
|
|
|
141
130
|
projectRootDir,
|
|
142
131
|
workspace: ctx.workspace,
|
|
143
132
|
});
|
|
144
|
-
const
|
|
145
|
-
|
|
133
|
+
const executor$ = getExecutor();
|
|
134
|
+
if (!executor$.success) {
|
|
135
|
+
throw new Error(executor$.reason);
|
|
136
|
+
}
|
|
137
|
+
const { executor } = executor$;
|
|
138
|
+
const provisionOutput = await executor.provision({
|
|
146
139
|
isDeploying: flags.deploy,
|
|
147
140
|
package: packageName,
|
|
148
141
|
parameters,
|
|
149
142
|
project: ctx.configOutput.config.project,
|
|
143
|
+
projectRootDir,
|
|
150
144
|
workspace: ctx.workspace,
|
|
151
145
|
});
|
|
152
146
|
if (!provisionOutput.success) {
|
|
@@ -172,14 +166,12 @@ export default class Up extends Command {
|
|
|
172
166
|
const envManager = getEnvManager();
|
|
173
167
|
for (const { env, metadata } of removed) {
|
|
174
168
|
// eslint-disable-next-line no-await-in-loop
|
|
175
|
-
await
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}),
|
|
182
|
-
]);
|
|
169
|
+
await envManager.removeProjectEnv({
|
|
170
|
+
env,
|
|
171
|
+
infra: metadata.originalInfra ?? metadata.infra,
|
|
172
|
+
projectRootDir,
|
|
173
|
+
workspace,
|
|
174
|
+
});
|
|
183
175
|
}
|
|
184
176
|
await delay(500);
|
|
185
177
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class WorkspaceCreate extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class WorkspaceDelete extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class WorkspaceEnv extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
list: import("@oclif/core/
|
|
10
|
-
workspace: import("@oclif/core/
|
|
9
|
+
list: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -3,11 +3,11 @@ export default class WorkspaceEnvSet extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
infra: import("@oclif/core/
|
|
7
|
-
name: import("@oclif/core/
|
|
8
|
-
sensitive: import("@oclif/core/
|
|
9
|
-
value: import("@oclif/core/
|
|
10
|
-
workspace: import("@oclif/core/
|
|
6
|
+
infra: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
sensitive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
value: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -3,8 +3,8 @@ export default class WorkspaceEnvUnset extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
name: import("@oclif/core/
|
|
7
|
-
workspace: import("@oclif/core/
|
|
6
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class WorkspaceInstall extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
package: import("@oclif/core/
|
|
4
|
+
package: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
debug: import("@oclif/core/
|
|
10
|
-
parameter: import("@oclif/core/
|
|
11
|
-
'parameter-file': import("@oclif/core/
|
|
12
|
-
workspace: import("@oclif/core/
|
|
9
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
parameter: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'parameter-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { Listr,
|
|
2
|
+
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
3
|
import { getBackend } from '../../../backend/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getExecutor } from '../../../executor/index.js';
|
|
5
5
|
import { arrayOfStringToObject } from '../../../lib/object-utils.js';
|
|
6
6
|
import { delay, setDebug } from '../../../lib/shell.js';
|
|
7
7
|
import { load } from '../../../lib/yaml-utils.js';
|
|
@@ -74,7 +74,12 @@ export default class WorkspaceInstall extends Command {
|
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
async task(ctx) {
|
|
77
|
-
const
|
|
77
|
+
const executor$ = getExecutor();
|
|
78
|
+
if (!executor$.success) {
|
|
79
|
+
throw new Error(executor$.reason);
|
|
80
|
+
}
|
|
81
|
+
const { executor } = executor$;
|
|
82
|
+
const provisionOutput = await executor.provision({
|
|
78
83
|
package: args.package,
|
|
79
84
|
parameters: ctx.parameters,
|
|
80
85
|
workspace: flags.workspace,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class WorkspaceUninstall extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
package: import("@oclif/core/
|
|
4
|
+
package: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
debug: import("@oclif/core/
|
|
10
|
-
parameter: import("@oclif/core/
|
|
11
|
-
'parameter-file': import("@oclif/core/
|
|
12
|
-
workspace: import("@oclif/core/
|
|
9
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
parameter: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'parameter-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { Listr,
|
|
2
|
+
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
3
|
import { getBackend } from '../../../backend/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getExecutor } from '../../../executor/index.js';
|
|
5
5
|
import { arrayOfStringToObject } from '../../../lib/object-utils.js';
|
|
6
6
|
import { delay, setDebug } from '../../../lib/shell.js';
|
|
7
7
|
import { load } from '../../../lib/yaml-utils.js';
|
|
@@ -81,7 +81,12 @@ export default class WorkspaceUninstall extends Command {
|
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
async task(ctx) {
|
|
84
|
-
const
|
|
84
|
+
const executor$ = getExecutor();
|
|
85
|
+
if (!executor$.success) {
|
|
86
|
+
throw new Error(executor$.reason);
|
|
87
|
+
}
|
|
88
|
+
const { executor } = executor$;
|
|
89
|
+
const destroyOutput = await executor.destroy({
|
|
85
90
|
package: args.package,
|
|
86
91
|
parameters: ctx.parameters,
|
|
87
92
|
workspace: flags.workspace,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Executor } from "./interface.js";
|
|
2
|
+
import { LocalExecutor } from "./local.js";
|
|
3
|
+
export declare const localExecutor: LocalExecutor;
|
|
4
|
+
export declare function getExecutor(): GetExecutorOutput;
|
|
5
|
+
export type GetExecutorOutput = {
|
|
6
|
+
executor: Executor;
|
|
7
|
+
success: true;
|
|
8
|
+
} | {
|
|
9
|
+
reason: string;
|
|
10
|
+
success: false;
|
|
11
|
+
};
|