@agilecustoms/envctl 0.27.1 → 0.27.2

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.
@@ -6,11 +6,11 @@ export function createEphemeral(program) {
6
6
  program
7
7
  .command('create-ephemeral')
8
8
  .description('Create bare env w/o resources. Used in CI as first step just to pre-generate token for extension')
9
- .option('--cwd <cwd>', _keys.CWD)
9
+ .requiredOption('--key <key>', _keys.KEY)
10
10
  .action(wrap(handler));
11
11
  }
12
12
  async function handler(options) {
13
- const { cwd } = options;
14
- const token = await envCtl.createEphemeral(cwd);
13
+ const { key } = options;
14
+ const token = await envCtl.createEphemeral(key);
15
15
  console.log(token);
16
16
  }
@@ -88,8 +88,7 @@ export class EnvCtl {
88
88
  const envTerraform = { key, ephemeral: false, owner, args, vars };
89
89
  await this.terraformAdapter.plan(envTerraform, cwd);
90
90
  }
91
- async createEphemeral(cwd) {
92
- const key = this.terraformAdapter.getKey(cwd);
91
+ async createEphemeral(key) {
93
92
  const env = await this.envApi.get(key);
94
93
  if (env !== null) {
95
94
  throw new KnownException(`Env ${key} already exists`);
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.27.1",
4
+ "version": "0.27.2",
5
5
  "author": "Alex Chekulaev",
6
6
  "type": "module",
7
7
  "bin": {
@@ -36,8 +36,8 @@
36
36
  "run-delete": " tsc --sourceMap true && npm run run -- delete --cwd ../tt-core",
37
37
  "run-destroy": "tsc --sourceMap true && npm run run -- destroy --cwd ../tt-core",
38
38
  "-": "",
39
+ "run-ephemeral-create": " tsc --sourceMap true && npm run run -- create-ephemeral --key test",
39
40
  "run-ephemeral-init": "cd ../tt-gitops && terraform init -upgrade -backend-config=key=test -reconfigure",
40
- "run-ephemeral-create": " tsc --sourceMap true && npm run run -- create-ephemeral --cwd ../tt-gitops",
41
41
  "run-ephemeral-status": " tsc --sourceMap true && npm run run -- status --key test",
42
42
  "run-ephemeral-deploy": " tsc --sourceMap true && npm run run -- deploy --cwd ../tt-gitops -var-file=versions.tfvars",
43
43
  "run-ephemeral-delete": " tsc --sourceMap true && npm run run -- delete --cwd ../tt-gitops --force",