Skip to content

Commit 0610d70

Browse files
committed
(human) more work on examples/env README
1 parent 0aee21d commit 0610d70

File tree

1 file changed

+45
-21
lines changed

1 file changed

+45
-21
lines changed

examples/env/README.md

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,6 @@ dev: env.#Container & {
188188
}
189189
```
190190

191-
### Things you can do
192-
193-
- use `env.Terminal`, `--on-failure`, `--no-exit`, or `hof env run` to enter interactive terminal sessions. Great for debugging failed image builds or CI.
194-
- put schemas on your Ansible equivalent templated config file rendering
195-
- sequence and order Terraform + Helm operations
196-
197191
### Run an example
198192

199193
```sh
@@ -253,28 +247,29 @@ cd k8s && \
253247

254248
#### CUE (user) files
255249

256-
[todo] make these links
257-
258250
- [schemas/env](../../schemas/env)
259251
- [catalogs/env](../../catalogs/env) (important, these are ordered to avoid cycles)
260-
- _note_, catalogs/env is an example and you can make your own, the only requirement is using the schemas/env
261-
- `utils/` helpers that only import veg/schemas/...
262-
- `bases/` operating systems and other basie images manually crafted, even from scratch
263-
- `packs/` abstractions, collections, and other reusable packs of env stuff
252+
- _note_, catalogs/env is an example and you can make your own, the only requirement is using the schemas/env
253+
- `utils/` helpers that only import veg/schemas/...
254+
- `bases/` operating systems and other basie images manually crafted, even from scratch
255+
- `packs/` abstractions, collections, and other reusable packs of env stuff
264256
- [`.veg/`](../../.veg) the kitchen sink, it's all the things for this repo
265257
- [examples/env](../../examples/env/)
266-
- `basic/` multi-stage build and 3-tier app
267-
- `adk/` commands example with matrix test & lint
268-
- `atproto/` docker compose like setup & app, full network in an env
258+
- `basic/` multi-stage build and 3-tier app
259+
- `advanced/` demonstrates more complex patterns and day-2 features
260+
- `adk/` commands example with matrix test and lint
269261
- `inception/` using docker, dagger, hof, helm, kubernetes from inside an env
270262

263+
Links to more examples can be found below.
264+
271265
#### Go (impl) files:
272266

273-
- `lib/env/...`
267+
Everything is under `lib/env/...`
274268

275269
> [!INFO] > `schemas/env` and `lib/env/dag` align very closely. The `dag` package uses a new progressive CUE schema alignment and decoding strategy
276270
> that works really, really well and will be used more widely in veg. It's also prime time for `veg gen`.
277271
272+
278273
### The `veg/env` command
279274

280275
The `veg/env` command aims to be flexible, extensible, and consistent
@@ -528,11 +523,11 @@ These are artifacts, intermediates, or resources you can work with
528523
529524
## Examples
530525
531-
### Multi-Stage Builds and Beyond, DAG style
526+
This repo is an excellent example, [`.veg/`](../../.veg) is a kitchen sink, it's all the things for this repo
527+
528+
[verdverm/testnet](https://github.com/verdverm/testnet) has a docker-compose like setup for [ATProtocol](https://atproto.com), build social apps, develop algos, run independent networks locally or for testing.
532529

533-
- multi-stage
534-
- no need for yum rm
535-
- how binaries and dirs work
530+
### Debian Base Container with Apt Caches
536531

537532
That long-time advice to install packages like this: `apt update && apt install && apt clean`... it's over!
538533
We can now attach caches, just like we do for languages like `go.mod` and `node_modules`,
@@ -722,14 +717,43 @@ cmd: {
722717
723718
```
724719
720+
725721
### Release Bundles
726722
727723
You can define release bundles and then assemble and publish them with a single command.
728724
729-
`hof env ...`
725+
_from the root of this repo_
730726
727+
```sh
728+
$ hof env list -e dist -S kind -S name
729+
NAME KIND PATH EXTRA
730+
sbom-cuemod cuefigSBOM dist.sbom.cuemod cuemod.cue
731+
sbom-fmt-black cuefigSBOM dist.sbom."fmt-black" fmt-black.cue
732+
sbom-fmt-prettier cuefigSBOM dist.sbom."fmt-prettier" fmt-prettier.cue
733+
sbom-github cuefigSBOM dist.sbom.github github.cue
734+
sbom-veg-dev cuefigSBOM dist.sbom.dev veg-dev.cue
735+
sbom-veg-hof cuefigSBOM dist.sbom.hof veg-hof.cue
736+
sbom-veg-min cuefigSBOM dist.sbom.min veg-min.cue
737+
sbom-veg-ops cuefigSBOM dist.sbom.ops veg-ops.cue
738+
sbom-vscode cuefigSBOM dist.sbom.vscode vscode.cue
739+
dist-cuemod exportDir dist.cuemod -> dist/cuemod
740+
dist-github exportDir dist.github -> dist/github
741+
dist-meta exportDir dist.meta -> dist/meta
742+
dist-vscode exportDir dist.vscode -> dist/vscode
743+
dist-fmt-black publishImage dist.images."fmt-black" -> host.docker.internal:5000/fmt-black
744+
dist-fmt-prettier publishImage dist.images."fmt-prettier" -> host.docker.internal:5000/fmt-prettier
745+
dist-veg-dev publishImage dist.images.dev -> host.docker.internal:5000/veg-dev
746+
dist-veg-hof publishImage dist.images.hof -> host.docker.internal:5000/veg-hof
747+
dist-veg-min publishImage dist.images.min -> host.docker.internal:5000/veg-min
748+
dist-veg-ops publishImage dist.images.ops -> host.docker.internal:5000/veg-ops
731749
```
732750
751+
```sh
752+
# validate a release is ready to go
753+
$ hof env sync -e dist -T v0.7.0-alpha.2
754+
755+
# export and publish artifacts for real
756+
$ hof env export -e dist -T v0.7.0-alpha.2 -t reg=ghcr.io/hofstadter-io
733757
```
734758
735759
### Agent or Dev Environments with Tools

0 commit comments

Comments
 (0)