You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1d219b5
Browse filesBrowse the repository at this point in the historyBrowse files
feat(cli): rework build / test environment handling
Adds an explicit environment (env) subcommand which allows users
to list and interact with existing build / test environments.
Additionally contains extensive internal refactoring to make the
environment tracking and cleanup more robust.
|`--output-dir <dir>`| Directory to put the resulting build artifacts |
35
35
|`--shell-on-failure`| On build failure, drop into an interactive shell in the build environment when stdout is a TTY |
36
36
37
-
[`debmagic shell`](#inspecting-a-failed-build) — attach an interactive shell to a build environment
37
+
[`debmagic env shell`](#inspecting-a-failed-build) — attach an interactive shell to an Environment
38
38
39
39
## Picking a driver
40
40
@@ -52,13 +52,14 @@ There's no auto-detection; pick one and pass it explicitly every time (or config
52
52
53
53
On failure the build environment is torn down by default. Pass `--shell-on-failure` to drop into an interactive shell inside the build environment when stdout is a TTY (destroyed on shell exit unless `--persistent` was used).
54
54
55
-
To inspect after the run finishes, pass `--persistent` up front, then:
55
+
To inspect after the run finishes, pass `--persistent` up front, then use [`debmagic env shell`](env.md).
# if you're in the package still and exactly one Environment exists for it
59
+
debmagic env shell
60
+
# from anywhere:
61
+
debmagic env list
62
+
debmagic env shell <id>
62
63
```
63
64
64
65
This attaches an interactive shell inside the still-running (or restartable) build environment, at the package's build directory.
@@ -188,4 +189,4 @@ Instead of repeating CLI flags on every invocation, drop a [config file](config.
188
189
189
190
## Internals
190
191
191
-
- Container/device names are derived and sanitized internally (alphanumeric + hyphen, ≤63 chars for LXD/Incus) — don't try to predict or construct them yourself; use `debmagic shell` instead of `lxc`/`docker` commands directly.
192
+
- Container/device names are derived and sanitized internally (alphanumeric + hyphen, ≤63 chars for LXD/Incus) — don't try to predict or construct them yourself; use `debmagic env shell` instead of `lxc`/`docker` commands directly.
Copy file name to clipboardExpand all lines: docs/usage/config.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ Config files are merged in order of increasing precedence, so later files overri
14
14
Only files that exist are read; missing ones are skipped.
15
15
Command-line flags override whatever the merged config resolves to.
16
16
17
+
`DEBMAGIC_DATA_DIR` relocates the Environment registry (`db.sqlite`) and the default `environments_dir` together. A relative value is resolved to an absolute path against the current working directory. It is not a config file key.
18
+
17
19
## Options
18
20
19
21
All keys are optional.
@@ -27,7 +29,7 @@ All keys are optional.
27
29
|`driver.docker.base_images`| map | — | — | Base image per distro, keyed by `"<distro>:<codename>"` (e.g. `"debian:trixie"`). Falls back to `docker.io/<distro>:<codename>`. For non-Debian/Ubuntu suites (e.g. `"yocto:kirkstone"`), the map entry is what makes the suite a known DistroVersion for Docker builds. |
|`driver.lxd.base_images`| map | — | — | Base image per distro, keyed by `"<distro>:<codename>"`. Falls back to the driver's default remote image. Same custom-suite registry role as Docker's map for LXD/Incus. |
30
-
|`temp_build_dir`| path |`/tmp/debmagic`| — |Where build trees are staged. |
32
+
|`environments_dir`| path |`$XDG_DATA_HOME/debmagic/environments`| — |Parent directory of Environment Host roots. Must be absolute or start with `~/`. The Environment registry is always `$XDG_DATA_HOME/debmagic/db.sqlite` (override both with `DEBMAGIC_DATA_DIR`). |
31
33
|`output_dir`| path |`build`|`-o`/`--output-dir`| Where build artifacts are exported; relative paths resolve against the package root. |
32
34
|`incremental`| bool |`false`|`--incremental`| Retain the environment and sync only source changes, preserving generated files. Binary-only; implies `persistent`; incompatible with `clean`. |
33
35
|`source_sync_mode`| enum |`tracked`|`--source-sync`| Which source files are staged (see below). |
0 commit comments