@quadnix/octo-build 0.0.17 → 0.1.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 +25 -3
  3. package/dist/commands/apply/apply.command.d.ts +25 -0
  4. package/dist/commands/apply/apply.command.js +136 -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 +22 -0
  22. package/dist/commands/commit/commit.command.js +94 -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 +59 -12
  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 +60 -10
  40. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/gitignore.ejs +13 -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 +14 -0
  45. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-s3-website/octo.yaml.ejs +14 -0
  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 +3 -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 +14 -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 +13 -0
  106. package/dist/commands/lock/lock.command.js +28 -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 +46 -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 +51 -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 +68 -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 +86 -19
  129. package/dist/utilities/definition/yaml/yaml-definition.utility.d.ts +98 -10
  130. package/dist/utilities/definition/yaml/yaml-definition.utility.js +197 -66
  131. package/dist/utilities/definition/yaml/yaml-definition.utility.js.map +1 -1
  132. package/dist/utilities/octo/octo.utility.d.ts +48 -0
  133. package/dist/utilities/octo/octo.utility.js +144 -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 +9 -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,5 +1,6 @@
1
1
  # Octo
2
- http://octo.quadnix.com/
2
+
3
+ https://octo.quadnix.com/
3
4
 
4
5
  The open-source infrastructure management and CICD tool.
5
6
 
@@ -8,6 +9,27 @@ The open-source infrastructure management and CICD tool.
8
9
  > We plan to release version `1.x.x` when it is deemed ready for production use.
9
10
 
10
11
  # Local Setup
11
- > npm install
12
12
 
13
- > npm run prepare
13
+ ## Prerequisites
14
+
15
+ - [Node.js](https://nodejs.org) 22 (LTS). This ships with Corepack, which provisions the
16
+ exact package manager the project expects — you do **not** need to install pnpm yourself.
17
+
18
+ ## Install
19
+
20
+ This repository is a [pnpm](https://pnpm.io) workspace. Corepack reads the `packageManager`
21
+ field in the root `package.json` and uses the pnpm version pinned there, so everyone (and CI)
22
+ runs the same version.
23
+
24
+ ```sh
25
+ # One-time per machine: activate Corepack so the `pnpm` command uses the pinned version.
26
+ corepack enable
27
+
28
+ # Install all workspace dependencies (packages/*).
29
+ pnpm install
30
+ ```
31
+
32
+ > **Note:** The documentation site under `apps/octo-docs` is an intentionally separate
33
+ > project — it consumes the published `@quadnix/*` packages from the registry rather than the
34
+ > local source. It is not part of the root workspace and is only installed (with its own
35
+ > `pnpm install`, run from inside that directory) when you are working on the docs.
@@ -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,136 @@
1
+ import { resolve } from 'path';
2
+ import { Container, StateManagementService, TerraformUtility } from '@quadnix/octo';
3
+ import chalk from 'chalk';
4
+ import { bootStateProvider, prepareCallbackEnvironment, reportError } from '../../utilities/octo/octo.utility.js';
5
+ /**
6
+ * Plans the directory and prints anything the apply would destroy.
7
+ *
8
+ * Returns true when the apply must not proceed: something would be destroyed, or a folder would not
9
+ * plan and so nothing can be said about what it would destroy.
10
+ */
11
+ async function isBlockedByDestroys(terraformUtility, resolvedDir) {
12
+ const { errors, plans } = await terraformUtility.plan(resolvedDir, { json: true });
13
+ if (errors.size > 0) {
14
+ for (const [moduleId, error] of errors.entries()) {
15
+ console.error(chalk.red(`ERROR [${moduleId}] Terraform failed to plan:\n${error}`));
16
+ }
17
+ console.error(chalk.red('\nCannot check this apply for destroys because the folders above would not plan. ' +
18
+ 'Fix them, or pass --auto-approve to apply anyway.'));
19
+ return true;
20
+ }
21
+ const destroys = terraformUtility.findPlannedDestroys(plans);
22
+ if (destroys.length === 0) {
23
+ return false;
24
+ }
25
+ console.error(chalk.red('This apply would DESTROY:'));
26
+ for (const destroy of destroys.sort((a, b) => a.address.localeCompare(b.address))) {
27
+ console.error(chalk.red(` [${destroy.moduleId}] ${destroy.address} (${destroy.tfActions.join(', ')})`));
28
+ }
29
+ console.error(chalk.red('\nRefusing to apply. Run "octo validate" to see why each of these is being destroyed, ' +
30
+ 'then re-run with --auto-approve to proceed.'));
31
+ return true;
32
+ }
33
+ /**
34
+ * Step 3 of the octo lifecycle, and the only one that changes live infrastructure.
35
+ *
36
+ * Unlike generate and validate, this is a terraform action rather than an octo mode - it composes no
37
+ * model graph and reads no model or resource state. What it does need is the state provider, both
38
+ * because terraform's own state is checked out of it before every terraform command and back in
39
+ * after, and because this is one of the two commands that require the app lock. It refuses to run
40
+ * when the plan would destroy anything, unless `--auto-approve` is passed.
41
+ */
42
+ export const applyCommand = {
43
+ builder: (yargs) => {
44
+ return yargs
45
+ .option('terragruntDir', {
46
+ demandOption: true,
47
+ description: 'The generated Terragrunt directory to apply.',
48
+ type: 'string',
49
+ })
50
+ .option('lockId', {
51
+ demandOption: true,
52
+ description: 'The app lock ID from `octo lock`. Applying without the lock is refused.',
53
+ type: 'string',
54
+ })
55
+ .option('autoApprove', {
56
+ default: false,
57
+ demandOption: false,
58
+ description: 'Apply without first checking the plan for destroys. Required to destroy anything.',
59
+ type: 'boolean',
60
+ })
61
+ .option('terraformBinary', {
62
+ demandOption: false,
63
+ description: 'Override the terraform/tofu binary terragrunt should invoke (sets TG_TF_PATH).',
64
+ type: 'string',
65
+ })
66
+ .option('terragruntBinary', {
67
+ demandOption: false,
68
+ description: 'Override the terragrunt binary/path to invoke.',
69
+ type: 'string',
70
+ })
71
+ .option('timeoutInMs', {
72
+ demandOption: false,
73
+ description: 'Override the per-command timeout, in milliseconds.',
74
+ type: 'number',
75
+ });
76
+ },
77
+ command: 'apply',
78
+ describe: 'Step 3: apply the generated Terraform in the Terragrunt directory.',
79
+ handler: async (argv) => {
80
+ const { autoApprove, lockId, terraformBinary, terragruntBinary, terragruntDir, timeoutInMs } = argv;
81
+ const resolvedDir = resolve(process.cwd(), terragruntDir);
82
+ prepareCallbackEnvironment();
83
+ try {
84
+ await bootStateProvider();
85
+ // The lock is verified before anything is planned, so a run without it fails having done
86
+ // nothing. It is released by `octo commit`, not here - the apply is the middle of a run.
87
+ const stateManagementService = await Container.getInstance().get(StateManagementService);
88
+ if (!(await stateManagementService.isAppLocked(lockId))) {
89
+ throw new Error('App is not locked! Run "octo lock" first.');
90
+ }
91
+ const terraformUtility = await Container.getInstance().get(TerraformUtility, {
92
+ args: [{ terraformBinary, terragruntBinary, timeoutInMs }, true],
93
+ });
94
+ // The underlying apply runs `-auto-approve` and validate is optional, so without an explicit
95
+ // opt-in, plan first and refuse to destroy anything the user has not been shown. What is at
96
+ // stake is the data inside a resource terraform recreates; octo's own state stays consistent
97
+ // either way.
98
+ if (!autoApprove && (await isBlockedByDestroys(terraformUtility, resolvedDir))) {
99
+ process.exit(1);
100
+ }
101
+ else {
102
+ // Streamed, not printed at the end: an ECS apply runs for tens of minutes, and terragrunt's
103
+ // own progress is the only sign it is alive. `apply` boots no octo and so has no listeners,
104
+ // which makes this the only writer here - nothing to interleave with.
105
+ try {
106
+ await terraformUtility.apply(resolvedDir, {
107
+ onOutput: (chunk, stream) => {
108
+ if (stream === 'stdout') {
109
+ process.stdout.write(chunk);
110
+ }
111
+ else {
112
+ process.stderr.write(chunk);
113
+ }
114
+ },
115
+ });
116
+ }
117
+ catch (error) {
118
+ // An apply that got this far may have built some of what was asked for, and only a commit
119
+ // records that. The rule belongs here rather than in every pipeline that calls this: the
120
+ // apply is what knows it failed, and it is the one step after which the choice is not
121
+ // obvious.
122
+ console.error(chalk.red(`\nThis apply may have built part of what you asked for. Run "octo commit --partial ` +
123
+ `--terragruntDir ${terragruntDir} --lockId ${lockId}" to record that and release the lock, then fix ` +
124
+ 'what failed and run again.'));
125
+ throw error;
126
+ }
127
+ console.log(chalk.green('==== Apply complete ===='));
128
+ }
129
+ }
130
+ catch (error) {
131
+ reportError(error);
132
+ process.exit(1);
133
+ }
134
+ },
135
+ };
136
+ //# 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,iBAAiB,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAWlH;;;;;GAKG;AACH,KAAK,UAAU,mBAAmB,CAAC,gBAAkC,EAAE,WAAmB;IACxF,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAEnF,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YACjD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,QAAQ,gCAAgC,KAAK,EAAE,CAAC,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CACP,mFAAmF;YACjF,mDAAmD,CACtD,CACF,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CA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E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACN,4FAA4F;gBAC5F,4FAA4F;gBAC5F,sEAAsE;gBACtE,IAAI,CAAC;oBACH,MAAM,gBAAgB,CAAC,KAAK,CAAC,WAAW,EAAE;wBACxC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAQ,EAAE;4BAChC,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;gCACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;4BAC9B,CAAC;iCAAM,CAAC;gCACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;4BAC9B,CAAC;wBACH,CAAC;qBACF,CAAC,CAAC;gBACL,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;gBAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,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,EAA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,CAAC,GAAG,CAAC,oDAAoD,GAAG,OAAO,CAAC,CAAC,CAAC;YACvF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,gBAAgB;QAChB,MAAM,IAAI,GAAkB;YAC1B,aAAa;YACb,WAAW;YACX,MAAM;YACN,OAAO;YACP,UAAU;YACV,OAAO;SACR,CAAC;QAEF,+CAA+C;QAC/C,IAAI,IAAa,CAAC;QAClB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,8BAA8B,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YACvE,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,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;CACF,CAAC"}
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,KA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ClB,CAAC;QAED,gBAAgB;QAChB,MAAM,IAAI,GAAkB;YAC1B,aAAa;YACb,WAAW;YACX,MAAM;YACN,OAAO;YACP,UAAU;YACV,OAAO;SACR,CAAC;QAEF,+CAA+C;QAC/C,IAAI,IAAa,CAAC;QAClB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,8BAA8B,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,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;AAG5E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,OAAO,IAAI;IACf,YACmB,IAAmB,EACnB,aAAkC;QADlC,SAAI,GAAJ,IAAI,CAAe;QACnB,kBAAa,GAAb,aAAa,CAAqB;IAClD,CAAC;IAEJ,UAAU,CACR,OAAe,EACf,OAA+D;QAE/D,MAAM,mBAAmB,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACvF,MAAM,MAAM,GAAG,cAAc,CAAC,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;QAEvF,MAAM,sBAAsB,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACd,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;gBAC9B,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAE5B,IAAI,QA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AC;QAED,IAAI,aAAa,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,OAAO,GACX,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC;gBACnB,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE;oBACd,MAAM,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,MAA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AAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACtB,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;YAC3B,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,OAAO,MAAM,CAAC,CAAC,EAAE;gBAC7F,KAAK,EAAE,GAAG;aACX,CAAC,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,22 @@
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 {@link Octo.commit}.
12
+ *
13
+ * This is the command that ends a run, so it is the one that releases the app lock - however the
14
+ * commit itself finishes. Octo never unlocks on its own; the lock is the CLI's to take and to drop.
15
+ */
16
+ export declare const commitCommand: {
17
+ builder: (yargs: Argv) => Argv;
18
+ command: string;
19
+ describe: string;
20
+ handler: (argv: ArgumentsCamelCase<CommitCommandArguments>) => Promise<void>;
21
+ };
22
+ export {};
@@ -0,0 +1,94 @@
1
+ import { resolve } from 'path';
2
+ import { Container, StateManagementService, TerraformUtility } from '@quadnix/octo';
3
+ import chalk from 'chalk';
4
+ import { bootOcto, bootStateProvider, reportError } from '../../utilities/octo/octo.utility.js';
5
+ /**
6
+ * Step 4 of the octo lifecycle. See {@link Octo.commit}.
7
+ *
8
+ * This is the command that ends a run, so it is the one that releases the app lock - however the
9
+ * commit itself finishes. Octo never unlocks on its own; the lock is the CLI's to take and to drop.
10
+ */
11
+ export const commitCommand = {
12
+ builder: (yargs) => {
13
+ return yargs
14
+ .option('terragruntDir', {
15
+ demandOption: true,
16
+ description: 'The generated Terragrunt directory, post apply (`terragrunt run-all apply`).',
17
+ type: 'string',
18
+ })
19
+ .option('lockId', {
20
+ demandOption: true,
21
+ description: 'The app lock ID from `octo lock`. Released when this command finishes.',
22
+ type: 'string',
23
+ })
24
+ .option('partial', {
25
+ default: false,
26
+ demandOption: false,
27
+ description: 'Record what did apply, leaving resources with missing outputs uncommitted. For a failed apply.',
28
+ type: 'boolean',
29
+ })
30
+ .option('terraformBinary', {
31
+ demandOption: false,
32
+ description: 'Override the terraform/tofu binary terragrunt should invoke (sets TG_TF_PATH).',
33
+ type: 'string',
34
+ })
35
+ .option('terragruntBinary', {
36
+ demandOption: false,
37
+ description: 'Override the terragrunt binary/path to invoke.',
38
+ type: 'string',
39
+ })
40
+ .option('timeoutInMs', {
41
+ demandOption: false,
42
+ description: 'Override the per-command timeout, in milliseconds.',
43
+ type: 'number',
44
+ });
45
+ },
46
+ command: 'commit',
47
+ describe: "Step 4: record the results of a Terraform apply back into Octo's state.",
48
+ handler: async (argv) => {
49
+ const { lockId, partial, terraformBinary, terragruntBinary, terragruntDir, timeoutInMs } = argv;
50
+ const resolvedDir = resolve(process.cwd(), terragruntDir);
51
+ try {
52
+ // The state provider is resolved before anything else, so the lock can be released even when
53
+ // the boot below is what fails. Booting octo replaces this service with one built on its own
54
+ // provider; both are the same store, so either releases the same lock.
55
+ await bootStateProvider();
56
+ const stateManagementService = await Container.getInstance().get(StateManagementService);
57
+ // This command ends a run, so it releases the lock no matter how the run turns out - a failed
58
+ // commit has left octo state untouched, and holding the lock afterwards would only block the
59
+ // re-run that fixes it.
60
+ try {
61
+ const { app, octo } = await bootOcto();
62
+ const terraformUtility = await Container.getInstance().get(TerraformUtility, {
63
+ args: [{ terraformBinary, terragruntBinary, timeoutInMs }, true],
64
+ });
65
+ // Read outputs from every folder terragrunt discovers. A folder whose outputs cannot be read
66
+ // is warned and omitted rather than aborting the commit: octo rejects the commit itself if
67
+ // that folder held a module it tracks, and merely warns if it is a folder octo does not know.
68
+ const [outputs, moduleIds] = await Promise.all([
69
+ terraformUtility.output(resolvedDir, { json: true }),
70
+ terraformUtility.listModuleFolders(resolvedDir),
71
+ ]);
72
+ for (const moduleId of moduleIds) {
73
+ if (!outputs.has(moduleId)) {
74
+ console.error(chalk.yellow(`WARN [${moduleId}] Could not read terraform outputs`));
75
+ }
76
+ }
77
+ const { warnings } = await octo.commit(app, { lockId, outputs, partial });
78
+ for (const warning of warnings) {
79
+ console.error(chalk.yellow(`WARN ${warning.moduleId ? `[${warning.moduleId}] ` : ''}${warning.message}`));
80
+ }
81
+ // No verdict printed here - the listeners own stdout and render the commit report there.
82
+ // The warnings above stay, on stderr: a different fd, so they cannot interleave with pino.
83
+ }
84
+ finally {
85
+ await stateManagementService.unlockApp(lockId);
86
+ }
87
+ }
88
+ catch (error) {
89
+ reportError(error);
90
+ process.exit(1);
91
+ }
92
+ },
93
+ };
94
+ //# sourceMappingURL=commit.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit.command.js","sourceRoot":"","sources":["../../../src/commands/commit/commit.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,QAAQ,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAWhG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,CAAC,KAAW,EAAQ,EAAE;QAC7B,OAAO,KAAK;aACT,MAA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C,CAAC;gBAC5G,CAAC;gBAED,yFAAyF;gBACzF,2FAA2F;YAC7F,CAAC;oBAAS,CAAC;gBACT,MAAM,sBAAsB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1 @@
1
+ export { commitCommand } from './commit.command.js';
@@ -0,0 +1,2 @@
1
+ export { commitCommand } from './commit.command.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/commit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -33,7 +33,7 @@ export const createAnchorCommand = {
33
33
  .option('path', {
34
34
  alias: 'p',
35
35
  default: '.',
36
- description: 'Root directory path of the CDK.',
36
+ description: 'Root directory path of the project.',
37
37
  type: 'string',
38
38
  });
39
39
  },