redkite 0.1.9 → 0.1.11
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.
- package/README.md +191 -23
- package/dist/build.d.ts +1 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +7 -1
- package/dist/build.js.map +1 -1
- package/dist/cli/agent.js +2 -2
- package/dist/cli/agent.js.map +1 -1
- package/dist/cli/config.d.ts +1 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +67 -14
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/dotenv.d.ts +2 -0
- package/dist/cli/dotenv.d.ts.map +1 -0
- package/dist/cli/dotenv.js +30 -0
- package/dist/cli/dotenv.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +16 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/screen.d.ts +10 -3
- package/dist/cli/screen.d.ts.map +1 -1
- package/dist/cli/screen.js +153 -36
- package/dist/cli/screen.js.map +1 -1
- package/dist/cli/viewer.d.ts.map +1 -1
- package/dist/cli/viewer.js +36 -4
- package/dist/cli/viewer.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +67 -0
- package/dist/config.js.map +1 -1
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +17 -6
- package/dist/deploy.js.map +1 -1
- package/dist/docker.d.ts +1 -0
- package/dist/docker.d.ts.map +1 -1
- package/dist/docker.js +3 -0
- package/dist/docker.js.map +1 -1
- package/dist/dockerfile.d.ts +1 -0
- package/dist/dockerfile.d.ts.map +1 -1
- package/dist/dockerfile.js +16 -3
- package/dist/dockerfile.js.map +1 -1
- package/dist/environment.d.ts +2 -0
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js +56 -1
- package/dist/environment.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +1 -0
- package/dist/log.js.map +1 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +3 -0
- package/dist/pipeline.js.map +1 -1
- package/dist/plugins/bitwarden.d.ts.map +1 -1
- package/dist/plugins/bitwarden.js +25 -6
- package/dist/plugins/bitwarden.js.map +1 -1
- package/dist/presets/nextApp.d.ts.map +1 -1
- package/dist/presets/nextApp.js +5 -4
- package/dist/presets/nextApp.js.map +1 -1
- package/dist/presets/nodeApp.d.ts.map +1 -1
- package/dist/presets/nodeApp.js +15 -6
- package/dist/presets/nodeApp.js.map +1 -1
- package/dist/secrets/manager.d.ts +9 -0
- package/dist/secrets/manager.d.ts.map +1 -0
- package/dist/secrets/manager.js +130 -0
- package/dist/secrets/manager.js.map +1 -0
- package/dist/secrets/store.d.ts.map +1 -1
- package/dist/secrets/store.js +46 -12
- package/dist/secrets/store.js.map +1 -1
- package/dist/services/ensure.js +1 -1
- package/dist/services/ensure.js.map +1 -1
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +11 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/planned.d.ts +0 -1
- package/dist/services/planned.d.ts.map +1 -1
- package/dist/services/planned.js +3 -12
- package/dist/services/planned.js.map +1 -1
- package/dist/services/proxy.d.ts +7 -0
- package/dist/services/proxy.d.ts.map +1 -0
- package/dist/services/proxy.js +103 -0
- package/dist/services/proxy.js.map +1 -0
- package/dist/source.d.ts +1 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +5 -5
- package/dist/source.js.map +1 -1
- package/dist/steps.d.ts +0 -6
- package/dist/steps.d.ts.map +1 -1
- package/dist/steps.js +4 -12
- package/dist/steps.js.map +1 -1
- package/dist/types.d.ts +10 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/build.ts +10 -1
- package/src/cli/agent.ts +2 -2
- package/src/cli/config.ts +77 -13
- package/src/cli/dotenv.ts +35 -0
- package/src/cli/index.ts +16 -8
- package/src/cli/screen.ts +193 -43
- package/src/cli/viewer.ts +41 -4
- package/src/config.ts +80 -0
- package/src/deploy.ts +19 -6
- package/src/docker.ts +5 -0
- package/src/dockerfile.ts +23 -3
- package/src/environment.ts +71 -1
- package/src/index.ts +2 -1
- package/src/log.ts +4 -0
- package/src/pipeline.ts +4 -0
- package/src/plugins/bitwarden.ts +38 -11
- package/src/presets/nextApp.ts +5 -4
- package/src/presets/nodeApp.ts +15 -6
- package/src/secrets/manager.ts +172 -0
- package/src/secrets/store.ts +51 -16
- package/src/services/ensure.ts +1 -1
- package/src/services/index.ts +13 -1
- package/src/services/planned.ts +3 -13
- package/src/services/proxy.ts +126 -0
- package/src/source.ts +13 -4
- package/src/steps.ts +4 -19
- package/src/types.ts +29 -4
- package/dist/nginx.d.ts +0 -4
- package/dist/nginx.d.ts.map +0 -1
- package/dist/nginx.js +0 -53
- package/dist/nginx.js.map +0 -1
- package/src/nginx.ts +0 -63
package/README.md
CHANGED
|
@@ -185,6 +185,9 @@ Selected on the command line and threaded into every derived name.
|
|
|
185
185
|
| `host.bastion` | `user@address` of the deploy host. Absent means this machine |
|
|
186
186
|
| `extraHosts` | Hostname to address, added to every container beside the derived ones |
|
|
187
187
|
| `buildOn` | `"host"` by default. `"local"` compiles here and ships the image |
|
|
188
|
+
| `secrets` | App name to the items this environment reads, after the app's own |
|
|
189
|
+
| `files` | App name to container path to item, laid over the app's own files |
|
|
190
|
+
| `steps` | Steps for this environment alone, replacing the deployment's at the same point |
|
|
188
191
|
|
|
189
192
|
Images are built on the deploy host, which is where they are needed and costs
|
|
190
193
|
nothing to move them. A host too small to compile on can be told otherwise:
|
|
@@ -204,6 +207,70 @@ since there would be nothing to move.
|
|
|
204
207
|
a managed database, a legacy service, anything whose address is the thing that
|
|
205
208
|
differs between staging and production.
|
|
206
209
|
|
|
210
|
+
#### Secrets that differ between environments
|
|
211
|
+
|
|
212
|
+
Staging and production usually read the same variables from different items. The
|
|
213
|
+
item is named in the environment's file, beside everything else that differs,
|
|
214
|
+
keyed by the app it belongs to:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
// redkite.production.config.ts
|
|
218
|
+
export default defineEnvironment({
|
|
219
|
+
branch: "main",
|
|
220
|
+
subnet: "10.20.0",
|
|
221
|
+
publicPort: 80,
|
|
222
|
+
host: { bastion: "deploy@acme.example" },
|
|
223
|
+
|
|
224
|
+
secrets: {
|
|
225
|
+
frontend: bitwarden.item("..."),
|
|
226
|
+
backend: bitwarden.item("..."),
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
files: {
|
|
230
|
+
backend: { "/app/service-account.json": bitwarden.item("...") },
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
An environment's refs are read after the app's own, and refs merge in order with
|
|
236
|
+
the later key winning. So the deployment can hold what every environment shares,
|
|
237
|
+
or nothing at all, and each environment lays its own item over it. `files` merge
|
|
238
|
+
by path: a path the environment names replaces the app's, and every other file
|
|
239
|
+
stays.
|
|
240
|
+
|
|
241
|
+
An environment file does not import the deployment, so an app name in it cannot
|
|
242
|
+
be checked when it compiles. One that names no app is refused when the run
|
|
243
|
+
starts, before a connection or a vault is opened, and `plan` refuses it too.
|
|
244
|
+
|
|
245
|
+
The ids are pointers, not credentials. What keeps staging from reading
|
|
246
|
+
production is the token: give each environment its own `BW_KEY` in
|
|
247
|
+
`.env.<environment>.deploy`, or its own GitHub environment in CI, scoped in
|
|
248
|
+
Secrets Manager to that environment's project.
|
|
249
|
+
|
|
250
|
+
#### Steps that differ between environments
|
|
251
|
+
|
|
252
|
+
A migration that reaches a managed database from the host in production and a
|
|
253
|
+
service on the deployment network in staging is the same step with different
|
|
254
|
+
settings. The deployment holds the one most environments share, and an
|
|
255
|
+
environment that differs puts its own at the same point:
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
// redkite.config.ts
|
|
259
|
+
steps: [migrate({ app: "backend", command: "yarn db:migrate" })],
|
|
260
|
+
|
|
261
|
+
// redkite.staging.config.ts
|
|
262
|
+
steps: [migrate({ app: "backend", command: "yarn db:migrate", network: "deployment" })],
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
A step at a point the deployment already fills replaces it for that environment,
|
|
266
|
+
where it stood. It is the rule redkite's own four already follow, applied one
|
|
267
|
+
level down. A step only the environment has runs ahead of the deployment's at
|
|
268
|
+
the same slot, the way a plugin's does.
|
|
269
|
+
|
|
270
|
+
Two steps at one point in one environment file are refused when the file is
|
|
271
|
+
defined, and so is a step landing on a point a plugin already fills. `plan`
|
|
272
|
+
prints the pipeline the environment will actually run.
|
|
273
|
+
|
|
207
274
|
```ts
|
|
208
275
|
extraHosts: { "db.internal": "10.55.0.250" },
|
|
209
276
|
```
|
|
@@ -224,6 +291,12 @@ find them. `package.json` is where a repository says otherwise:
|
|
|
224
291
|
}
|
|
225
292
|
```
|
|
226
293
|
|
|
294
|
+
The deployment does not have to be one of them. A repository that keeps
|
|
295
|
+
`redkite.config.ts` at its root and the environment files together under
|
|
296
|
+
`deploy/` works the same way: the directory is read for environments whether or
|
|
297
|
+
not the deployment turned out to be in it. Naming a directory that is not there
|
|
298
|
+
is still refused, and one environment defined in both places is too.
|
|
299
|
+
|
|
227
300
|
Then `deploy/redkite.config.ts` and `deploy/redkite.production.config.ts`. If
|
|
228
301
|
that directory holds no config, redkite stops and says so rather than carrying
|
|
229
302
|
on up the tree: naming a directory and not putting the files there is a mistake,
|
|
@@ -258,7 +331,7 @@ sits beside the deployment is refused too: it comes from one place or the other.
|
|
|
258
331
|
| `build` | How the repository becomes an image. See presets below |
|
|
259
332
|
| `dir` | Where the app sits in the repository, when it is not the whole of it |
|
|
260
333
|
| `health` | Probed on the container itself, not through the proxy |
|
|
261
|
-
| `secrets` | One ref or several, merged in order,
|
|
334
|
+
| `secrets` | One ref or several, merged in order, handed to the container as its environment |
|
|
262
335
|
| `files` | Container path to the item whose contents land there |
|
|
263
336
|
| `volumes` | Volume name to container path, for state that outlives a deploy |
|
|
264
337
|
|
|
@@ -343,6 +416,22 @@ When the deploy host is another machine, an app built from a path forces the
|
|
|
343
416
|
build to happen here and the image to be shipped, the same as `--local`. The
|
|
344
417
|
source is on this machine, so the builder is too.
|
|
345
418
|
|
|
419
|
+
#### Dependencies fetched over ssh
|
|
420
|
+
|
|
421
|
+
A `git+ssh` entry in a manifest is resolved during the install, inside the
|
|
422
|
+
build, long after the checkout on the host is finished. That needs three things
|
|
423
|
+
the checkout does not, and redkite arranges all of them when this process holds
|
|
424
|
+
an agent: `openssh-client` in the builder, the agent forwarded in as a
|
|
425
|
+
`--mount=type=ssh`, and `GIT_SSH_COMMAND` set to accept a host on first sight.
|
|
426
|
+
|
|
427
|
+
A run with no agent asks for none of it, because a mount with nothing behind it
|
|
428
|
+
fails the build outright. Whether it was forwarded is part of what the image is
|
|
429
|
+
tagged by, so an image built without one is never mistaken for an image built
|
|
430
|
+
with one.
|
|
431
|
+
|
|
432
|
+
Nothing else is needed: the same agent that lets the deploy host clone the
|
|
433
|
+
repository is what the build reaches through.
|
|
434
|
+
|
|
346
435
|
### Build presets
|
|
347
436
|
|
|
348
437
|
`nodeApp` and `nextApp` describe a two-stage build: a fat builder image with
|
|
@@ -365,6 +454,13 @@ The dependency install is not one of the `steps`. The preset copies
|
|
|
365
454
|
alone, so a commit that changes only source code reuses the layer. That is the
|
|
366
455
|
difference between a deploy and a cold build.
|
|
367
456
|
|
|
457
|
+
The package manager's download cache is a cache mount; `node_modules` is a
|
|
458
|
+
layer. They are not interchangeable, because a cache mount is evicted on its
|
|
459
|
+
own schedule and the layer that filled it is not: once the two disagree, the
|
|
460
|
+
install is cached, the mount is empty, and the build runs against no
|
|
461
|
+
dependencies at all. `caches` therefore defaults to the download caches only,
|
|
462
|
+
and what a build needs on disk is written into the image.
|
|
463
|
+
|
|
368
464
|
#### What a build is allowed not to produce
|
|
369
465
|
|
|
370
466
|
A `COPY` whose source is missing fails the build. That is right for the output,
|
|
@@ -437,6 +533,34 @@ prompt nobody is there to answer is a deploy that hangs rather than one that
|
|
|
437
533
|
fails. Cloning is separate and always `accept-new`, because the deploy host
|
|
438
534
|
reaches GitHub rather than reaching you.
|
|
439
535
|
|
|
536
|
+
### The proxy
|
|
537
|
+
|
|
538
|
+
Apps carry routes and routes need something to resolve them, so redkite derives
|
|
539
|
+
exactly one proxy. It is not listed under `services`, and a service by that
|
|
540
|
+
name is refused. What it runs and what goes around the block redkite renders is
|
|
541
|
+
`proxy`:
|
|
542
|
+
|
|
543
|
+
```ts
|
|
544
|
+
proxy: nginx({
|
|
545
|
+
maxBodySize: "1024M",
|
|
546
|
+
server: ["server_tokens off;", "add_header X-Frame-Options SAMEORIGIN;"],
|
|
547
|
+
location: ["proxy_read_timeout 300s;", "proxy_set_header Upgrade $http_upgrade;"],
|
|
548
|
+
}),
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
`server` lines go inside the server block above the locations, `location` lines
|
|
552
|
+
inside every location. Both are written as nginx sees them, semicolons and all.
|
|
553
|
+
|
|
554
|
+
**A line replaces rather than repeats.** nginx refuses a second
|
|
555
|
+
`proxy_read_timeout` outright instead of letting the later one win, so
|
|
556
|
+
`proxy_read_timeout 300s;` takes the place of the 30s redkite would have set. A
|
|
557
|
+
header keeps its own name as part of that, so `proxy_set_header Host $host;`
|
|
558
|
+
replaces only the Host header and leaves the other three alone.
|
|
559
|
+
|
|
560
|
+
The upstreams, the location per route, the failover and `listen` stay derived.
|
|
561
|
+
A `listen` in the server block is refused: the published port maps onto the one
|
|
562
|
+
inside the container, so only one side of that may say it.
|
|
563
|
+
|
|
440
564
|
### Services
|
|
441
565
|
|
|
442
566
|
Long-lived containers shared by the apps. The proxy is not one of them: apps
|
|
@@ -489,12 +613,13 @@ registered before `bitwarden.item()` resolves to anything. A deployment that
|
|
|
489
613
|
names a provider nothing registers is refused before it builds, rather than
|
|
490
614
|
reaching for a vault by name.
|
|
491
615
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
`bitwarden({ secrets:
|
|
496
|
-
|
|
497
|
-
|
|
616
|
+
By default it reads Bitwarden Secrets Manager, and `BW_KEY` is the access
|
|
617
|
+
token. A config that would rather name its own variable passes the token in:
|
|
618
|
+
`bitwarden({ secrets: process.env.MY_ACCESS_TOKEN })`. The password manager is
|
|
619
|
+
`bitwarden({ secrets: false })`, where `BW_KEY` is a session from
|
|
620
|
+
`bw unlock --raw`, with `BW_CLIENT_ID`, `BW_CLIENT_SECRET` and `BW_PASSWORD`
|
|
621
|
+
used to obtain one when it is not set. One that reads no secrets at all needs
|
|
622
|
+
none of them: redkite only opens the stores your config actually names.
|
|
498
623
|
|
|
499
624
|
#### Where a secret is, and where it is not
|
|
500
625
|
|
|
@@ -513,6 +638,17 @@ The same is true of the migrations and checks that run in the builder image:
|
|
|
513
638
|
they are given `--env-file` too, rather than finding a file the build left
|
|
514
639
|
behind.
|
|
515
640
|
|
|
641
|
+
A vault holds dotenv, and docker's env file is a different format wearing the
|
|
642
|
+
same clothes: a quote there is part of the value, not around it. So the file
|
|
643
|
+
handed to `--env-file` is the parsed values rather than the text that held them,
|
|
644
|
+
and `DATABASE_URL="postgres://..."` reaches the process without the quotes it
|
|
645
|
+
was stored with. The `.env` mounted during the build stays exactly as the vault
|
|
646
|
+
wrote it, because the thing reading it there is a dotenv parser.
|
|
647
|
+
|
|
648
|
+
A value spanning several lines has no spelling docker would read back, so one is
|
|
649
|
+
refused by name rather than truncated. Anything shaped like that is a
|
|
650
|
+
[file secret](#a-secret-the-app-needs-as-a-file).
|
|
651
|
+
|
|
516
652
|
If you do want one in the image, say so, in a build step where the mount is
|
|
517
653
|
still there:
|
|
518
654
|
|
|
@@ -520,13 +656,28 @@ still there:
|
|
|
520
656
|
steps: ["yarn build", "cp .env dist/.env"],
|
|
521
657
|
```
|
|
522
658
|
|
|
523
|
-
|
|
524
|
-
|
|
659
|
+
#### A secret the app needs as a file
|
|
660
|
+
|
|
661
|
+
`files` maps a container path to the item whose contents land there, for a
|
|
662
|
+
credential that has to be a file rather than a variable:
|
|
525
663
|
|
|
526
664
|
```ts
|
|
527
|
-
files: {
|
|
665
|
+
files: {
|
|
666
|
+
"/etc/creds/service-account.json": bitwarden.item("..."),
|
|
667
|
+
"/app/private.pem": bitwarden.item("..."),
|
|
668
|
+
},
|
|
528
669
|
```
|
|
529
670
|
|
|
671
|
+
It is copied into the runtime image, after the output has landed, so it is
|
|
672
|
+
there before the process starts and survives a restart. The directory is made
|
|
673
|
+
first, so the path does not have to be one the image already has. Each one is
|
|
674
|
+
mounted as its own build secret, and lands `-r--------` owned by root.
|
|
675
|
+
|
|
676
|
+
This is the deliberate exception to nothing-from-a-vault-in-an-image: it is
|
|
677
|
+
named, at a path the config chose, and anyone who can pull the image can read
|
|
678
|
+
it. For a credential that should not be in a layer, put it in the environment
|
|
679
|
+
instead and have the app write it out itself.
|
|
680
|
+
|
|
530
681
|
## Hooks
|
|
531
682
|
|
|
532
683
|
A run is one list of steps, each handed what the one before it answered with.
|
|
@@ -662,11 +813,9 @@ first, and they sit at `swap:before` so they run while the old containers are
|
|
|
662
813
|
still serving.
|
|
663
814
|
|
|
664
815
|
```ts
|
|
665
|
-
steps
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
migrate({ app: "backend", command: "yarn db:migrate" }),
|
|
669
|
-
]
|
|
816
|
+
// A plugin's steps run ahead of the deployment's, so this lands above the migrate
|
|
817
|
+
plugins: [rdsSnapshot({ instance: "acme-production", region: "eu-west-1" })],
|
|
818
|
+
steps: [migrate({ app: "backend", command: "yarn db:migrate" })],
|
|
670
819
|
```
|
|
671
820
|
|
|
672
821
|
`rdsSnapshot` goes through the AWS CLI, which every runner already has with the
|
|
@@ -919,16 +1068,23 @@ open and its output rolls under a title that stays put; a step that finishes
|
|
|
919
1068
|
shuts to a single line carrying what it cost.
|
|
920
1069
|
|
|
921
1070
|
```
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1071
|
+
00:04 ✔ setup 4s
|
|
1072
|
+
00:13 ✔ build 13s
|
|
1073
|
+
01:18 ⠙ ▾ Building web: yarn build quiet 8s 1m05s
|
|
925
1074
|
│ #15 [builder 10/10] RUN yarn build
|
|
926
1075
|
│ ▲ Next.js 15.1.6
|
|
927
1076
|
│ Creating an optimized production build ...
|
|
1077
|
+
· verify
|
|
1078
|
+
· swap
|
|
1079
|
+
· cleanup
|
|
928
1080
|
|
|
929
|
-
↑↓ move · enter open · shift+↑ latest ·
|
|
1081
|
+
↑↓ move · enter open · shift+↑ latest · +/- all · w wrap · q quit
|
|
930
1082
|
```
|
|
931
1083
|
|
|
1084
|
+
The points under the open step are the ones the run will still walk. A deploy
|
|
1085
|
+
knows its whole list before it starts, so how much is left is on screen from the
|
|
1086
|
+
first frame rather than only at the end.
|
|
1087
|
+
|
|
932
1088
|
| Key | What it does |
|
|
933
1089
|
| --- | --- |
|
|
934
1090
|
| `↑` `↓` | Scroll the open step's output, then move between steps once it runs out |
|
|
@@ -937,11 +1093,20 @@ shuts to a single line carrying what it cost.
|
|
|
937
1093
|
| `shift+↓` | Jump to the first step |
|
|
938
1094
|
| `+` | Open the step running now, from anywhere, and keep opening the ones after it |
|
|
939
1095
|
| `-` | Shut everything, and stop opening what comes next |
|
|
1096
|
+
| `w` | Wrap long lines instead of cutting them, for reading an error that does not fit |
|
|
940
1097
|
| `q` | Stop the deploy. Press again to kill it |
|
|
941
1098
|
|
|
942
1099
|
The gutter counts the whole run; the number on the right counts the step, and
|
|
943
|
-
freezes at what it cost the moment it finishes.
|
|
944
|
-
|
|
1100
|
+
freezes at what it cost the moment it finishes. A spinner turns beside the step
|
|
1101
|
+
running now, and stops with it, which is how a slow step is told from a wedged
|
|
1102
|
+
one at a glance. When that step has said nothing for a while the row says
|
|
1103
|
+
`quiet 45s`, because a build that has stopped talking looks exactly like a build
|
|
1104
|
+
that has stopped.
|
|
1105
|
+
|
|
1106
|
+
Nothing drawn on the alternate screen survives it, so the run is written out
|
|
1107
|
+
again on the way out. A step that failed has the end of its own output written
|
|
1108
|
+
with it, since the reason it stopped is in there and the frames carrying it are
|
|
1109
|
+
gone.
|
|
945
1110
|
|
|
946
1111
|
Colour separates where you are from what is happening. The step under the
|
|
947
1112
|
cursor is cyan, the step running now is yellow, and a failed one is red and
|
|
@@ -955,8 +1120,11 @@ wide, and a row measured with one in it is a row that wraps.
|
|
|
955
1120
|
|
|
956
1121
|
Every row is one terminal line. A line too long for the width is cut with an
|
|
957
1122
|
ellipsis rather than wrapped, because a wrapped row pushes everything under it
|
|
958
|
-
out of a frame counted in rows.
|
|
959
|
-
|
|
1123
|
+
out of a frame counted in rows. `w` turns wrapping on for the times that trade
|
|
1124
|
+
is worth making, and the space a step is given is then counted in rows rather
|
|
1125
|
+
than lines, so a wrapped line gets the rows it needs. `--full` is the way to
|
|
1126
|
+
read the untrimmed thing: no view, no collapsing, every line of every step
|
|
1127
|
+
streamed in full as it arrives.
|
|
960
1128
|
|
|
961
1129
|
A pipe, a CI log or `REDKITE_PLAIN=1` gets that same streamed form, with
|
|
962
1130
|
`--verbose` adding every host command beside it.
|
package/dist/build.d.ts
CHANGED
package/dist/build.d.ts.map
CHANGED
|
@@ -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,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,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,CAA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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,7 @@ 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 = "
|
|
8
|
+
const PIPELINE = "6";
|
|
9
9
|
// The app's own, or the environment's branch when it names none. A branch is
|
|
10
10
|
// the only thing an environment can say, because a tag or a commit is a claim
|
|
11
11
|
// about one repository and an environment spans every app
|
|
@@ -28,6 +28,7 @@ export async function build(app, topology, context) {
|
|
|
28
28
|
path: app.path && resolve(app.path),
|
|
29
29
|
include: app.include,
|
|
30
30
|
ref: refOf(app, context.branch),
|
|
31
|
+
output: context.output,
|
|
31
32
|
submodules: spec.submodules,
|
|
32
33
|
detail,
|
|
33
34
|
});
|
|
@@ -57,12 +58,14 @@ export async function build(app, topology, context) {
|
|
|
57
58
|
envSecret: secrets.env.id,
|
|
58
59
|
fileSecrets: Object.fromEntries(secrets.files.map((file) => [file.path, file.id])),
|
|
59
60
|
dir: app.dir,
|
|
61
|
+
agent: context.agent,
|
|
60
62
|
}));
|
|
61
63
|
// BuildKit reads this beside the Dockerfile rather than inside the context,
|
|
62
64
|
// which is what lets the checkout stay a checkout: the repository keeps its
|
|
63
65
|
// own .dockerignore, and .git never enters the build
|
|
64
66
|
await host.write(`${app.name}.Dockerfile.dockerignore`, renderDockerignore(app.include));
|
|
65
67
|
const invocation = {
|
|
68
|
+
ssh: context.agent,
|
|
66
69
|
context: source.tree,
|
|
67
70
|
dockerfile,
|
|
68
71
|
secrets: Object.fromEntries([secrets.env, ...secrets.files].map((secret) => [secret.id, secret.src])),
|
|
@@ -133,6 +136,9 @@ function fingerprintOf(app, context, release) {
|
|
|
133
136
|
.update(PIPELINE)
|
|
134
137
|
.update(release)
|
|
135
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))
|
|
136
142
|
.update(JSON.stringify(app.build))
|
|
137
143
|
.update(context.env)
|
|
138
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;AAGtF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
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;AAGtF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA4B5C,8EAA8E;AAC9E,+EAA+E;AAC/E,6DAA6D;AAC7D,MAAM,QAAQ,GAAG,GAAG,CAAC;AAgBrB,6EAA6E;AAC7E,8EAA8E;AAC9E,0DAA0D;AAC1D,MAAM,UAAU,KAAK,CAAC,G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C,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,6EAA6E;AAC7E,SAAS,aAAa,CAAC,GAAY,EAAE,OAAqB,EAAE,OAAe;IACzE,OAAO,UAAU,CAAC,QAAQ,CAAC;SACxB,MAAM,CAAC,QAAQ,CAAC;SAChB,MAAM,CAAC,OAAO,CAAC;SACf,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;QACtB,sEAAsE;QACtE,uCAAuC;SACtC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;SACtC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACjC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;SACnB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;SAC5D,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
package/dist/cli/agent.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
|
|
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
|
package/dist/cli/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/cli/agent.ts"],"names":[],"mappings":"AAAA,OAAO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AC,CAAC,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAExD,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IAElE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;IACtC,IAAI,GAAG;QAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;IAE5C,wEAAwE;IACxE,IAAI,CAAC;QACH,YAAY,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,wEAAwE;YACtE,wEAAwE;YACxE,qEAAqE;YACrE,aAAa,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/cli/config.d.ts
CHANGED
|
@@ -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
|
package/dist/cli/config.d.ts.map
CHANGED
|
@@ -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;AAmC3D,wBAAsB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,
|
|
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"}
|
package/dist/cli/config.js
CHANGED
|
@@ -32,21 +32,36 @@ const LOADER = new Set([
|
|
|
32
32
|
export async function loadConfig(explicit) {
|
|
33
33
|
const path = explicit ? resolve(explicit) : discover(process.cwd());
|
|
34
34
|
const config = defaultOf(await load(path), path);
|
|
35
|
+
const manifest = manifestOf(explicit ? dirname(path) : process.cwd());
|
|
35
36
|
const beside = await loadEnvironments(dirname(path));
|
|
36
|
-
|
|
37
|
-
|
|
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)) {
|
|
38
45
|
if (!beside[name])
|
|
39
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;
|
|
40
53
|
throw new Error(`${name} is named by package.json and also sits beside the deployment. ` +
|
|
41
54
|
"An environment comes from one place or the other");
|
|
42
55
|
}
|
|
43
|
-
return { ...rooted(config, dirname(path)), environments: { ...
|
|
56
|
+
return { ...rooted(config, dirname(path)), environments: { ...found, ...named } };
|
|
44
57
|
}
|
|
45
58
|
// A source path belongs to the file that named it, not to wherever the command
|
|
46
59
|
// was run. Resolving it here is what lets a deploy from a workspace and one
|
|
47
60
|
// from the root build the same tree
|
|
48
61
|
function rooted(config, directory) {
|
|
49
|
-
|
|
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))
|
|
50
65
|
return config;
|
|
51
66
|
return {
|
|
52
67
|
...config,
|
|
@@ -76,24 +91,51 @@ async function loadNamed(manifest) {
|
|
|
76
91
|
// likely to be run from a workspace inside it as from there
|
|
77
92
|
export function discover(from) {
|
|
78
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 = [];
|
|
79
98
|
for (;;) {
|
|
80
99
|
const declared = directoryFrom(directory);
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
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;
|
|
85
108
|
const here = found(directory);
|
|
86
109
|
if (here)
|
|
87
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
|
+
}
|
|
88
115
|
const parent = dirname(directory);
|
|
89
116
|
if (parent === directory)
|
|
90
117
|
break;
|
|
91
118
|
directory = parent;
|
|
92
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
|
+
}
|
|
93
125
|
throw new Error(`No redkite.config.ts found in ${from} or any directory above it. A deployment ` +
|
|
94
126
|
'is one file at the root of the project, or wherever package.json\'s ' +
|
|
95
127
|
'"redkite": { "directory": … } says it is');
|
|
96
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
|
+
}
|
|
97
139
|
// Every environment that lives in a file of its own, keyed by the name in it
|
|
98
140
|
export async function loadEnvironments(directory) {
|
|
99
141
|
const environments = {};
|
|
@@ -127,8 +169,7 @@ function found(directory) {
|
|
|
127
169
|
return undefined;
|
|
128
170
|
}
|
|
129
171
|
function missing(declared, from) {
|
|
130
|
-
throw new Error(`${join(from, "package.json")} points redkite at ${declared}, which
|
|
131
|
-
`redkite.config.${EXTENSIONS.join(", redkite.config.")}`);
|
|
172
|
+
throw new Error(`${join(from, "package.json")} points redkite at ${declared}, which is not there`);
|
|
132
173
|
}
|
|
133
174
|
function manifestAt(directory) {
|
|
134
175
|
const path = join(directory, "package.json");
|
|
@@ -143,6 +184,13 @@ function manifestAt(directory) {
|
|
|
143
184
|
return undefined;
|
|
144
185
|
}
|
|
145
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
|
+
}
|
|
146
194
|
// The nearest one above wherever this was run, which is the same walk the
|
|
147
195
|
// config itself is found by
|
|
148
196
|
function manifestOf(from) {
|
|
@@ -157,11 +205,16 @@ function manifestOf(from) {
|
|
|
157
205
|
directory = parent;
|
|
158
206
|
}
|
|
159
207
|
}
|
|
160
|
-
// package.json says where
|
|
161
|
-
//
|
|
208
|
+
// package.json says where redkite's files live, for a repository that would
|
|
209
|
+
// rather not keep them at its root
|
|
162
210
|
function directoryFrom(directory) {
|
|
163
|
-
|
|
164
|
-
|
|
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;
|
|
165
218
|
}
|
|
166
219
|
function defaultOf(module, path) {
|
|
167
220
|
const found = module;
|
package/dist/cli/config.js.map
CHANGED
|
@@ -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,U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