hereya-cli 0.14.0 → 0.15.1
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 +19 -19
- package/dist/backend/common.d.ts +3 -2
- package/dist/backend/local.d.ts +3 -1
- package/dist/backend/local.js +32 -6
- package/dist/commands/deploy/index.js +16 -7
- package/dist/commands/down/index.js +3 -2
- package/dist/commands/undeploy/index.js +3 -2
- package/dist/commands/up/index.js +3 -2
- package/oclif.manifest.json +79 -79
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
|
|
|
20
20
|
$ hereya COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ hereya (--version)
|
|
23
|
-
hereya-cli/0.
|
|
23
|
+
hereya-cli/0.15.1 linux-x64 node-v22.13.0
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -73,7 +73,7 @@ EXAMPLES
|
|
|
73
73
|
$ hereya add cloudy/docker_postgres
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
76
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/add/index.ts)_
|
|
77
77
|
|
|
78
78
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
79
79
|
|
|
@@ -98,7 +98,7 @@ EXAMPLES
|
|
|
98
98
|
$ hereya bootstrap local
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
101
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/bootstrap/index.ts)_
|
|
102
102
|
|
|
103
103
|
## `hereya deploy`
|
|
104
104
|
|
|
@@ -120,7 +120,7 @@ EXAMPLES
|
|
|
120
120
|
$ hereya deploy
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
123
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/deploy/index.ts)_
|
|
124
124
|
|
|
125
125
|
## `hereya down`
|
|
126
126
|
|
|
@@ -143,7 +143,7 @@ EXAMPLES
|
|
|
143
143
|
$ hereya down
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
146
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/down/index.ts)_
|
|
147
147
|
|
|
148
148
|
## `hereya env [NAME]`
|
|
149
149
|
|
|
@@ -174,7 +174,7 @@ EXAMPLES
|
|
|
174
174
|
$ hereya env -w dev -l
|
|
175
175
|
```
|
|
176
176
|
|
|
177
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
177
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/env/index.ts)_
|
|
178
178
|
|
|
179
179
|
## `hereya help [COMMAND]`
|
|
180
180
|
|
|
@@ -220,7 +220,7 @@ EXAMPLES
|
|
|
220
220
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
223
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/init/index.ts)_
|
|
224
224
|
|
|
225
225
|
## `hereya remove PACKAGE`
|
|
226
226
|
|
|
@@ -244,7 +244,7 @@ EXAMPLES
|
|
|
244
244
|
$ hereya remove cloudy/docker_postgres
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
247
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/remove/index.ts)_
|
|
248
248
|
|
|
249
249
|
## `hereya run CMD`
|
|
250
250
|
|
|
@@ -270,7 +270,7 @@ EXAMPLES
|
|
|
270
270
|
$ hereya run -w uat -- node index.js
|
|
271
271
|
```
|
|
272
272
|
|
|
273
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
273
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/run/index.ts)_
|
|
274
274
|
|
|
275
275
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
276
276
|
|
|
@@ -295,7 +295,7 @@ EXAMPLES
|
|
|
295
295
|
$ hereya unbootstrap local
|
|
296
296
|
```
|
|
297
297
|
|
|
298
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
298
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/unbootstrap/index.ts)_
|
|
299
299
|
|
|
300
300
|
## `hereya undeploy`
|
|
301
301
|
|
|
@@ -317,7 +317,7 @@ EXAMPLES
|
|
|
317
317
|
$ hereya undeploy
|
|
318
318
|
```
|
|
319
319
|
|
|
320
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
320
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/undeploy/index.ts)_
|
|
321
321
|
|
|
322
322
|
## `hereya up`
|
|
323
323
|
|
|
@@ -340,7 +340,7 @@ EXAMPLES
|
|
|
340
340
|
$ hereya up
|
|
341
341
|
```
|
|
342
342
|
|
|
343
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
343
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/up/index.ts)_
|
|
344
344
|
|
|
345
345
|
## `hereya workspace create NAME`
|
|
346
346
|
|
|
@@ -360,7 +360,7 @@ EXAMPLES
|
|
|
360
360
|
$ hereya workspace create dev
|
|
361
361
|
```
|
|
362
362
|
|
|
363
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
363
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/workspace/create/index.ts)_
|
|
364
364
|
|
|
365
365
|
## `hereya workspace delete NAME`
|
|
366
366
|
|
|
@@ -380,7 +380,7 @@ EXAMPLES
|
|
|
380
380
|
$ hereya workspace delete dev
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
383
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/workspace/delete/index.ts)_
|
|
384
384
|
|
|
385
385
|
## `hereya workspace env [NAME]`
|
|
386
386
|
|
|
@@ -406,7 +406,7 @@ EXAMPLES
|
|
|
406
406
|
$ hereya workspace env myEnv -w dev
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
409
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/workspace/env/index.ts)_
|
|
410
410
|
|
|
411
411
|
## `hereya workspace env set`
|
|
412
412
|
|
|
@@ -430,7 +430,7 @@ EXAMPLES
|
|
|
430
430
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
431
431
|
```
|
|
432
432
|
|
|
433
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
433
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/workspace/env/set/index.ts)_
|
|
434
434
|
|
|
435
435
|
## `hereya workspace env unset`
|
|
436
436
|
|
|
@@ -451,7 +451,7 @@ EXAMPLES
|
|
|
451
451
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
452
452
|
```
|
|
453
453
|
|
|
454
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
454
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/workspace/env/unset/index.ts)_
|
|
455
455
|
|
|
456
456
|
## `hereya workspace install PACKAGE`
|
|
457
457
|
|
|
@@ -477,7 +477,7 @@ EXAMPLES
|
|
|
477
477
|
$ hereya workspace install hereya/aws-cognito
|
|
478
478
|
```
|
|
479
479
|
|
|
480
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
480
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/workspace/install/index.ts)_
|
|
481
481
|
|
|
482
482
|
## `hereya workspace uninstall PACKAGE`
|
|
483
483
|
|
|
@@ -503,5 +503,5 @@ EXAMPLES
|
|
|
503
503
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
504
504
|
```
|
|
505
505
|
|
|
506
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
506
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.15.1/src/commands/workspace/uninstall/index.ts)_
|
|
507
507
|
<!-- commandsstop -->
|
package/dist/backend/common.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface Backend {
|
|
|
10
10
|
getWorkspaceEnv(input: GetWorkspaceEnvInput): Promise<GetWorkspaceEnvOutput>;
|
|
11
11
|
init(options: InitProjectInput): Promise<InitProjectOutput>;
|
|
12
12
|
removePackageFromWorkspace(input: RemovePackageFromWorkspaceInput): Promise<RemovePackageFromWorkspaceOutput>;
|
|
13
|
-
saveState(config:
|
|
13
|
+
saveState(config: Config, workspace?: string): Promise<void>;
|
|
14
14
|
setEnvVar(input: SetEnvVarInput): Promise<SetEnvVarOutput>;
|
|
15
15
|
unsetEnvVar(input: UnsetEnvVarInput): Promise<UnsetEnvVarOutput>;
|
|
16
16
|
}
|
|
@@ -110,9 +110,10 @@ export type GetWorkspaceOutput = {
|
|
|
110
110
|
});
|
|
111
111
|
export type GetStateInput = {
|
|
112
112
|
project: string;
|
|
113
|
+
workspace: string;
|
|
113
114
|
};
|
|
114
115
|
export type GetStateOutput = {
|
|
115
|
-
config:
|
|
116
|
+
config: Config;
|
|
116
117
|
found: true;
|
|
117
118
|
} | {
|
|
118
119
|
found: false;
|
package/dist/backend/local.d.ts
CHANGED
|
@@ -10,10 +10,12 @@ export declare class LocalBackend implements Backend {
|
|
|
10
10
|
getWorkspaceEnv(input: GetWorkspaceEnvInput): Promise<GetWorkspaceEnvOutput>;
|
|
11
11
|
init(options: InitProjectInput): Promise<InitProjectOutput>;
|
|
12
12
|
removePackageFromWorkspace(input: RemovePackageFromWorkspaceInput): Promise<RemovePackageFromWorkspaceOutput>;
|
|
13
|
-
saveState(config:
|
|
13
|
+
saveState(config: Config, workspace?: string): Promise<void>;
|
|
14
14
|
setEnvVar(input: SetEnvVarInput): Promise<SetEnvVarOutput>;
|
|
15
15
|
unsetEnvVar(input: UnsetEnvVarInput): Promise<UnsetEnvVarOutput>;
|
|
16
|
+
private getOldProjectStatePath;
|
|
16
17
|
private getProjectStatePath;
|
|
17
18
|
private getWorkspacePath;
|
|
19
|
+
private migrateProjectState;
|
|
18
20
|
private saveWorkspace;
|
|
19
21
|
}
|
package/dist/backend/local.js
CHANGED
|
@@ -132,7 +132,8 @@ export class LocalBackend {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
async getState(input) {
|
|
135
|
-
|
|
135
|
+
await this.migrateProjectState(input);
|
|
136
|
+
const projectStatePath = await this.getProjectStatePath(input);
|
|
136
137
|
const { data, found } = await load(projectStatePath);
|
|
137
138
|
if (found) {
|
|
138
139
|
return {
|
|
@@ -228,9 +229,16 @@ export class LocalBackend {
|
|
|
228
229
|
};
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
|
-
async saveState(config) {
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
async saveState(config, workspace) {
|
|
233
|
+
await this.migrateProjectState({
|
|
234
|
+
project: config.project,
|
|
235
|
+
workspace: workspace ?? config.workspace,
|
|
236
|
+
});
|
|
237
|
+
const projectStatePath = await this.getProjectStatePath({
|
|
238
|
+
project: config.project,
|
|
239
|
+
workspace: workspace ?? config.workspace,
|
|
240
|
+
});
|
|
241
|
+
await save({ ...config, workspace: workspace ?? config.workspace }, projectStatePath);
|
|
234
242
|
}
|
|
235
243
|
async setEnvVar(input) {
|
|
236
244
|
const workspace$ = await this.getWorkspace(input.workspace);
|
|
@@ -321,12 +329,30 @@ export class LocalBackend {
|
|
|
321
329
|
success: true,
|
|
322
330
|
};
|
|
323
331
|
}
|
|
324
|
-
async
|
|
325
|
-
return getAnyPath(path.join(os.homedir(), '.hereya', 'state', 'projects', `${project}.yaml`), path.join(os.homedir(), '.hereya', 'state', 'projects', `${project}.yml`));
|
|
332
|
+
async getOldProjectStatePath(input) {
|
|
333
|
+
return getAnyPath(path.join(os.homedir(), '.hereya', 'state', 'projects', `${input.project}.yaml`), path.join(os.homedir(), '.hereya', 'state', 'projects', `${input.project}.yml`));
|
|
334
|
+
}
|
|
335
|
+
async getProjectStatePath(input) {
|
|
336
|
+
return getAnyPath(path.join(os.homedir(), '.hereya', 'state', 'projects', input.workspace, `${input.project}.yaml`), path.join(os.homedir(), '.hereya', 'state', 'projects', input.workspace, `${input.project}.yml`));
|
|
326
337
|
}
|
|
327
338
|
async getWorkspacePath(name) {
|
|
328
339
|
return getAnyPath(path.join(os.homedir(), '.hereya', 'state', 'workspaces', `${name}.yaml`), path.join(os.homedir(), '.hereya', 'state', 'workspaces', `${name}.yml`));
|
|
329
340
|
}
|
|
341
|
+
async migrateProjectState(input) {
|
|
342
|
+
const oldProjectStatePath = await this.getOldProjectStatePath(input);
|
|
343
|
+
const newProjectStatePath = await this.getProjectStatePath(input);
|
|
344
|
+
const newProjectStateDir = path.dirname(newProjectStatePath);
|
|
345
|
+
await fs.mkdir(newProjectStateDir, { recursive: true });
|
|
346
|
+
try {
|
|
347
|
+
await fs.access(oldProjectStatePath);
|
|
348
|
+
await fs.rename(oldProjectStatePath, newProjectStatePath);
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
if (error.code !== 'ENOENT') {
|
|
352
|
+
throw error;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
330
356
|
async saveWorkspace(data, name) {
|
|
331
357
|
const workspacePath = await this.getWorkspacePath(name);
|
|
332
358
|
await save(data, workspacePath);
|
|
@@ -48,16 +48,15 @@ export default class Deploy extends Command {
|
|
|
48
48
|
{
|
|
49
49
|
async task(ctx) {
|
|
50
50
|
const backend = await getBackend();
|
|
51
|
-
const { workspace } = flags;
|
|
52
51
|
const getWorkspaceEnvOutput = await backend.getWorkspaceEnv({
|
|
53
52
|
project: ctx.configOutput.config.project,
|
|
54
|
-
workspace,
|
|
53
|
+
workspace: flags.workspace,
|
|
55
54
|
});
|
|
56
55
|
if (!getWorkspaceEnvOutput.success) {
|
|
57
56
|
throw new Error(getWorkspaceEnvOutput.reason);
|
|
58
57
|
}
|
|
59
58
|
ctx.workspaceEnv = getWorkspaceEnvOutput.env;
|
|
60
|
-
ctx.workspace = workspace;
|
|
59
|
+
ctx.workspace = flags.workspace;
|
|
61
60
|
await delay(500);
|
|
62
61
|
},
|
|
63
62
|
title: 'Loading workspace environment variables',
|
|
@@ -80,6 +79,7 @@ export default class Deploy extends Command {
|
|
|
80
79
|
const backend = await getBackend();
|
|
81
80
|
const savedStateOutput = await backend.getState({
|
|
82
81
|
project: ctx.configOutput.config.project,
|
|
82
|
+
workspace: ctx.workspace,
|
|
83
83
|
});
|
|
84
84
|
if (savedStateOutput.found) {
|
|
85
85
|
ctx.savedStateOutput = savedStateOutput;
|
|
@@ -238,18 +238,24 @@ export default class Deploy extends Command {
|
|
|
238
238
|
title: 'Adding env vars from added packages',
|
|
239
239
|
},
|
|
240
240
|
{
|
|
241
|
-
async task() {
|
|
241
|
+
async task(ctx) {
|
|
242
242
|
const backend = await getBackend();
|
|
243
243
|
const configManager = getConfigManager();
|
|
244
244
|
const { config: newConfig } = await configManager.loadConfig({ projectRootDir });
|
|
245
|
-
await backend.saveState(newConfig);
|
|
245
|
+
await backend.saveState(newConfig, ctx.workspace);
|
|
246
246
|
await delay(500);
|
|
247
247
|
},
|
|
248
248
|
title: 'Saving state',
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
skip: (ctx) => ctx.deployPackages.length === 0,
|
|
252
|
-
task(ctx, task) {
|
|
252
|
+
async task(ctx, task) {
|
|
253
|
+
const envManager = getEnvManager();
|
|
254
|
+
const { env: projectEnv } = await envManager.getProjectEnv({
|
|
255
|
+
markSecret: true,
|
|
256
|
+
projectRootDir,
|
|
257
|
+
workspace: ctx.workspace,
|
|
258
|
+
});
|
|
253
259
|
return task.newListr(ctx.deployPackages.map((packageName) => ({
|
|
254
260
|
async task() {
|
|
255
261
|
const parameterManager = getParameterManager();
|
|
@@ -264,13 +270,16 @@ export default class Deploy extends Command {
|
|
|
264
270
|
package: packageName,
|
|
265
271
|
parameters,
|
|
266
272
|
project: ctx.configOutput.config.project,
|
|
267
|
-
projectEnv
|
|
273
|
+
projectEnv,
|
|
268
274
|
projectRootDir,
|
|
269
275
|
workspace: ctx.workspace,
|
|
270
276
|
});
|
|
271
277
|
if (!provisionOutput.success) {
|
|
272
278
|
throw new Error(provisionOutput.reason);
|
|
273
279
|
}
|
|
280
|
+
console.log(Object.entries(provisionOutput.env)
|
|
281
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
282
|
+
.join('\n'));
|
|
274
283
|
},
|
|
275
284
|
title: `Provisioning package ${packageName}`,
|
|
276
285
|
})), { concurrent: true });
|
|
@@ -72,6 +72,7 @@ export default class Down extends Command {
|
|
|
72
72
|
const backend = await getBackend();
|
|
73
73
|
const savedStateOutput = await backend.getState({
|
|
74
74
|
project: ctx.configOutput.config.project,
|
|
75
|
+
workspace: ctx.workspace,
|
|
75
76
|
});
|
|
76
77
|
let removedPackages = [];
|
|
77
78
|
if (savedStateOutput.found) {
|
|
@@ -141,11 +142,11 @@ export default class Down extends Command {
|
|
|
141
142
|
title: 'Removing env vars from destroyed packages',
|
|
142
143
|
},
|
|
143
144
|
{
|
|
144
|
-
async task() {
|
|
145
|
+
async task(ctx) {
|
|
145
146
|
const backend = await getBackend();
|
|
146
147
|
const configManager = getConfigManager();
|
|
147
148
|
const { config: newConfig } = await configManager.loadConfig({ projectRootDir });
|
|
148
|
-
await backend.saveState(newConfig);
|
|
149
|
+
await backend.saveState(newConfig, ctx.workspace);
|
|
149
150
|
await delay(500);
|
|
150
151
|
},
|
|
151
152
|
title: 'Saving state',
|
|
@@ -81,6 +81,7 @@ export default class Undeploy extends Command {
|
|
|
81
81
|
const backend = await getBackend();
|
|
82
82
|
const savedStateOutput = await backend.getState({
|
|
83
83
|
project: ctx.configOutput.config.project,
|
|
84
|
+
workspace: ctx.workspace,
|
|
84
85
|
});
|
|
85
86
|
if (savedStateOutput.found) {
|
|
86
87
|
ctx.savedStateOutput = savedStateOutput;
|
|
@@ -187,11 +188,11 @@ export default class Undeploy extends Command {
|
|
|
187
188
|
title: 'Removing env vars from destroyed packages',
|
|
188
189
|
},
|
|
189
190
|
{
|
|
190
|
-
async task() {
|
|
191
|
+
async task(ctx) {
|
|
191
192
|
const backend = await getBackend();
|
|
192
193
|
const configManager = getConfigManager();
|
|
193
194
|
const { config: newConfig } = await configManager.loadConfig({ projectRootDir });
|
|
194
|
-
await backend.saveState(newConfig);
|
|
195
|
+
await backend.saveState(newConfig, ctx.workspace);
|
|
195
196
|
await delay(500);
|
|
196
197
|
},
|
|
197
198
|
title: 'Saving state',
|
|
@@ -71,6 +71,7 @@ export default class Up extends Command {
|
|
|
71
71
|
const backend = await getBackend();
|
|
72
72
|
const savedStateOutput = await backend.getState({
|
|
73
73
|
project: ctx.configOutput.config.project,
|
|
74
|
+
workspace: ctx.workspace,
|
|
74
75
|
});
|
|
75
76
|
if (savedStateOutput.found) {
|
|
76
77
|
ctx.savedStateOutput = savedStateOutput;
|
|
@@ -205,11 +206,11 @@ export default class Up extends Command {
|
|
|
205
206
|
title: 'Adding env vars from added packages',
|
|
206
207
|
},
|
|
207
208
|
{
|
|
208
|
-
async task() {
|
|
209
|
+
async task(ctx) {
|
|
209
210
|
const backend = await getBackend();
|
|
210
211
|
const configManager = getConfigManager();
|
|
211
212
|
const { config: newConfig } = await configManager.loadConfig({ projectRootDir });
|
|
212
|
-
await backend.saveState(newConfig);
|
|
213
|
+
await backend.saveState(newConfig, ctx.workspace);
|
|
213
214
|
await delay(500);
|
|
214
215
|
},
|
|
215
216
|
title: 'Saving state',
|
package/oclif.manifest.json
CHANGED
|
@@ -54,45 +54,6 @@
|
|
|
54
54
|
"index.js"
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
|
-
"bootstrap": {
|
|
58
|
-
"aliases": [],
|
|
59
|
-
"args": {
|
|
60
|
-
"infrastructureType": {
|
|
61
|
-
"description": "infrastructure to bootstrap. Options are local, aws",
|
|
62
|
-
"name": "infrastructureType",
|
|
63
|
-
"required": true
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"description": "Install necessary resources for hereya operations in an infrastructure.",
|
|
67
|
-
"examples": [
|
|
68
|
-
"<%= config.bin %> <%= command.id %> aws",
|
|
69
|
-
"<%= config.bin %> <%= command.id %> local"
|
|
70
|
-
],
|
|
71
|
-
"flags": {
|
|
72
|
-
"force": {
|
|
73
|
-
"char": "f",
|
|
74
|
-
"description": "redeploy hereya resources if already deployed",
|
|
75
|
-
"name": "force",
|
|
76
|
-
"allowNo": false,
|
|
77
|
-
"type": "boolean"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"hasDynamicHelp": false,
|
|
81
|
-
"hiddenAliases": [],
|
|
82
|
-
"id": "bootstrap",
|
|
83
|
-
"pluginAlias": "hereya-cli",
|
|
84
|
-
"pluginName": "hereya-cli",
|
|
85
|
-
"pluginType": "core",
|
|
86
|
-
"strict": true,
|
|
87
|
-
"enableJsonFlag": false,
|
|
88
|
-
"isESM": true,
|
|
89
|
-
"relativePath": [
|
|
90
|
-
"dist",
|
|
91
|
-
"commands",
|
|
92
|
-
"bootstrap",
|
|
93
|
-
"index.js"
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
57
|
"deploy": {
|
|
97
58
|
"aliases": [],
|
|
98
59
|
"args": {},
|
|
@@ -141,6 +102,45 @@
|
|
|
141
102
|
"index.js"
|
|
142
103
|
]
|
|
143
104
|
},
|
|
105
|
+
"bootstrap": {
|
|
106
|
+
"aliases": [],
|
|
107
|
+
"args": {
|
|
108
|
+
"infrastructureType": {
|
|
109
|
+
"description": "infrastructure to bootstrap. Options are local, aws",
|
|
110
|
+
"name": "infrastructureType",
|
|
111
|
+
"required": true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"description": "Install necessary resources for hereya operations in an infrastructure.",
|
|
115
|
+
"examples": [
|
|
116
|
+
"<%= config.bin %> <%= command.id %> aws",
|
|
117
|
+
"<%= config.bin %> <%= command.id %> local"
|
|
118
|
+
],
|
|
119
|
+
"flags": {
|
|
120
|
+
"force": {
|
|
121
|
+
"char": "f",
|
|
122
|
+
"description": "redeploy hereya resources if already deployed",
|
|
123
|
+
"name": "force",
|
|
124
|
+
"allowNo": false,
|
|
125
|
+
"type": "boolean"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"hasDynamicHelp": false,
|
|
129
|
+
"hiddenAliases": [],
|
|
130
|
+
"id": "bootstrap",
|
|
131
|
+
"pluginAlias": "hereya-cli",
|
|
132
|
+
"pluginName": "hereya-cli",
|
|
133
|
+
"pluginType": "core",
|
|
134
|
+
"strict": true,
|
|
135
|
+
"enableJsonFlag": false,
|
|
136
|
+
"isESM": true,
|
|
137
|
+
"relativePath": [
|
|
138
|
+
"dist",
|
|
139
|
+
"commands",
|
|
140
|
+
"bootstrap",
|
|
141
|
+
"index.js"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
144
|
"down": {
|
|
145
145
|
"aliases": [],
|
|
146
146
|
"args": {},
|
|
@@ -768,51 +768,26 @@
|
|
|
768
768
|
"index.js"
|
|
769
769
|
]
|
|
770
770
|
},
|
|
771
|
-
"workspace:env:
|
|
771
|
+
"workspace:env:unset": {
|
|
772
772
|
"aliases": [],
|
|
773
773
|
"args": {},
|
|
774
|
-
"description": "
|
|
774
|
+
"description": "unset an env var for a workspace",
|
|
775
775
|
"examples": [
|
|
776
|
-
"<%= config.bin %> <%= command.id %> -w my-workspace -n myVar
|
|
776
|
+
"<%= config.bin %> <%= command.id %> -w my-workspace -n myVar"
|
|
777
777
|
],
|
|
778
778
|
"flags": {
|
|
779
|
-
"infra": {
|
|
780
|
-
"char": "i",
|
|
781
|
-
"description": "the infrastructure to store the env var in",
|
|
782
|
-
"name": "infra",
|
|
783
|
-
"required": true,
|
|
784
|
-
"hasDynamicHelp": false,
|
|
785
|
-
"multiple": false,
|
|
786
|
-
"type": "option"
|
|
787
|
-
},
|
|
788
779
|
"name": {
|
|
789
780
|
"char": "n",
|
|
790
|
-
"description": "name of the env var to
|
|
781
|
+
"description": "name of the env var to unset",
|
|
791
782
|
"name": "name",
|
|
792
783
|
"required": true,
|
|
793
784
|
"hasDynamicHelp": false,
|
|
794
785
|
"multiple": false,
|
|
795
786
|
"type": "option"
|
|
796
787
|
},
|
|
797
|
-
"sensitive": {
|
|
798
|
-
"char": "s",
|
|
799
|
-
"description": "whether the env var is sensitive",
|
|
800
|
-
"name": "sensitive",
|
|
801
|
-
"allowNo": false,
|
|
802
|
-
"type": "boolean"
|
|
803
|
-
},
|
|
804
|
-
"value": {
|
|
805
|
-
"char": "v",
|
|
806
|
-
"description": "value of the env var to set",
|
|
807
|
-
"name": "value",
|
|
808
|
-
"required": true,
|
|
809
|
-
"hasDynamicHelp": false,
|
|
810
|
-
"multiple": false,
|
|
811
|
-
"type": "option"
|
|
812
|
-
},
|
|
813
788
|
"workspace": {
|
|
814
789
|
"char": "w",
|
|
815
|
-
"description": "name of the workspace to
|
|
790
|
+
"description": "name of the workspace to unset an env var for",
|
|
816
791
|
"name": "workspace",
|
|
817
792
|
"required": true,
|
|
818
793
|
"hasDynamicHelp": false,
|
|
@@ -822,7 +797,7 @@
|
|
|
822
797
|
},
|
|
823
798
|
"hasDynamicHelp": false,
|
|
824
799
|
"hiddenAliases": [],
|
|
825
|
-
"id": "workspace:env:
|
|
800
|
+
"id": "workspace:env:unset",
|
|
826
801
|
"pluginAlias": "hereya-cli",
|
|
827
802
|
"pluginName": "hereya-cli",
|
|
828
803
|
"pluginType": "core",
|
|
@@ -834,30 +809,55 @@
|
|
|
834
809
|
"commands",
|
|
835
810
|
"workspace",
|
|
836
811
|
"env",
|
|
837
|
-
"
|
|
812
|
+
"unset",
|
|
838
813
|
"index.js"
|
|
839
814
|
]
|
|
840
815
|
},
|
|
841
|
-
"workspace:env:
|
|
816
|
+
"workspace:env:set": {
|
|
842
817
|
"aliases": [],
|
|
843
818
|
"args": {},
|
|
844
|
-
"description": "
|
|
819
|
+
"description": "set an env var for a workspace",
|
|
845
820
|
"examples": [
|
|
846
|
-
"<%= config.bin %> <%= command.id %> -w my-workspace -n myVar"
|
|
821
|
+
"<%= config.bin %> <%= command.id %> -w my-workspace -n myVar -v my-value -i aws -s"
|
|
847
822
|
],
|
|
848
823
|
"flags": {
|
|
824
|
+
"infra": {
|
|
825
|
+
"char": "i",
|
|
826
|
+
"description": "the infrastructure to store the env var in",
|
|
827
|
+
"name": "infra",
|
|
828
|
+
"required": true,
|
|
829
|
+
"hasDynamicHelp": false,
|
|
830
|
+
"multiple": false,
|
|
831
|
+
"type": "option"
|
|
832
|
+
},
|
|
849
833
|
"name": {
|
|
850
834
|
"char": "n",
|
|
851
|
-
"description": "name of the env var to
|
|
835
|
+
"description": "name of the env var to set",
|
|
852
836
|
"name": "name",
|
|
853
837
|
"required": true,
|
|
854
838
|
"hasDynamicHelp": false,
|
|
855
839
|
"multiple": false,
|
|
856
840
|
"type": "option"
|
|
857
841
|
},
|
|
842
|
+
"sensitive": {
|
|
843
|
+
"char": "s",
|
|
844
|
+
"description": "whether the env var is sensitive",
|
|
845
|
+
"name": "sensitive",
|
|
846
|
+
"allowNo": false,
|
|
847
|
+
"type": "boolean"
|
|
848
|
+
},
|
|
849
|
+
"value": {
|
|
850
|
+
"char": "v",
|
|
851
|
+
"description": "value of the env var to set",
|
|
852
|
+
"name": "value",
|
|
853
|
+
"required": true,
|
|
854
|
+
"hasDynamicHelp": false,
|
|
855
|
+
"multiple": false,
|
|
856
|
+
"type": "option"
|
|
857
|
+
},
|
|
858
858
|
"workspace": {
|
|
859
859
|
"char": "w",
|
|
860
|
-
"description": "name of the workspace to
|
|
860
|
+
"description": "name of the workspace to set an env var for",
|
|
861
861
|
"name": "workspace",
|
|
862
862
|
"required": true,
|
|
863
863
|
"hasDynamicHelp": false,
|
|
@@ -867,7 +867,7 @@
|
|
|
867
867
|
},
|
|
868
868
|
"hasDynamicHelp": false,
|
|
869
869
|
"hiddenAliases": [],
|
|
870
|
-
"id": "workspace:env:
|
|
870
|
+
"id": "workspace:env:set",
|
|
871
871
|
"pluginAlias": "hereya-cli",
|
|
872
872
|
"pluginName": "hereya-cli",
|
|
873
873
|
"pluginType": "core",
|
|
@@ -879,10 +879,10 @@
|
|
|
879
879
|
"commands",
|
|
880
880
|
"workspace",
|
|
881
881
|
"env",
|
|
882
|
-
"
|
|
882
|
+
"set",
|
|
883
883
|
"index.js"
|
|
884
884
|
]
|
|
885
885
|
}
|
|
886
886
|
},
|
|
887
|
-
"version": "0.
|
|
887
|
+
"version": "0.15.1"
|
|
888
888
|
}
|