redkite 0.1.8 → 0.1.10

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 (127) hide show
  1. package/README.md +161 -12
  2. package/dist/build.d.ts +3 -0
  3. package/dist/build.d.ts.map +1 -1
  4. package/dist/build.js +18 -2
  5. package/dist/build.js.map +1 -1
  6. package/dist/cli/agent.js +2 -2
  7. package/dist/cli/agent.js.map +1 -1
  8. package/dist/cli/config.d.ts +1 -0
  9. package/dist/cli/config.d.ts.map +1 -1
  10. package/dist/cli/config.js +82 -16
  11. package/dist/cli/config.js.map +1 -1
  12. package/dist/cli/dotenv.d.ts +2 -0
  13. package/dist/cli/dotenv.d.ts.map +1 -0
  14. package/dist/cli/dotenv.js +30 -0
  15. package/dist/cli/dotenv.js.map +1 -0
  16. package/dist/cli/index.d.ts.map +1 -1
  17. package/dist/cli/index.js +11 -5
  18. package/dist/cli/index.js.map +1 -1
  19. package/dist/cli/screen.d.ts +10 -3
  20. package/dist/cli/screen.d.ts.map +1 -1
  21. package/dist/cli/screen.js +153 -36
  22. package/dist/cli/screen.js.map +1 -1
  23. package/dist/cli/viewer.d.ts.map +1 -1
  24. package/dist/cli/viewer.js +36 -4
  25. package/dist/cli/viewer.js.map +1 -1
  26. package/dist/config.d.ts.map +1 -1
  27. package/dist/config.js +12 -0
  28. package/dist/config.js.map +1 -1
  29. package/dist/deploy.d.ts.map +1 -1
  30. package/dist/deploy.js +12 -2
  31. package/dist/deploy.js.map +1 -1
  32. package/dist/docker.d.ts +1 -0
  33. package/dist/docker.d.ts.map +1 -1
  34. package/dist/docker.js +3 -0
  35. package/dist/docker.js.map +1 -1
  36. package/dist/dockerfile.d.ts +1 -0
  37. package/dist/dockerfile.d.ts.map +1 -1
  38. package/dist/dockerfile.js +16 -3
  39. package/dist/dockerfile.js.map +1 -1
  40. package/dist/environment.d.ts +2 -0
  41. package/dist/environment.d.ts.map +1 -1
  42. package/dist/environment.js +56 -1
  43. package/dist/environment.js.map +1 -1
  44. package/dist/index.d.ts +2 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/log.d.ts +1 -0
  49. package/dist/log.d.ts.map +1 -1
  50. package/dist/log.js +1 -0
  51. package/dist/log.js.map +1 -1
  52. package/dist/pipeline.d.ts.map +1 -1
  53. package/dist/pipeline.js +3 -0
  54. package/dist/pipeline.js.map +1 -1
  55. package/dist/plugins/bitwarden.d.ts.map +1 -1
  56. package/dist/plugins/bitwarden.js +25 -6
  57. package/dist/plugins/bitwarden.js.map +1 -1
  58. package/dist/presets/nextApp.d.ts.map +1 -1
  59. package/dist/presets/nextApp.js +5 -4
  60. package/dist/presets/nextApp.js.map +1 -1
  61. package/dist/presets/nodeApp.d.ts.map +1 -1
  62. package/dist/presets/nodeApp.js +15 -6
  63. package/dist/presets/nodeApp.js.map +1 -1
  64. package/dist/secrets/manager.d.ts +9 -0
  65. package/dist/secrets/manager.d.ts.map +1 -0
  66. package/dist/secrets/manager.js +130 -0
  67. package/dist/secrets/manager.js.map +1 -0
  68. package/dist/secrets/store.d.ts.map +1 -1
  69. package/dist/secrets/store.js +46 -12
  70. package/dist/secrets/store.js.map +1 -1
  71. package/dist/services/ensure.js +1 -1
  72. package/dist/services/ensure.js.map +1 -1
  73. package/dist/services/index.d.ts +2 -1
  74. package/dist/services/index.d.ts.map +1 -1
  75. package/dist/services/index.js +11 -0
  76. package/dist/services/index.js.map +1 -1
  77. package/dist/services/planned.d.ts +0 -1
  78. package/dist/services/planned.d.ts.map +1 -1
  79. package/dist/services/planned.js +3 -12
  80. package/dist/services/planned.js.map +1 -1
  81. package/dist/services/proxy.d.ts +7 -0
  82. package/dist/services/proxy.d.ts.map +1 -0
  83. package/dist/services/proxy.js +103 -0
  84. package/dist/services/proxy.js.map +1 -0
  85. package/dist/source.d.ts +7 -1
  86. package/dist/source.d.ts.map +1 -1
  87. package/dist/source.js +17 -9
  88. package/dist/source.js.map +1 -1
  89. package/dist/steps.d.ts +1 -6
  90. package/dist/steps.d.ts.map +1 -1
  91. package/dist/steps.js +3 -3
  92. package/dist/steps.js.map +1 -1
  93. package/dist/types.d.ts +10 -2
  94. package/dist/types.d.ts.map +1 -1
  95. package/package.json +1 -1
  96. package/src/build.ts +22 -2
  97. package/src/cli/agent.ts +2 -2
  98. package/src/cli/config.ts +96 -15
  99. package/src/cli/dotenv.ts +35 -0
  100. package/src/cli/index.ts +11 -5
  101. package/src/cli/screen.ts +193 -43
  102. package/src/cli/viewer.ts +41 -4
  103. package/src/config.ts +19 -0
  104. package/src/deploy.ts +14 -2
  105. package/src/docker.ts +5 -0
  106. package/src/dockerfile.ts +23 -3
  107. package/src/environment.ts +71 -1
  108. package/src/index.ts +2 -1
  109. package/src/log.ts +4 -0
  110. package/src/pipeline.ts +4 -0
  111. package/src/plugins/bitwarden.ts +38 -11
  112. package/src/presets/nextApp.ts +5 -4
  113. package/src/presets/nodeApp.ts +15 -6
  114. package/src/secrets/manager.ts +172 -0
  115. package/src/secrets/store.ts +51 -16
  116. package/src/services/ensure.ts +1 -1
  117. package/src/services/index.ts +13 -1
  118. package/src/services/planned.ts +3 -13
  119. package/src/services/proxy.ts +126 -0
  120. package/src/source.ts +33 -9
  121. package/src/steps.ts +7 -7
  122. package/src/types.ts +26 -4
  123. package/dist/nginx.d.ts +0 -4
  124. package/dist/nginx.d.ts.map +0 -1
  125. package/dist/nginx.js +0 -53
  126. package/dist/nginx.js.map +0 -1
  127. package/src/nginx.ts +0 -63
package/README.md CHANGED
@@ -149,7 +149,14 @@ export default defineEnvironment({
149
149
  });
150
150
  ```
151
151
 
152
- Redkite finds them by name, so there is no list to keep in step, and
152
+ Redkite finds them by name, so there is no list to keep in step, and anything
153
+ beside the deployment whose name starts with `redkite` and is a module counts:
154
+ `redkite.staging.ts` and `redkite-staging.ts` name the same environment as
155
+ `redkite.staging.config.ts` does. One that was meant to be an environment and
156
+ is named slightly differently is refused rather than passed over as though it
157
+ were not there. The name has to be lower case, because it becomes part of an
158
+ image tag and a tag cannot hold a capital.
159
+
153
160
  `redkite.config.ts` has no `environments` key at all: a second place to put a
154
161
  set of them is a second place for them to disagree. A config that declares one
155
162
  does not compile.
@@ -217,6 +224,12 @@ find them. `package.json` is where a repository says otherwise:
217
224
  }
218
225
  ```
219
226
 
227
+ The deployment does not have to be one of them. A repository that keeps
228
+ `redkite.config.ts` at its root and the environment files together under
229
+ `deploy/` works the same way: the directory is read for environments whether or
230
+ not the deployment turned out to be in it. Naming a directory that is not there
231
+ is still refused, and one environment defined in both places is too.
232
+
220
233
  Then `deploy/redkite.config.ts` and `deploy/redkite.production.config.ts`. If
221
234
  that directory holds no config, redkite stops and says so rather than carrying
222
235
  on up the tree: naming a directory and not putting the files there is a mistake,
@@ -255,6 +268,28 @@ sits beside the deployment is refused too: it comes from one place or the other.
255
268
  | `files` | Container path to the item whose contents land there |
256
269
  | `volumes` | Volume name to container path, for state that outlives a deploy |
257
270
 
271
+ ### What an app is built from
272
+
273
+ Every cloned app takes the environment's `branch` unless it says otherwise. An
274
+ app can name its own, and can pin instead of tracking:
275
+
276
+ ```ts
277
+ { name: "backend", repo: "…", branch: "release" } // tracks that branch
278
+ { name: "worker", repo: "…", tag: "v1.2.3" } // pinned
279
+ { name: "legacy", repo: "…", commit: "9f2b4c1" } // pinned
280
+ ```
281
+
282
+ At most one of the three, and a config naming two is refused: they are
283
+ different commits and picking one is not redkite's to do.
284
+
285
+ `branch` is looked up under `refs/heads`, `tag` under `refs/tags` and peeled,
286
+ so an annotated tag answers with the commit it points at rather than with the
287
+ tag object. A `commit` is taken as it is and checked that it is one. The
288
+ failure says which kind was missing: *"acme/backend has no tag v9"*.
289
+
290
+ An environment can only say `branch`. A tag or a commit is a claim about one
291
+ repository, and an environment spans every app in the deployment.
292
+
258
293
  ### Building from a directory
259
294
 
260
295
  An app names either a repository to clone or a directory already on this
@@ -314,6 +349,22 @@ When the deploy host is another machine, an app built from a path forces the
314
349
  build to happen here and the image to be shipped, the same as `--local`. The
315
350
  source is on this machine, so the builder is too.
316
351
 
352
+ #### Dependencies fetched over ssh
353
+
354
+ A `git+ssh` entry in a manifest is resolved during the install, inside the
355
+ build, long after the checkout on the host is finished. That needs three things
356
+ the checkout does not, and redkite arranges all of them when this process holds
357
+ an agent: `openssh-client` in the builder, the agent forwarded in as a
358
+ `--mount=type=ssh`, and `GIT_SSH_COMMAND` set to accept a host on first sight.
359
+
360
+ A run with no agent asks for none of it, because a mount with nothing behind it
361
+ fails the build outright. Whether it was forwarded is part of what the image is
362
+ tagged by, so an image built without one is never mistaken for an image built
363
+ with one.
364
+
365
+ Nothing else is needed: the same agent that lets the deploy host clone the
366
+ repository is what the build reaches through.
367
+
317
368
  ### Build presets
318
369
 
319
370
  `nodeApp` and `nextApp` describe a two-stage build: a fat builder image with
@@ -336,6 +387,13 @@ The dependency install is not one of the `steps`. The preset copies
336
387
  alone, so a commit that changes only source code reuses the layer. That is the
337
388
  difference between a deploy and a cold build.
338
389
 
390
+ The package manager's download cache is a cache mount; `node_modules` is a
391
+ layer. They are not interchangeable, because a cache mount is evicted on its
392
+ own schedule and the layer that filled it is not: once the two disagree, the
393
+ install is cached, the mount is empty, and the build runs against no
394
+ dependencies at all. `caches` therefore defaults to the download caches only,
395
+ and what a build needs on disk is written into the image.
396
+
339
397
  #### What a build is allowed not to produce
340
398
 
341
399
  A `COPY` whose source is missing fails the build. That is right for the output,
@@ -408,6 +466,34 @@ prompt nobody is there to answer is a deploy that hangs rather than one that
408
466
  fails. Cloning is separate and always `accept-new`, because the deploy host
409
467
  reaches GitHub rather than reaching you.
410
468
 
469
+ ### The proxy
470
+
471
+ Apps carry routes and routes need something to resolve them, so redkite derives
472
+ exactly one proxy. It is not listed under `services`, and a service by that
473
+ name is refused. What it runs and what goes around the block redkite renders is
474
+ `proxy`:
475
+
476
+ ```ts
477
+ proxy: nginx({
478
+ maxBodySize: "1024M",
479
+ server: ["server_tokens off;", "add_header X-Frame-Options SAMEORIGIN;"],
480
+ location: ["proxy_read_timeout 300s;", "proxy_set_header Upgrade $http_upgrade;"],
481
+ }),
482
+ ```
483
+
484
+ `server` lines go inside the server block above the locations, `location` lines
485
+ inside every location. Both are written as nginx sees them, semicolons and all.
486
+
487
+ **A line replaces rather than repeats.** nginx refuses a second
488
+ `proxy_read_timeout` outright instead of letting the later one win, so
489
+ `proxy_read_timeout 300s;` takes the place of the 30s redkite would have set. A
490
+ header keeps its own name as part of that, so `proxy_set_header Host $host;`
491
+ replaces only the Host header and leaves the other three alone.
492
+
493
+ The upstreams, the location per route, the failover and `listen` stay derived.
494
+ A `listen` in the server block is refused: the published port maps onto the one
495
+ inside the container, so only one side of that may say it.
496
+
411
497
  ### Services
412
498
 
413
499
  Long-lived containers shared by the apps. The proxy is not one of them: apps
@@ -484,6 +570,17 @@ The same is true of the migrations and checks that run in the builder image:
484
570
  they are given `--env-file` too, rather than finding a file the build left
485
571
  behind.
486
572
 
573
+ A vault holds dotenv, and docker's env file is a different format wearing the
574
+ same clothes: a quote there is part of the value, not around it. So the file
575
+ handed to `--env-file` is the parsed values rather than the text that held them,
576
+ and `DATABASE_URL="postgres://..."` reaches the process without the quotes it
577
+ was stored with. The `.env` mounted during the build stays exactly as the vault
578
+ wrote it, because the thing reading it there is a dotenv parser.
579
+
580
+ A value spanning several lines has no spelling docker would read back, so one is
581
+ refused by name rather than truncated. Anything shaped like that is a
582
+ [file secret](#a-secret-the-app-needs-as-a-file).
583
+
487
584
  If you do want one in the image, say so, in a build step where the mount is
488
585
  still there:
489
586
 
@@ -491,13 +588,28 @@ still there:
491
588
  steps: ["yarn build", "cp .env dist/.env"],
492
589
  ```
493
590
 
494
- `files` is the other way to put a credential in an image on purpose, for the
495
- ones that have to be a file rather than a variable:
591
+ #### A secret the app needs as a file
592
+
593
+ `files` maps a container path to the item whose contents land there, for a
594
+ credential that has to be a file rather than a variable:
496
595
 
497
596
  ```ts
498
- files: { "/app/service-account.json": bitwarden.item("...") },
597
+ files: {
598
+ "/etc/creds/service-account.json": bitwarden.item("..."),
599
+ "/app/private.pem": bitwarden.item("..."),
600
+ },
499
601
  ```
500
602
 
603
+ It is copied into the runtime image, after the output has landed, so it is
604
+ there before the process starts and survives a restart. The directory is made
605
+ first, so the path does not have to be one the image already has. Each one is
606
+ mounted as its own build secret, and lands `-r--------` owned by root.
607
+
608
+ This is the deliberate exception to nothing-from-a-vault-in-an-image: it is
609
+ named, at a path the config chose, and anyone who can pull the image can read
610
+ it. For a credential that should not be in a layer, put it in the environment
611
+ instead and have the app write it out itself.
612
+
501
613
  ## Hooks
502
614
 
503
615
  A run is one list of steps, each handed what the one before it answered with.
@@ -590,6 +702,24 @@ there is nothing to set before a step can use it.
590
702
  A step naming an app the deployment does not have fails before the run starts
591
703
  rather than half way through it.
592
704
 
705
+ #### Saying which machine the migration goes through
706
+
707
+ A migration reaches its database through one particular machine, and the step
708
+ runs on whatever host the environment deploys to. Naming that machine turns a
709
+ move nobody rechecked into a refusal:
710
+
711
+ ```ts
712
+ migrate({
713
+ app: "backend",
714
+ command: "yarn db:migrate",
715
+ through: "deploy@staging.acme.example",
716
+ })
717
+ ```
718
+
719
+ Deploy that environment to any other host and the run stops before it touches
720
+ anything. It is optional, and a deployment that leaves it out simply runs the
721
+ migration wherever it deploys.
722
+
593
723
  #### The network a step runs on
594
724
 
595
725
  A migration defaults to `host`: the deploy host's own network stack, which is
@@ -890,16 +1020,23 @@ open and its output rolls under a title that stays put; a step that finishes
890
1020
  shuts to a single line carrying what it cost.
891
1021
 
892
1022
  ```
893
- [01:18] ✔ setup 4s
894
- [01:18] ✔ build 9s
895
- [01:18] ▾ Building web yarn build 1m09s
1023
+ 00:04 ✔ setup 4s
1024
+ 00:13 ✔ build 13s
1025
+ 01:18 ▾ Building web: yarn build quiet 8s 1m05s
896
1026
  │ #15 [builder 10/10] RUN yarn build
897
1027
  │ ▲ Next.js 15.1.6
898
1028
  │ Creating an optimized production build ...
1029
+ · verify
1030
+ · swap
1031
+ · cleanup
899
1032
 
900
- ↑↓ move · enter open · shift+↑ latest · + open · - collapse all · q quit
1033
+ ↑↓ move · enter open · shift+↑ latest · +/- all · w wrap · q quit
901
1034
  ```
902
1035
 
1036
+ The points under the open step are the ones the run will still walk. A deploy
1037
+ knows its whole list before it starts, so how much is left is on screen from the
1038
+ first frame rather than only at the end.
1039
+
903
1040
  | Key | What it does |
904
1041
  | --- | --- |
905
1042
  | `↑` `↓` | Scroll the open step's output, then move between steps once it runs out |
@@ -908,11 +1045,20 @@ shuts to a single line carrying what it cost.
908
1045
  | `shift+↓` | Jump to the first step |
909
1046
  | `+` | Open the step running now, from anywhere, and keep opening the ones after it |
910
1047
  | `-` | Shut everything, and stop opening what comes next |
1048
+ | `w` | Wrap long lines instead of cutting them, for reading an error that does not fit |
911
1049
  | `q` | Stop the deploy. Press again to kill it |
912
1050
 
913
1051
  The gutter counts the whole run; the number on the right counts the step, and
914
- freezes at what it cost the moment it finishes. Nothing drawn on the alternate
915
- screen survives it, so the run is written out again on the way out.
1052
+ freezes at what it cost the moment it finishes. A spinner turns beside the step
1053
+ running now, and stops with it, which is how a slow step is told from a wedged
1054
+ one at a glance. When that step has said nothing for a while the row says
1055
+ `quiet 45s`, because a build that has stopped talking looks exactly like a build
1056
+ that has stopped.
1057
+
1058
+ Nothing drawn on the alternate screen survives it, so the run is written out
1059
+ again on the way out. A step that failed has the end of its own output written
1060
+ with it, since the reason it stopped is in there and the frames carrying it are
1061
+ gone.
916
1062
 
917
1063
  Colour separates where you are from what is happening. The step under the
918
1064
  cursor is cyan, the step running now is yellow, and a failed one is red and
@@ -926,8 +1072,11 @@ wide, and a row measured with one in it is a row that wraps.
926
1072
 
927
1073
  Every row is one terminal line. A line too long for the width is cut with an
928
1074
  ellipsis rather than wrapped, because a wrapped row pushes everything under it
929
- out of a frame counted in rows. `--full` is the way to read the untrimmed thing:
930
- no view, no collapsing, every line of every step streamed in full as it arrives.
1075
+ out of a frame counted in rows. `w` turns wrapping on for the times that trade
1076
+ is worth making, and the space a step is given is then counted in rows rather
1077
+ than lines, so a wrapped line gets the rows it needs. `--full` is the way to
1078
+ read the untrimmed thing: no view, no collapsing, every line of every step
1079
+ streamed in full as it arrives.
931
1080
 
932
1081
  A pipe, a CI log or `REDKITE_PLAIN=1` gets that same streamed form, with
933
1082
  `--verbose` adding every host command beside it.
package/dist/build.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Docker } from "./docker.js";
2
+ import type { Ref } from "./source.js";
2
3
  import type { Host } from "./host.js";
3
4
  import type { AppTopology } from "./topology.js";
4
5
  import type { AppSpec } from "./types.js";
@@ -13,6 +14,7 @@ export type BuildContext = {
13
14
  files: Record<string, string>;
14
15
  branch: string;
15
16
  environment: string;
17
+ agent?: boolean;
16
18
  detail?: (message: string) => void;
17
19
  output?: (line: string) => void;
18
20
  };
@@ -23,5 +25,6 @@ export type BuildResult = {
23
25
  builderTag: string;
24
26
  cached: boolean;
25
27
  };
28
+ export declare function refOf(app: AppSpec, branch: string): Ref;
26
29
  export declare function build(app: AppSpec, topology: AppTopology, context: BuildContext): Promise<BuildResult>;
27
30
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAM1C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAEzC,GAAG,EAAE,MAAM,CAAC;I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E,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IAGpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAOF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAEhB,WAAW,EAAE,MAAM,CAAC;IAEpB,GAAG,EAAE,MAAM,CAAC;IAIZ,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAKF,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAKvD;AAED,wBAAsB,KAAK,CACzB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,WAAW,CAAC,CA0FtB"}
package/dist/build.js CHANGED
@@ -5,7 +5,17 @@ import { prepareSource } from "./source.js";
5
5
  // Bumped when the pipeline changes shape without the config changing. The tag
6
6
  // below is what tells a host it already holds an image, and a host that trusts
7
7
  // the commit alone serves the last pipeline's output forever
8
- const PIPELINE = "4";
8
+ const PIPELINE = "6";
9
+ // The app's own, or the environment's branch when it names none. A branch is
10
+ // the only thing an environment can say, because a tag or a commit is a claim
11
+ // about one repository and an environment spans every app
12
+ export function refOf(app, branch) {
13
+ if (app.tag)
14
+ return { kind: "tag", name: app.tag };
15
+ if (app.commit)
16
+ return { kind: "commit", name: app.commit };
17
+ return { kind: "branch", name: app.branch ?? branch };
18
+ }
9
19
  export async function build(app, topology, context) {
10
20
  const { host, docker } = context;
11
21
  const spec = app.build;
@@ -17,7 +27,8 @@ export async function build(app, topology, context) {
17
27
  // against the deployment file rather than wherever this was run
18
28
  path: app.path && resolve(app.path),
19
29
  include: app.include,
20
- branch: context.branch,
30
+ ref: refOf(app, context.branch),
31
+ output: context.output,
21
32
  submodules: spec.submodules,
22
33
  detail,
23
34
  });
@@ -47,12 +58,14 @@ export async function build(app, topology, context) {
47
58
  envSecret: secrets.env.id,
48
59
  fileSecrets: Object.fromEntries(secrets.files.map((file) => [file.path, file.id])),
49
60
  dir: app.dir,
61
+ agent: context.agent,
50
62
  }));
51
63
  // BuildKit reads this beside the Dockerfile rather than inside the context,
52
64
  // which is what lets the checkout stay a checkout: the repository keeps its
53
65
  // own .dockerignore, and .git never enters the build
54
66
  await host.write(`${app.name}.Dockerfile.dockerignore`, renderDockerignore(app.include));
55
67
  const invocation = {
68
+ ssh: context.agent,
56
69
  context: source.tree,
57
70
  dockerfile,
58
71
  secrets: Object.fromEntries([secrets.env, ...secrets.files].map((secret) => [secret.id, secret.src])),
@@ -123,6 +136,9 @@ function fingerprintOf(app, context, release) {
123
136
  .update(PIPELINE)
124
137
  .update(release)
125
138
  .update(app.dir ?? "")
139
+ // It changes the Dockerfile, so an image built without one is not the
140
+ // image a build with one would produce
141
+ .update(String(context.agent ?? false))
126
142
  .update(JSON.stringify(app.build))
127
143
  .update(context.env)
128
144
  .update(JSON.stringify(Object.entries(context.files).sort()))
package/dist/build.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyB5C,8EAA8E;AAC9E,+EAA+E;AAC/E,6DAA6D;AAC7D,MAAM,QAAQ,GAAG,GAAG,CAAC;AAgBrB,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,GAAY,EACZ,QAAqB,EACrB,O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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { execFileSync } from "node:child_process";
2
2
  import { environmentOf } from "../config.js";
3
- // Cloning private repositories and opening the tunnel both go through the
4
- // agent, so a deploy without one fails halfway rather than at the start
3
+ // Cloning private repositories and reaching the deploy host both go through
4
+ // the agent, so a deploy without one fails halfway rather than at the start
5
5
  // Asked before one is demanded. A runner has no keys and no way to be prompted
6
6
  // for one, and a deployment that reaches no other machine and clones nothing
7
7
  // has no use for an agent: insisting on one there is a green run turned red
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/cli/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,0EAA0E;AAC1E,wEAAwE;AAExE,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,MAAM,UAAU,UAAU,CAAC,MAAkB,EAAE,WAAmB;IAChE,IAAI,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO;QAAE,OAAO,IAAI,CAAC;IAEnE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,6EAA6E;AAC7E,mEAAmE;AACnE,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,6EAA6E;AAC7E,uEAAuE;AACvE,4BAA4B;AAC5B,MAAM,UAAU,YAAY,CAAC,IAA+B;IAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC9C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9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ACb,wEAAwE;YACtE,wEAAwE;YACxE,qEAAqE;YACrE,aAAa,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -2,4 +2,5 @@ import type { Deployment, Environment } from "../types.js";
2
2
  export declare function loadConfig(explicit?: string): Promise<Deployment>;
3
3
  export declare function discover(from: string): string;
4
4
  export declare function loadEnvironments(directory: string): Promise<Record<string, Environment>>;
5
+ export declare function projectRoot(explicit?: string): string;
5
6
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA2B3D,wBAAsB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBvE;AA0CD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAwB7C;AAGD,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,wCAmBvD"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmC3D,wBAAsB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAmCvE;AA4CD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4C7C;AAcD,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,wCA4BvD;AA2CD,wBAAgB,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,UAG5C"}
@@ -10,8 +10,15 @@ import { pathToFileURL } from "node:url";
10
10
  // down a literal.
11
11
  const EXTENSIONS = ["ts", "mts", "js", "mjs"];
12
12
  const CANDIDATES = EXTENSIONS.map((extension) => `redkite.config.${extension}`);
13
- // redkite.<environment>.config.<extension>, beside the deployment it belongs to
14
- const PER_ENVIRONMENT = /^redkite\.([a-z0-9-]+)\.config\.(ts|mts|js|mjs)$/;
13
+ // Anything beside the deployment that starts with redkite and is a module it
14
+ // could read. The .config in the middle is what people write and what the docs
15
+ // say, and it is optional here because a file that was meant to be an
16
+ // environment and is named slightly differently should be read and refused
17
+ // rather than passed over as though it were not there
18
+ const PER_ENVIRONMENT = /^redkite[.\-_](.+?)(?:\.config)?\.(?:ts|mts|cts|js|mjs|cjs)$/;
19
+ // What an environment may be called. It becomes part of an image tag, and an
20
+ // image tag cannot hold a capital, so this is docker's limit rather than ours
21
+ const ENVIRONMENT_NAME = /^[a-z0-9][a-z0-9._-]*$/;
15
22
  // Node strips types itself from 22.18 on, which is what lets redkite ship with
16
23
  // no dependencies. These are the ways that can fail on a config it cannot read.
17
24
  // A SyntaxError is the same class of failure: a package without "type":
@@ -25,21 +32,36 @@ const LOADER = new Set([
25
32
  export async function loadConfig(explicit) {
26
33
  const path = explicit ? resolve(explicit) : discover(process.cwd());
27
34
  const config = defaultOf(await load(path), path);
35
+ const manifest = manifestOf(explicit ? dirname(path) : process.cwd());
28
36
  const beside = await loadEnvironments(dirname(path));
29
- const named = await loadNamed(manifestOf(explicit ? dirname(path) : process.cwd()));
30
- for (const name of Object.keys(named)) {
37
+ // The directory package.json names is read whether or not the deployment
38
+ // turned out to be in it, so environments may sit together under one roof
39
+ // with the deployment at the root above them
40
+ const declared = directoryOf(manifest);
41
+ const under = declared && declared !== dirname(path) ? await loadEnvironments(declared) : {};
42
+ const named = await loadNamed(manifest);
43
+ const found = { ...beside, ...under };
44
+ for (const name of Object.keys(under)) {
31
45
  if (!beside[name])
32
46
  continue;
47
+ throw new Error(`${name} sits both beside the deployment and in ${declared}, ` +
48
+ "and an environment comes from one place or the other");
49
+ }
50
+ for (const name of Object.keys(named)) {
51
+ if (!found[name])
52
+ continue;
33
53
  throw new Error(`${name} is named by package.json and also sits beside the deployment. ` +
34
54
  "An environment comes from one place or the other");
35
55
  }
36
- return { ...rooted(config, dirname(path)), environments: { ...beside, ...named } };
56
+ return { ...rooted(config, dirname(path)), environments: { ...found, ...named } };
37
57
  }
38
58
  // A source path belongs to the file that named it, not to wherever the command
39
59
  // was run. Resolving it here is what lets a deploy from a workspace and one
40
60
  // from the root build the same tree
41
61
  function rooted(config, directory) {
42
- if (!config.apps.some((app) => app.path))
62
+ // A file that never called defineDeployment can export anything, and the
63
+ // message worth getting is the one topologyFor gives rather than a TypeError
64
+ if (!(config.apps ?? []).some((app) => app.path))
43
65
  return config;
44
66
  return {
45
67
  ...config,
@@ -69,32 +91,65 @@ async function loadNamed(manifest) {
69
91
  // likely to be run from a workspace inside it as from there
70
92
  export function discover(from) {
71
93
  let directory = from;
94
+ // Where something addressed to redkite was seen but no deployment. Naming it
95
+ // is the difference between "there is nothing here" and "the file you have
96
+ // is an environment, and an environment is not a deployment"
97
+ const nearby = [];
72
98
  for (;;) {
73
99
  const declared = directoryFrom(directory);
74
- // Saying where the files are and not putting them there is a mistake worth
75
- // stopping for, rather than a reason to keep looking further up
76
- if (declared)
77
- return found(declared) ?? missing(declared, directory);
100
+ // Naming a directory that is not there is a mistake worth stopping for.
101
+ // One that is there and holds no deployment is not: it may hold only the
102
+ // environments, and the deployment may sit at the root above them
103
+ if (declared && !existsSync(declared))
104
+ missing(declared, directory);
105
+ const there = declared && found(declared);
106
+ if (there)
107
+ return there;
78
108
  const here = found(directory);
79
109
  if (here)
80
110
  return here;
111
+ for (const place of declared ? [declared, directory] : [directory]) {
112
+ for (const entry of environmentsAt(place))
113
+ nearby.push(join(place, entry));
114
+ }
81
115
  const parent = dirname(directory);
82
116
  if (parent === directory)
83
117
  break;
84
118
  directory = parent;
85
119
  }
120
+ if (nearby.length > 0) {
121
+ throw new Error(`No deployment found, but ${nearby.join(" and ")} reads as an environment. ` +
122
+ "An environment says which branch and which subnet; the deployment says " +
123
+ "the project, the apps and the services, and is redkite.config.ts");
124
+ }
86
125
  throw new Error(`No redkite.config.ts found in ${from} or any directory above it. A deployment ` +
87
126
  'is one file at the root of the project, or wherever package.json\'s ' +
88
127
  '"redkite": { "directory": … } says it is');
89
128
  }
129
+ // The names beside a deployment that would be read as environments, for a
130
+ // message that can say what was there instead of what was not
131
+ function environmentsAt(directory) {
132
+ if (!existsSync(directory))
133
+ return [];
134
+ return readdirSync(directory)
135
+ .filter((entry) => !CANDIDATES.includes(entry))
136
+ .filter((entry) => PER_ENVIRONMENT.test(entry))
137
+ .sort();
138
+ }
90
139
  // Every environment that lives in a file of its own, keyed by the name in it
91
140
  export async function loadEnvironments(directory) {
92
141
  const environments = {};
93
142
  const seen = {};
94
143
  for (const entry of readdirSync(directory).sort()) {
144
+ if (CANDIDATES.includes(entry))
145
+ continue;
95
146
  const name = PER_ENVIRONMENT.exec(entry)?.[1];
96
147
  if (!name)
97
148
  continue;
149
+ if (!ENVIRONMENT_NAME.test(name)) {
150
+ throw new Error(`${join(directory, entry)} reads as the environment ${name}, which cannot ` +
151
+ "name one: it becomes part of an image tag, and a tag is lower case");
152
+ }
98
153
  const first = seen[name];
99
154
  if (first) {
100
155
  throw new Error(`${name} is defined by both ${first} and ${entry}`);
@@ -114,8 +169,7 @@ function found(directory) {
114
169
  return undefined;
115
170
  }
116
171
  function missing(declared, from) {
117
- throw new Error(`${join(from, "package.json")} points redkite at ${declared}, which holds no ` +
118
- `redkite.config.${EXTENSIONS.join(", redkite.config.")}`);
172
+ throw new Error(`${join(from, "package.json")} points redkite at ${declared}, which is not there`);
119
173
  }
120
174
  function manifestAt(directory) {
121
175
  const path = join(directory, "package.json");
@@ -130,6 +184,13 @@ function manifestAt(directory) {
130
184
  return undefined;
131
185
  }
132
186
  }
187
+ // Where the project starts, which is where a .env belongs. The nearest
188
+ // package.json above wherever this was run, and the directory itself when
189
+ // there is none
190
+ export function projectRoot(explicit) {
191
+ const from = explicit ? dirname(resolve(explicit)) : process.cwd();
192
+ return manifestOf(from)?.root ?? from;
193
+ }
133
194
  // The nearest one above wherever this was run, which is the same walk the
134
195
  // config itself is found by
135
196
  function manifestOf(from) {
@@ -144,11 +205,16 @@ function manifestOf(from) {
144
205
  directory = parent;
145
206
  }
146
207
  }
147
- // package.json says where the deployment files live, for a repository that
148
- // would rather not keep them at its root
208
+ // package.json says where redkite's files live, for a repository that would
209
+ // rather not keep them at its root
149
210
  function directoryFrom(directory) {
150
- const declared = manifestAt(directory)?.redkite.directory;
151
- return typeof declared === "string" ? resolve(directory, declared) : undefined;
211
+ return directoryOf(manifestAt(directory));
212
+ }
213
+ function directoryOf(manifest) {
214
+ if (!manifest)
215
+ return undefined;
216
+ const declared = manifest.redkite.directory;
217
+ return typeof declared === "string" ? resolve(manifest.root, declared) : undefined;
152
218
  }
153
219
  function defaultOf(module, path) {
154
220
  const found = module;
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,8EAA8E;AAC9E,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,kBAAkB;AAElB,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AAEvD,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;AAEhF,gFAAgF;AAChF,MAAM,eAAe,GAAG,kDAAkD,CAAC;AAE3E,+EAA+E;AAC/E,gFAAgF;AAChF,wEAAwE;AACxE,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[];
2
+ //# sourceMappingURL=dotenv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dotenv.d.ts","sourceRoot":"","sources":["../../src/cli/dotenv.ts"],"names":[],"mappings":"AAoBA,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAchE"}