@quadnix/octo-build 0.0.17 → 0.2.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.
Files changed (195) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +117 -8
  3. package/dist/commands/apply/apply.command.d.ts +25 -0
  4. package/dist/commands/apply/apply.command.js +130 -0
  5. package/dist/commands/apply/apply.command.js.map +1 -0
  6. package/dist/commands/apply/index.d.ts +1 -0
  7. package/dist/commands/apply/index.js +2 -0
  8. package/dist/commands/apply/index.js.map +1 -0
  9. package/dist/commands/build/build.command.d.ts +1 -1
  10. package/dist/commands/build/build.command.js +4 -4
  11. package/dist/commands/build/build.command.js.map +1 -1
  12. package/dist/commands/build/main.d.ts +22 -0
  13. package/dist/commands/build/main.js +22 -0
  14. package/dist/commands/build/main.js.map +1 -1
  15. package/dist/commands/build/parsers/build-file.parser.d.ts +6 -0
  16. package/dist/commands/build/parsers/build-file.parser.js +6 -0
  17. package/dist/commands/build/parsers/build-file.parser.js.map +1 -1
  18. package/dist/commands/build/streams/stream-manager.d.ts +6 -0
  19. package/dist/commands/build/streams/stream-manager.js +7 -1
  20. package/dist/commands/build/streams/stream-manager.js.map +1 -1
  21. package/dist/commands/commit/commit.command.d.ts +23 -0
  22. package/dist/commands/commit/commit.command.js +81 -0
  23. package/dist/commands/commit/commit.command.js.map +1 -0
  24. package/dist/commands/commit/index.d.ts +1 -0
  25. package/dist/commands/commit/index.js +2 -0
  26. package/dist/commands/commit/index.js.map +1 -0
  27. package/dist/commands/create-anchor/create-anchor.command.js +1 -1
  28. package/dist/commands/create-anchor/create-anchor.command.js.map +1 -1
  29. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.d.ts +18 -3
  30. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js +29 -11
  31. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js.map +1 -1
  32. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/templates/anchors/anchor/anchor.schema.ts.ejs +9 -1
  33. package/dist/commands/create-app/create-app.command.d.ts +1 -1
  34. package/dist/commands/create-app/create-app.command.js +7 -3
  35. package/dist/commands/create-app/create-app.command.js.map +1 -1
  36. package/dist/commands/create-app/generator-octo-app-template/generators/app/index.d.ts +17 -1
  37. package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js +72 -16
  38. package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js.map +1 -1
  39. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/README.md.ejs +73 -14
  40. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/gitignore.ejs +14 -0
  41. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/index.ts.ejs +19 -0
  42. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/package.json.ejs +9 -1
  43. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-dynamodb-service/octo.yaml.ejs +111 -0
  44. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/octo.yaml.ejs +28 -16
  45. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-s3-website/octo.yaml.ejs +25 -3
  46. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/tsconfig.json.ejs +0 -3
  47. package/dist/commands/{create-resource/create-resource.command.d.ts → create-external-resource/create-external-resource.command.d.ts} +1 -1
  48. package/dist/commands/create-external-resource/create-external-resource.command.js +64 -0
  49. package/dist/commands/create-external-resource/create-external-resource.command.js.map +1 -0
  50. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/index.d.ts +17 -2
  51. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/index.js +36 -35
  52. package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/index.js.map +1 -0
  53. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/actions/add.resource.action.ts.ejs +7 -16
  54. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/actions/delete.resource.action.ts.ejs +21 -3
  55. package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/templates/resources/resource/actions/update.resource.action.ts.ejs +63 -0
  56. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/index.ts.ejs +1 -2
  57. package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +28 -0
  58. package/dist/commands/create-external-resource/index.d.ts +1 -0
  59. package/dist/commands/create-external-resource/index.js +2 -0
  60. package/dist/commands/create-external-resource/index.js.map +1 -0
  61. package/dist/commands/create-model/create-model.command.js +1 -1
  62. package/dist/commands/create-model/create-model.command.js.map +1 -1
  63. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.d.ts +17 -2
  64. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js +26 -9
  65. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js.map +1 -1
  66. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/model.ts.ejs +41 -1
  67. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/schema.ts.ejs +6 -1
  68. package/dist/commands/create-module/create-module.command.js +1 -1
  69. package/dist/commands/create-module/create-module.command.js.map +1 -1
  70. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.d.ts +17 -2
  71. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js +27 -10
  72. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js.map +1 -1
  73. package/dist/commands/create-overlay/create-overlay.command.js +4 -3
  74. package/dist/commands/create-overlay/create-overlay.command.js.map +1 -1
  75. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.d.ts +17 -2
  76. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js +26 -9
  77. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js.map +1 -1
  78. package/dist/commands/{create-cdk/create-cdk.command.d.ts → create-terraform-resource/create-terraform-resource.command.d.ts} +3 -3
  79. package/dist/commands/{create-resource/create-resource.command.js → create-terraform-resource/create-terraform-resource.command.js} +17 -11
  80. package/dist/commands/create-terraform-resource/create-terraform-resource.command.js.map +1 -0
  81. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.d.ts +25 -0
  82. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.js +71 -0
  83. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.js.map +1 -0
  84. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/index.schema.ts.ejs +43 -0
  85. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/index.ts.ejs +1 -0
  86. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +83 -0
  87. package/dist/commands/create-terraform-resource/index.d.ts +1 -0
  88. package/dist/commands/create-terraform-resource/index.js +2 -0
  89. package/dist/commands/create-terraform-resource/index.js.map +1 -0
  90. package/dist/commands/generate/generate.command.d.ts +16 -0
  91. package/dist/commands/generate/generate.command.js +35 -0
  92. package/dist/commands/generate/generate.command.js.map +1 -0
  93. package/dist/commands/generate/index.d.ts +1 -0
  94. package/dist/commands/generate/index.js +2 -0
  95. package/dist/commands/generate/index.js.map +1 -0
  96. package/dist/commands/get-response/get-response.command.d.ts +18 -0
  97. package/dist/commands/get-response/get-response.command.js +39 -0
  98. package/dist/commands/get-response/get-response.command.js.map +1 -0
  99. package/dist/commands/get-response/index.d.ts +1 -0
  100. package/dist/commands/get-response/index.js +2 -0
  101. package/dist/commands/get-response/index.js.map +1 -0
  102. package/dist/commands/lock/index.d.ts +1 -0
  103. package/dist/commands/lock/index.js +2 -0
  104. package/dist/commands/lock/index.js.map +1 -0
  105. package/dist/commands/lock/lock.command.d.ts +18 -0
  106. package/dist/commands/lock/lock.command.js +31 -0
  107. package/dist/commands/lock/lock.command.js.map +1 -0
  108. package/dist/commands/run-action/index.d.ts +1 -0
  109. package/dist/commands/run-action/index.js +2 -0
  110. package/dist/commands/run-action/index.js.map +1 -0
  111. package/dist/commands/run-action/run-action.command.d.ts +12 -0
  112. package/dist/commands/run-action/run-action.command.js +40 -0
  113. package/dist/commands/run-action/run-action.command.js.map +1 -0
  114. package/dist/commands/unlock/index.d.ts +1 -0
  115. package/dist/commands/unlock/index.js +2 -0
  116. package/dist/commands/unlock/index.js.map +1 -0
  117. package/dist/commands/unlock/unlock.command.d.ts +18 -0
  118. package/dist/commands/unlock/unlock.command.js +35 -0
  119. package/dist/commands/unlock/unlock.command.js.map +1 -0
  120. package/dist/commands/validate/index.d.ts +1 -0
  121. package/dist/commands/validate/index.js +2 -0
  122. package/dist/commands/validate/index.js.map +1 -0
  123. package/dist/commands/validate/validate.command.d.ts +17 -0
  124. package/dist/commands/validate/validate.command.js +62 -0
  125. package/dist/commands/validate/validate.command.js.map +1 -0
  126. package/dist/index.js +20 -8
  127. package/dist/index.js.map +1 -1
  128. package/dist/resources/octo-v1.schema.json +108 -27
  129. package/dist/utilities/definition/yaml/yaml-definition.utility.d.ts +103 -13
  130. package/dist/utilities/definition/yaml/yaml-definition.utility.js +215 -68
  131. package/dist/utilities/definition/yaml/yaml-definition.utility.js.map +1 -1
  132. package/dist/utilities/octo/octo.utility.d.ts +65 -0
  133. package/dist/utilities/octo/octo.utility.js +178 -0
  134. package/dist/utilities/octo/octo.utility.js.map +1 -0
  135. package/dist/utilities/process/process.utility.d.ts +8 -0
  136. package/dist/utilities/process/process.utility.js +8 -0
  137. package/dist/utilities/process/process.utility.js.map +1 -1
  138. package/dist/utilities/project-index/project-index.utility.d.ts +27 -0
  139. package/dist/utilities/project-index/project-index.utility.js +71 -0
  140. package/dist/utilities/project-index/project-index.utility.js.map +1 -0
  141. package/dist/utilities/string/string.utility.d.ts +22 -0
  142. package/dist/utilities/string/string.utility.js +27 -0
  143. package/dist/utilities/string/string.utility.js.map +1 -1
  144. package/package.json +11 -8
  145. package/dist/commands/create-cdk/create-cdk.command.js +0 -70
  146. package/dist/commands/create-cdk/create-cdk.command.js.map +0 -1
  147. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.d.ts +0 -10
  148. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js +0 -107
  149. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js.map +0 -1
  150. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/README.md.ejs +0 -23
  151. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/eslint.config.js.ejs +0 -337
  152. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitignore.ejs +0 -82
  153. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitkeep.ejs +0 -0
  154. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/package.json.ejs +0 -57
  155. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/prettierrc.ejs +0 -5
  156. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.schema.ts.ejs +0 -19
  157. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.ts.ejs +0 -17
  158. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/factories/dummy-credentials.factory.ts.ejs +0 -28
  159. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.spec.ts.ejs +0 -90
  160. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.ts.ejs +0 -16
  161. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.schema.ts.ejs +0 -10
  162. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.ts.ejs +0 -3
  163. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/actions/add-dummy-app.model.action.ts.ejs +0 -59
  164. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/index.ts.ejs +0 -1
  165. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/actions/add-http-fetch.resource.action.ts.ejs +0 -55
  166. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/http-fetch.resource.ts.ejs +0 -12
  167. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.schema.ts.ejs +0 -35
  168. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.ts.ejs +0 -3
  169. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/utilities/dummy/dummy.utility.ts.ejs +0 -11
  170. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.build.json.ejs +0 -11
  171. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.json.ejs +0 -39
  172. package/dist/commands/create-cdk/index.d.ts +0 -1
  173. package/dist/commands/create-cdk/index.js +0 -2
  174. package/dist/commands/create-cdk/index.js.map +0 -1
  175. package/dist/commands/create-resource/create-resource.command.js.map +0 -1
  176. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.js.map +0 -1
  177. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/update-tags.resource.action.ts.ejs +0 -86
  178. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/validate.resource.action.ts.ejs +0 -40
  179. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +0 -12
  180. package/dist/commands/create-resource/index.d.ts +0 -1
  181. package/dist/commands/create-resource/index.js +0 -2
  182. package/dist/commands/create-resource/index.js.map +0 -1
  183. package/dist/commands/run/index.d.ts +0 -1
  184. package/dist/commands/run/index.js +0 -2
  185. package/dist/commands/run/index.js.map +0 -1
  186. package/dist/commands/run/run.command.d.ts +0 -11
  187. package/dist/commands/run/run.command.js +0 -96
  188. package/dist/commands/run/run.command.js.map +0 -1
  189. package/dist/commands/state/index.d.ts +0 -1
  190. package/dist/commands/state/index.js +0 -2
  191. package/dist/commands/state/index.js.map +0 -1
  192. package/dist/commands/state/state.command.d.ts +0 -14
  193. package/dist/commands/state/state.command.js +0 -79
  194. package/dist/commands/state/state.command.js.map +0 -1
  195. /package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/index.schema.ts.ejs +0 -0
package/README.md CHANGED
@@ -1,13 +1,122 @@
1
1
  # Octo
2
- http://octo.quadnix.com/
3
2
 
4
- The open-source infrastructure management and CICD tool.
3
+ Infrastructure as code written as intent: you describe an app and what it needs, modules turn that
4
+ into Terraform, and your own Terragrunt applies it. Users start at
5
+ [octo.quadnix.com](https://octo.quadnix.com/).
5
6
 
6
- > Disclaimer,
7
- > This library is still under development and is currently in version `0.x.x`.
8
- > We plan to release version `1.x.x` when it is deemed ready for production use.
7
+ > Octo is in `0.x`. Version `1.x` will mark it ready for production.
9
8
 
10
- # Local Setup
11
- > npm install
9
+ **This README is a set of procedures for working on the repository.** `docs/ARCHITECTURE.md`
10
+ explains what exists, and `docs/CODING-STANDARDS.md` how to add to it.
12
11
 
13
- > npm run prepare
12
+ Requires Node 20 or newer, Terraform or OpenTofu 1.6 or newer, and Terragrunt 0.78 or newer. The
13
+ integration suites also need Docker, and the e2e suites AWS credentials.
14
+
15
+ ---
16
+
17
+ ## A — Set up this machine
18
+
19
+ Once.
20
+
21
+ ```sh
22
+ corepack enable
23
+ pnpm install
24
+ pnpm run prepare
25
+ ```
26
+
27
+ `prepare` installs the pre-commit hook, which runs the format check, lint, the build with its type
28
+ check, the circular-dependency check, the secrets spec and the docs code-block check.
29
+
30
+ ## B — Build, lint and test
31
+
32
+ ```sh
33
+ pnpm run build
34
+ pnpm run lint
35
+ pnpm test
36
+ ```
37
+
38
+ `octo-aws-cdk`, `octo-event-listeners`, `octo-build` and `octo-templates` import `octo` from its
39
+ `dist`, and `octo-templates` imports `octo-aws-cdk` the same way. **Rebuild what you changed before
40
+ testing what depends on it**, or the suite runs against the old code and still passes.
41
+
42
+ `pnpm run build` also type-checks every package, tests included, through each package's
43
+ `check:types`.
44
+
45
+ `pnpm run format` writes what `pnpm run format:check` checks. Lint does not check formatting.
46
+
47
+ `pnpm run lint:fix` sorts imports, members and keys. A flag passed through `pnpm run` is written
48
+ without `--`: pnpm forwards the separator, and the script then drops the flag.
49
+
50
+ ## C — Run integration tests
51
+
52
+ Integration specs run real Terraform; `octo-templates`' start LocalStack in Docker.
53
+
54
+ ```sh
55
+ pnpm run test:integration
56
+ ```
57
+
58
+ ## D — Run an e2e suite
59
+
60
+ **Every e2e suite reaches a live AWS account.** `octo-aws-cdk`'s plan and apply nothing;
61
+ `octo-templates`' create real resources and tear them down.
62
+
63
+ 1. Copy the `.env.defaults` beside the suite to `.env` and fill in real values. `.env` is ignored.
64
+ 2. Build the packages the suite imports:
65
+
66
+ ```sh
67
+ npx nx run-many -t build --projects=octo,octo-event-listeners,octo-aws-cdk
68
+ ```
69
+
70
+ 3. Run one spec, by path, from its package:
71
+
72
+ ```sh
73
+ cd packages/octo-templates
74
+ NODE_OPTIONS=--experimental-vm-modules npx jest --runTestsByPath src/<template>/main.e2e-spec.ts
75
+ ```
76
+
77
+ Never `pnpm run test:e2e` — it runs every suite live at once. Never combine `-u` with `-t`: jest then
78
+ deletes the snapshots of every test it skipped. A template's own `README.md`, where it has one,
79
+ holds what is particular to it.
80
+
81
+ ## E — Work in a worktree
82
+
83
+ For a large change or a hands-free agent run:
84
+
85
+ ```sh
86
+ git worktree add ../ai-worktrees/octo-worktree-<branch> -b ai/<branch>
87
+ WORKTREE=../ai-worktrees/octo-worktree-<branch>
88
+ find . -maxdepth 4 -name node_modules -type d ! -path "*/node_modules/*/node_modules" | \
89
+ while read src; do
90
+ mkdir -p "$WORKTREE/$(dirname $src)"
91
+ ln -s "$(pwd)/$src" "$WORKTREE/$src"
92
+ done
93
+ ```
94
+
95
+ The symlinks let Nx and Jest resolve packages. Run lint and tests from inside the worktree.
96
+
97
+ ## F — Release
98
+
99
+ 1. Merge to `main` with PR titles per `.github/jobs/validate-pr-title.job.sh`. The commit type sets
100
+ the bump: `chore` releases nothing.
101
+ 2. Run the **Manual Release** workflow on `main`. It versions every changed package, tags, writes
102
+ the changelog, and publishes to npm.
103
+
104
+ ## Environment variables
105
+
106
+ Everything outside the code that governs how this repository behaves. A suite's `.env` is read
107
+ through `env-smart`, falling back to the `.env.defaults` beside it.
108
+
109
+ | Variable | Set by | What it does |
110
+ |-----------------------------------------------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
111
+ | `AWS_ACCOUNT_ID` | a suite's `.env` | The account every e2e suite plans or applies into. |
112
+ | `AWS_REGION_ID` | `packages/octo-aws-cdk/test/.env` | The region the module e2es plan into. Template suites hardcode `us-east-1`. |
113
+ | `OCTO_DEFINITION_FILE_PATH` | the user, or a `create-app` project's scripts | The `octo.yaml` every lifecycle command boots from. `OctoCliUtility` sets it for the CLI-driven template suites. A relative path is resolved once against the working directory, so `run-action` callbacks find it. |
114
+ | `OCTO_JOURNAL_COMMAND_ID` | `JournalEventListener` | The running command's id, set for every process it starts, so a `run-action` that Terraform starts mid-apply names that apply as `parentCommandId` in its journal. |
115
+ | `TF_VAR_OCTO_PROJECT_ROOT` | `TerraformUtility`, unless already set | The working directory, so `terraform.localPath()` paths resolve inside Terragrunt's cache copy of a folder. |
116
+ | `TG_LOG_CUSTOM_FORMAT` | `TerraformUtility`, always | Terragrunt's log line layout, its default without the time, since the journal records when each line arrived. |
117
+ | `TG_LOG_FORMAT` | `TerraformUtility`, always unset | Unset for every Terragrunt process, so it cannot override `TG_LOG_CUSTOM_FORMAT`. |
118
+ | `TG_PROVIDER_CACHE` | `TerraformUtility`, unless already set | `1`, so Terragrunt shares one provider cache across folders. |
119
+ | `TG_TF_PATH` | `TerraformUtility`, from `--terraformBinary` | Which Terraform or OpenTofu binary Terragrunt runs. |
120
+ | `NODE_OPTIONS` | every package's test scripts | `--experimental-vm-modules`, which Jest needs to run ESM. Set it yourself when running `jest` directly. |
121
+ | `OCTO_STAGE`, `OCTO_PHASE`, `OCTO_NAT`, `OCTO_TARGET`, `OCTO_WORK`, `OCTO_CASE`, `OCTO_PROBE_STATE` | you, by hand | Drive the `aws-ecs-server` debugging harnesses; that template's `README.md` describes each. |
122
+ | `GH_TOKEN` | a repository secret | Checkout and push in **Manual Release**, and the tags and GitHub releases `nx release` creates. |
@@ -0,0 +1,25 @@
1
+ import type { ArgumentsCamelCase, Argv } from 'yargs';
2
+ type ApplyCommandArguments = {
3
+ autoApprove?: boolean;
4
+ lockId: string;
5
+ terraformBinary?: string;
6
+ terragruntBinary?: string;
7
+ terragruntDir: string;
8
+ timeoutInMs?: number;
9
+ };
10
+ /**
11
+ * Step 3 of the octo lifecycle, and the only one that changes live infrastructure.
12
+ *
13
+ * Unlike generate and validate, this is a terraform action rather than an octo mode - it composes no
14
+ * model graph and reads no model or resource state. What it does need is the state provider, both
15
+ * because terraform's own state is checked out of it before every terraform command and back in
16
+ * after, and because this is one of the two commands that require the app lock. It refuses to run
17
+ * when the plan would destroy anything, unless `--auto-approve` is passed.
18
+ */
19
+ export declare const applyCommand: {
20
+ builder: (yargs: Argv) => Argv;
21
+ command: string;
22
+ describe: string;
23
+ handler: (argv: ArgumentsCamelCase<ApplyCommandArguments>) => Promise<void>;
24
+ };
25
+ export {};
@@ -0,0 +1,130 @@
1
+ import { resolve } from 'path';
2
+ import { Container, StateManagementService, TerraformUtility } from '@quadnix/octo';
3
+ import chalk from 'chalk';
4
+ import { OctoUtility } from '../../utilities/octo/octo.utility.js';
5
+ /**
6
+ * Plans the directory and prints anything the apply would destroy, marking each destroy of a resource
7
+ * the last commit recorded as losing data.
8
+ *
9
+ * Returns why the apply must not proceed: something would be destroyed, or a folder would not plan and
10
+ * so nothing can be said about what it would destroy. Returns `undefined` when it may.
11
+ */
12
+ async function findDestroyRefusal(terraformUtility, stateManagementService, resolvedDir) {
13
+ const { errors, plans } = await terraformUtility.plan(resolvedDir, { json: true });
14
+ if (errors.size > 0) {
15
+ for (const [moduleId, error] of errors.entries()) {
16
+ console.error(chalk.red(`ERROR [${moduleId}] Terraform failed to plan:\n${error}`));
17
+ }
18
+ return ('Cannot check this apply for destroys because the folders above would not plan. ' +
19
+ 'Fix them, or pass --auto-approve to apply anyway!');
20
+ }
21
+ const destroys = terraformUtility.findPlannedDestroys(plans);
22
+ if (destroys.length === 0) {
23
+ return undefined;
24
+ }
25
+ // Find the addresses whose destroy loses data.
26
+ const { userData } = await stateManagementService.getResourceState(stateManagementService.actualResourceStateFileName);
27
+ const dataLossAddresses = new Set((userData.terraformResources ?? [])
28
+ .filter((mapping) => mapping.destroyLosesData)
29
+ .flatMap((mapping) => mapping.terraformAddresses.map((address) => `${mapping.moduleId} ${address}`)));
30
+ console.error(chalk.red('This apply would DESTROY:'));
31
+ for (const destroy of destroys.sort((a, b) => a.address.localeCompare(b.address))) {
32
+ const dataLoss = dataLossAddresses.has(`${destroy.moduleId} ${destroy.address}`)
33
+ ? ' - the data it holds is lost with it'
34
+ : '';
35
+ console.error(chalk.red(` [${destroy.moduleId}] ${destroy.address} (${destroy.tfActions.join(', ')})${dataLoss}`));
36
+ }
37
+ return ('Refusing to apply. Run "octo validate" to see why each of these is being destroyed, ' +
38
+ 'then re-run with --auto-approve to proceed!');
39
+ }
40
+ /**
41
+ * Step 3 of the octo lifecycle, and the only one that changes live infrastructure.
42
+ *
43
+ * Unlike generate and validate, this is a terraform action rather than an octo mode - it composes no
44
+ * model graph and reads no model or resource state. What it does need is the state provider, both
45
+ * because terraform's own state is checked out of it before every terraform command and back in
46
+ * after, and because this is one of the two commands that require the app lock. It refuses to run
47
+ * when the plan would destroy anything, unless `--auto-approve` is passed.
48
+ */
49
+ export const applyCommand = {
50
+ builder: (yargs) => {
51
+ return yargs
52
+ .option('terragruntDir', {
53
+ demandOption: true,
54
+ description: 'The generated Terragrunt directory to apply.',
55
+ type: 'string',
56
+ })
57
+ .option('lockId', {
58
+ demandOption: true,
59
+ description: 'The app lock ID from `octo lock`. Applying without the lock is refused.',
60
+ type: 'string',
61
+ })
62
+ .option('autoApprove', {
63
+ default: false,
64
+ demandOption: false,
65
+ description: 'Apply without first checking the plan for destroys. Required to destroy anything.',
66
+ type: 'boolean',
67
+ })
68
+ .option('terraformBinary', {
69
+ demandOption: false,
70
+ description: 'Override the terraform/tofu binary terragrunt should invoke (sets TG_TF_PATH).',
71
+ type: 'string',
72
+ })
73
+ .option('terragruntBinary', {
74
+ demandOption: false,
75
+ description: 'Override the terragrunt binary/path to invoke.',
76
+ type: 'string',
77
+ })
78
+ .option('timeoutInMs', {
79
+ demandOption: false,
80
+ description: 'Override the per-command timeout, in milliseconds.',
81
+ type: 'number',
82
+ });
83
+ },
84
+ command: 'apply',
85
+ describe: 'Step 3: apply the generated Terraform in the Terragrunt directory.',
86
+ handler: async (argv) => {
87
+ const { autoApprove, lockId, terraformBinary, terragruntBinary, terragruntDir, timeoutInMs } = argv;
88
+ const resolvedDir = resolve(process.cwd(), terragruntDir);
89
+ OctoUtility.prepareCallbackEnvironment();
90
+ await OctoUtility.runCommand('apply', async () => {
91
+ const { stateCheckInIntervalInMs } = await OctoUtility.bootStateProvider();
92
+ // The lock is verified before anything is planned, so a run without it fails having done
93
+ // nothing. It is released by `octo commit`, not here - the apply is the middle of a run.
94
+ const stateManagementService = await Container.getInstance().get(StateManagementService);
95
+ if (!(await stateManagementService.isAppLocked(lockId))) {
96
+ throw new Error('App is not locked! Run "octo lock" first.');
97
+ }
98
+ const terraformUtility = await Container.getInstance().get(TerraformUtility, {
99
+ args: [{ stateCheckInIntervalInMs, terraformBinary, terragruntBinary, timeoutInMs }, true],
100
+ });
101
+ // The underlying apply runs `-auto-approve` and validate is optional, so without an explicit
102
+ // opt-in, plan first and refuse to destroy anything the user has not been shown. What is at
103
+ // stake is the data inside a resource terraform recreates; octo's own state stays consistent
104
+ // either way.
105
+ const refusal = autoApprove
106
+ ? undefined
107
+ : await findDestroyRefusal(terraformUtility, stateManagementService, resolvedDir);
108
+ if (refusal !== undefined) {
109
+ throw new Error(refusal);
110
+ }
111
+ else {
112
+ // Terragrunt's output goes out as events as it is written, which the listeners print and record.
113
+ try {
114
+ await terraformUtility.apply(resolvedDir);
115
+ }
116
+ catch (error) {
117
+ // An apply that got this far may have built some of what was asked for, and only a commit
118
+ // records that. The rule belongs here rather than in every pipeline that calls this: the
119
+ // apply is what knows it failed, and it is the one step after which the choice is not
120
+ // obvious.
121
+ console.error(chalk.red(`\nThis apply may have built part of what you asked for. Run "octo commit --partial ` +
122
+ `--terragruntDir ${terragruntDir} --lockId ${lockId}" to record that and release the lock, then fix ` +
123
+ 'what failed and run again.'));
124
+ throw error;
125
+ }
126
+ }
127
+ });
128
+ },
129
+ };
130
+ //# sourceMappingURL=apply.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.command.js","sourceRoot":"","sources":["../../../src/commands/apply/apply.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAWnE;;;;;;GAMG;AACH,KAAK,UAAU,kBAAkB,CAC/B,gBAAkC,EAClC,sBAA8C,EAC9C,WAAmB;IAEnB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,gBAAgB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,MAAM,kBAAkB,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,WAAW,CAAC,CAAC;YACpF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;iBAAM,CAAC;gBACN,iGAAiG;gBACjG,IAAI,CAAC;oBACH,MAAM,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBAC5C,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,0FAA0F;oBAC1F,yFAAyF;oBACzF,sFAAsF;oBACtF,WAAW;oBACX,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CACP,qFAAqF;wBACnF,mBAAmB,aAAa,aAAa,MAAM,kDAAkD;wBACrG,4BAA4B,CAC/B,CACF,CAAC;oBACF,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1 @@
1
+ export { applyCommand } from './apply.command.js';
@@ -0,0 +1,2 @@
1
+ export { applyCommand } from './apply.command.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/apply/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
@@ -5,10 +5,10 @@ export declare const buildCommand: {
5
5
  describe: string;
6
6
  handler: (argv: ArgumentsCamelCase<{
7
7
  buildFilePath: string;
8
- sourcePath: string;
9
8
  concurrency: number;
10
9
  dryRun: boolean;
11
10
  logsDir: string;
11
+ sourcePath: string;
12
12
  timeout: number;
13
13
  }>) => Promise<void>;
14
14
  };
@@ -59,7 +59,7 @@ export const buildCommand = {
59
59
  logsDir = !logsDir || logsDir.toLowerCase() === 'false' ? undefined : resolve(logsDir);
60
60
  // Ensure build file exists.
61
61
  if (!existsSync(buildFilePath)) {
62
- console.log(chalk.red('Cannot find build file: ' + buildFilePath));
62
+ console.error(chalk.red('Cannot find build file: ' + buildFilePath));
63
63
  process.exit(1);
64
64
  }
65
65
  // Ensure logsDir exists, and is writable.
@@ -69,7 +69,7 @@ export const buildCommand = {
69
69
  }
70
70
  }
71
71
  catch (error) {
72
- console.log(chalk.red("Logs directory doesn't exist, or is not writable: " + logsDir));
72
+ console.error(chalk.red("Logs directory doesn't exist, or is not writable: " + logsDir));
73
73
  process.exit(1);
74
74
  }
75
75
  // Prepare args.
@@ -87,7 +87,7 @@ export const buildCommand = {
87
87
  json = load(readFileSync(buildFilePath, 'utf-8'));
88
88
  }
89
89
  catch (error) {
90
- console.log(chalk.red('Unable to parse build file: ' + error.message));
90
+ console.error(chalk.red('Unable to parse build file: ' + error.message));
91
91
  throw error;
92
92
  }
93
93
  const buildConfiguration = BuildFileParser.parse(json);
@@ -97,7 +97,7 @@ export const buildCommand = {
97
97
  console.log(chalk.green('Success'));
98
98
  }
99
99
  catch (error) {
100
- console.log(chalk.red(error));
100
+ console.error(chalk.red(error));
101
101
  }
102
102
  },
103
103
  };
@@ -1 +1 @@
1
- {"version":3,"file":"build.command.js","sourceRoot":"","sources":["../../../src/commands/build/build.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,CAAC,KAAW,EAAQ,EAAE;QAC7B,OAAO,KAAK;aACT,MAAM,CAAC,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C,CAAC;YACzE,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,kBAAkB,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;YAChD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -1,16 +1,38 @@
1
1
  import type { ChildProcessWithoutNullStreams } from 'child_process';
2
2
  import type { IBuildConfiguration } from './models/build-configuration.interface.js';
3
3
  import type { IRunArguments } from './models/run-arguments.interface.js';
4
+ /**
5
+ * @internal
6
+ */
7
+ /**
8
+ * Runs the jobs of a `build.yml`, respecting their dependencies and the concurrency limit.
9
+ */
4
10
  export declare class Main {
5
11
  private readonly args;
6
12
  private readonly configuration;
13
+ /**
14
+ * @param args The parsed CLI arguments.
15
+ * @param configuration The parsed build file.
16
+ */
7
17
  constructor(args: IRunArguments, configuration: IBuildConfiguration);
18
+ /**
19
+ * Spawns one command.
20
+ *
21
+ * @returns The child process, and a promise that settles when it exits - rejecting on a non-zero
22
+ * exit code.
23
+ */
8
24
  runCommand(command: string, options: {
9
25
  env: {
10
26
  [key: string]: string;
11
27
  };
12
28
  sourcePath: string;
13
29
  }): [ChildProcessWithoutNullStreams, Promise<void>];
30
+ /**
31
+ * Starts every job, each waiting on the jobs it depends on, and no more than `concurrency` at once.
32
+ */
14
33
  scheduleJobs(): Promise<void>[];
34
+ /**
35
+ * Runs the whole build, rejecting on the first job that fails or when the timeout elapses.
36
+ */
15
37
  start(): Promise<void>;
16
38
  }
@@ -3,11 +3,27 @@ import { join, resolve } from 'path';
3
3
  import pLimit from 'p-limit';
4
4
  import { ProcessUtility } from '../../utilities/process/process.utility.js';
5
5
  import { StreamManager } from './streams/stream-manager.js';
6
+ /**
7
+ * @internal
8
+ */
9
+ /**
10
+ * Runs the jobs of a `build.yml`, respecting their dependencies and the concurrency limit.
11
+ */
6
12
  export class Main {
13
+ /**
14
+ * @param args The parsed CLI arguments.
15
+ * @param configuration The parsed build file.
16
+ */
7
17
  constructor(args, configuration) {
8
18
  this.args = args;
9
19
  this.configuration = configuration;
10
20
  }
21
+ /**
22
+ * Spawns one command.
23
+ *
24
+ * @returns The child process, and a promise that settles when it exits - rejecting on a non-zero
25
+ * exit code.
26
+ */
11
27
  runCommand(command, options) {
12
28
  const spawnProcessOptions = { cwd: options.sourcePath, env: options.env, shell: true };
13
29
  const runner = ProcessUtility.runDetachedProcess(command, spawnProcessOptions, 'pipe');
@@ -33,6 +49,9 @@ export class Main {
33
49
  });
34
50
  return [runner, promiseToFinishCommand];
35
51
  }
52
+ /**
53
+ * Starts every job, each waiting on the jobs it depends on, and no more than `concurrency` at once.
54
+ */
36
55
  scheduleJobs() {
37
56
  const streamManager = new StreamManager();
38
57
  const timestamp = Date.now();
@@ -102,6 +121,9 @@ export class Main {
102
121
  }
103
122
  return Object.values(jobPromises);
104
123
  }
124
+ /**
125
+ * Runs the whole build, rejecting on the first job that fails or when the timeout elapses.
126
+ */
105
127
  start() {
106
128
  return new Promise(async (resolve, reject) => {
107
129
  const timeout = this.args.timeout > 0
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/commands/build/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC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,CAAC,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;gBACnE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;gBACvB,CAAC,CAAC,SAAS,CAAC;YAEhB,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;gBACxC,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBAC/B,OAAO,EAAE,CAAC;YACZ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;oBAAS,CAAC;gBACT,IAAI,OAAO,EAAE,CAAC;oBACZ,YAAY,CAAC,OAAO,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,4 +1,10 @@
1
1
  import type { IBuildConfiguration } from '../models/build-configuration.interface.js';
2
+ /**
3
+ * Reads a `build.yml` into the configuration {@link Main} runs.
4
+ */
2
5
  export declare class BuildFileParser {
6
+ /**
7
+ * @throws If a job names a dependency that does not exist, or the jobs form a cycle.
8
+ */
3
9
  static parse(content: any): IBuildConfiguration;
4
10
  }
@@ -1,4 +1,10 @@
1
+ /**
2
+ * Reads a `build.yml` into the configuration {@link Main} runs.
3
+ */
1
4
  export class BuildFileParser {
5
+ /**
6
+ * @throws If a job names a dependency that does not exist, or the jobs form a cycle.
7
+ */
2
8
  static parse(content) {
3
9
  const jobs = {};
4
10
  for (const jobName of Object.keys(content?.jobs || {})) {
@@ -1 +1 @@
1
- {"version":3,"file":"build-file.parser.js","sourceRoot":"","sources":["../../../../src/commands/build/parsers/build-file.parser.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;IAC1B,MAAM,CAAC,KAAK,CAAC,OAAY;QACvB,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;YACvD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;YAED,IAAI,CAAC,OAAO,CAAC,GAAG;gBACd,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE;gBAC9B,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,OAAO;gBAC9C,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAC7B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;aAClC,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE;YACzB,GAAG,EACD,OAAO,EAAE,GAAG,EAAE,SAAS;gBACvB,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ;gBACzC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;gBAC3C,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS;gBACvB,CAAC,CAAC,EAAE;YACR,IAAI;SACL,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"build-file.parser.js","sourceRoot":"","sources":["../../../../src/commands/build/parsers/build-file.parser.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,OAAY;QACvB,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;YACvD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;YAED,IAAI,CAAC,OAAO,CAAC,GAAG;gBACd,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE;gBAC9B,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,OAAO;gBAC9C,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAC7B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;aAClC,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE;YACzB,GAAG,EACD,OAAO,EAAE,GAAG,EAAE,SAAS;gBACvB,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ;gBACzC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;gBAC3C,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS;gBACvB,CAAC,CAAC,EAAE;YACR,IAAI;SACL,CAAC;IACJ,CAAC;CACF"}
@@ -1,6 +1,12 @@
1
1
  import type { ChildProcessWithoutNullStreams } from 'child_process';
2
+ /**
3
+ * Fans each job's output to the terminal, and to a per-job log file when one was asked for.
4
+ */
2
5
  export declare class StreamManager {
3
6
  private colors;
7
+ /**
8
+ * Attaches to a running job's output.
9
+ */
4
10
  registerStream(jobName: string, stream: ChildProcessWithoutNullStreams, options: {
5
11
  logsPathPrefix?: string;
6
12
  }): void;
@@ -1,6 +1,9 @@
1
1
  import { createWriteStream } from 'fs';
2
2
  import { join, resolve } from 'path';
3
3
  import chalk, {} from 'chalk';
4
+ /**
5
+ * Fans each job's output to the terminal, and to a per-job log file when one was asked for.
6
+ */
4
7
  export class StreamManager {
5
8
  constructor() {
6
9
  this.colors = {
@@ -11,6 +14,9 @@ export class StreamManager {
11
14
  YELLOW: chalk.yellow,
12
15
  };
13
16
  }
17
+ /**
18
+ * Attaches to a running job's output.
19
+ */
14
20
  registerStream(jobName, stream, options) {
15
21
  const colorKeys = Object.keys(this.colors);
16
22
  const randomColor = this.colors[colorKeys[(colorKeys.length * Math.random()) << 0]];
@@ -18,7 +24,7 @@ export class StreamManager {
18
24
  console.log(randomColor(data.toString()));
19
25
  });
20
26
  stream.stderr.on('error', (error) => {
21
- console.log(chalk.red(error));
27
+ console.error(chalk.red(error));
22
28
  });
23
29
  stream.on('close', () => {
24
30
  stream.removeAllListeners();
@@ -1 +1 @@
1
- {"version":3,"file":"stream-manager.js","sourceRoot":"","sources":["../../../../src/commands/build/streams/stream-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAElD,MAAM,OAAO,aAAa;IAA1B;QACU,WAAM,GAAG;YACf,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC;IAwBJ,CAAC;IAtBC,cAAc,CAAC,OAAe,EAAE,MAAsC,EAAE,OAAoC;QAC1G,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,WAAW,GAA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AAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ import type { ArgumentsCamelCase, Argv } from 'yargs';
2
+ type CommitCommandArguments = {
3
+ lockId: string;
4
+ partial?: boolean;
5
+ terraformBinary?: string;
6
+ terragruntBinary?: string;
7
+ terragruntDir: string;
8
+ timeoutInMs?: number;
9
+ };
10
+ /**
11
+ * Step 4 of the octo lifecycle. See `Octo.commit()`.
12
+ *
13
+ * This is the command that ends a run, so a commit that succeeds releases the app lock. One that
14
+ * fails keeps it, and is run again with the same lock ID. Octo never unlocks on its own; the lock is
15
+ * the CLI's to take and to drop.
16
+ */
17
+ export declare const commitCommand: {
18
+ builder: (yargs: Argv) => Argv;
19
+ command: string;
20
+ describe: string;
21
+ handler: (argv: ArgumentsCamelCase<CommitCommandArguments>) => Promise<void>;
22
+ };
23
+ export {};