@agilecustoms/envctl 0.36.0 → 0.36.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/dist/container.js +1 -1
- package/dist/service/LogService.js +4 -2
- package/package.json +2 -2
package/dist/container.js
CHANGED
|
@@ -15,5 +15,5 @@ const envApiClient = new EnvApiClient(httpClient);
|
|
|
15
15
|
const processRunner = new ProcessRunner();
|
|
16
16
|
const terraformAdapter = new TerraformAdapter(processRunner, cliHelper, backends);
|
|
17
17
|
const envService = new EnvService(cliHelper, envApiClient, terraformAdapter);
|
|
18
|
-
const logService = new LogService(envApiClient, terraformAdapter);
|
|
18
|
+
const logService = new LogService(envApiClient, terraformAdapter, processRunner);
|
|
19
19
|
export { awsCredsHelper, configService, envService, logService };
|
|
@@ -9,14 +9,15 @@ import { KnownException } from '../exceptions.js';
|
|
|
9
9
|
export class LogService {
|
|
10
10
|
envApi;
|
|
11
11
|
terraformAdapter;
|
|
12
|
-
|
|
12
|
+
processRunner;
|
|
13
|
+
constructor(envApi, terraformAdapter, processRunner) {
|
|
13
14
|
this.envApi = envApi;
|
|
14
15
|
this.terraformAdapter = terraformAdapter;
|
|
16
|
+
this.processRunner = processRunner;
|
|
15
17
|
}
|
|
16
18
|
async getLogs(key, cwd) {
|
|
17
19
|
key = this.terraformAdapter.getKey(key, cwd);
|
|
18
20
|
const url = await this.envApi.getLogs(key);
|
|
19
|
-
console.log(`Downloading logs from: ${url}`);
|
|
20
21
|
const outDir = join(tmpdir(), 'envctl');
|
|
21
22
|
await mkdir(outDir, { recursive: true });
|
|
22
23
|
const urlPath = new URL(url).pathname;
|
|
@@ -30,5 +31,6 @@ export class LogService {
|
|
|
30
31
|
}
|
|
31
32
|
await pipeline(Readable.fromWeb(res.body), createWriteStream(outPath, { flags: 'w' }));
|
|
32
33
|
console.log(`Logs saved to: ${outPath}`);
|
|
34
|
+
await this.processRunner.run('open', ['-R', outPath]);
|
|
33
35
|
}
|
|
34
36
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agilecustoms/envctl",
|
|
3
3
|
"description": "node.js CLI client for manage environments",
|
|
4
|
-
"version": "0.36.
|
|
4
|
+
"version": "0.36.1",
|
|
5
5
|
"author": "Alex Chekulaev",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"run-core-deploy": " tsc --sourceMap true && npm run run -- deploy --cwd ../tt-core -var=\"env_size=min\"",
|
|
39
39
|
"run-core-delete": " tsc --sourceMap true && npm run run -- delete --cwd ../tt-core",
|
|
40
40
|
"run-core-destroy": "tsc --sourceMap true && npm run run -- destroy --cwd ../tt-core",
|
|
41
|
-
"run-core-logs": "tsc --sourceMap true && npm run run -- logs --cwd ../tt-core",
|
|
41
|
+
"run-core-logs": " tsc --sourceMap true && npm run run -- logs --cwd ../tt-core",
|
|
42
42
|
"*": "",
|
|
43
43
|
"run-init": "cd ../tt-gitops && terraform init -upgrade -backend-config=key=laxa1986 -reconfigure",
|
|
44
44
|
"run-status": " tsc --sourceMap true && npm run run -- status --cwd ../tt-gitops",
|