@agilecustoms/envctl 0.21.0 → 0.21.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.
@@ -1,6 +1,5 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
- import { glob } from 'glob';
4
3
  import { AbortedException, KnownException, ProcessException, TerraformInitRequired } from '../exceptions.js';
5
4
  const MAX_ATTEMPTS = 2;
6
5
  const RETRYABLE_ERRORS = [
@@ -64,7 +63,9 @@ export class TerraformAdapter {
64
63
  }
65
64
  getVarDefs(cwd) {
66
65
  const dir = cwd ?? process.cwd();
67
- const tfFiles = glob.sync(path.join(dir, '*.tf'));
66
+ const tfFiles = fs.readdirSync(dir)
67
+ .filter(file => file.endsWith('.tf'))
68
+ .map(file => path.join(dir, file));
68
69
  const results = {};
69
70
  const varBlockRegex = /variable\s+"(\w+)"\s*{([^}]+)}/g;
70
71
  const defaultRegex = /\n[^#\n]*default\s+=\s+/;
@@ -142,9 +142,11 @@ export class EnvCtl {
142
142
  }
143
143
  }
144
144
  finally {
145
- const newVars = this.terraformAdapter.getNewVars(envTerraform, onDemandVars, cwd);
146
- if (Object.keys(newVars).length) {
147
- await this.envApi.setVars(env, newVars);
145
+ if (!ephemeral) {
146
+ const newVars = this.terraformAdapter.getNewVars(envTerraform, onDemandVars, cwd);
147
+ if (Object.keys(newVars).length) {
148
+ await this.envApi.setVars(env, newVars);
149
+ }
148
150
  }
149
151
  }
150
152
  console.log('Activating env (to finish creation)');
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.21.0",
4
+ "version": "0.21.2",
5
5
  "author": "Alex Chekulaev",
6
6
  "type": "module",
7
7
  "bin": {
@@ -33,7 +33,7 @@
33
33
  "run-delete": " tsc --sourceMap true && npm run run -- delete --cwd ../tt-core",
34
34
  "run-destroy": " tsc --sourceMap true && npm run run -- destroy --cwd ../tt-core",
35
35
  "-": "",
36
- "run-ephemeral-create": " tsc --sourceMap true && npm run run -- create-ephemeral --env test --size min --type dev",
36
+ "run-ephemeral-create": " tsc --sourceMap true && npm run run -- create-ephemeral --env test",
37
37
  "run-ephemeral-status": " tsc --sourceMap true && npm run run -- status --env test",
38
38
  "run-ephemeral-init": " tsc --sourceMap true && npm run run -- init --env test --cwd ../tt-gitops",
39
39
  "run-ephemeral-deploy": " tsc --sourceMap true && npm run run -- deploy --env test --cwd ../tt-gitops -var-file=versions.tfvars",