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 1667c27
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.
Debmagic unifies the the packaging experience as a single, streamlined tool. Additionally, `debmagic-pkg` allows you to define package build recipes in Python.
8
8
9
9
-**Isolated builds without the setup**: `debmagic build binary` builds a `debian/`-packaged source tree in a temporary container (using LXD, Incus, Docker)
10
-
-**Fast iteration**: `--persistent`/`--incremental` reuse the environment and sync only source changes; `--shell-on-failure` and `debmagic shell` drop you right where the build broke
10
+
-**Fast iteration**: `--persistent`/`--incremental` reuse the environment and sync only source changes; `--shell-on-failure` and `debmagic env shell` drop you right where the build broke
11
11
-**Test & sign integrated**: `debmagic test` runs the package's autopkgtest tests in a fresh environment, `debmagic sign` GPG-signs `.changes`/`.dsc`/`.buildinfo` on the host
12
12
-**Python packaging API**: replace complicated `debian/rules` Makefiles with typed Python `debian/rules.py`, with optional `dh` compatibility
Copy file name to clipboardExpand all lines: docs/index.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Working with Debian packages without `debmagic` means juggling with several inde
9
9
Debmagic unifies this into one CLI with useful defaults:
10
10
11
11
-**Isolated builds without the setup**: `debmagic build binary` builds a `debian/`-packaged source tree in a temporary container (using LXD, Incus, Docker)
12
-
-**Fast iteration**: `--persistent`/`--incremental` reuse the environment and sync only source changes; `--shell-on-failure` and `debmagic shell` drop you right where the build broke
12
+
-**Fast iteration**: `--persistent`/`--incremental` reuse the environment and sync only source changes; `--shell-on-failure` and `debmagic env shell` drop you right where the build broke
13
13
-**Test & sign integrated**: `debmagic test` runs the package's autopkgtest tests in a fresh environment, `debmagic sign` GPG-signs `.changes`/`.dsc`/`.buildinfo` on the host
14
14
-**Package uploading**: `debmagic upload` (to `debian`, `ubuntu`, `ppa:user/repo`) pushes signed builds to archives and PPAs via scp/sftp, with configurable pre-upload checks
15
15
-**Upstream tracking**: `debmagic upstream list`/`switch` replace uscan/uupdate, reading the package's existing `debian/watch` and `debian/copyright`
@@ -37,6 +37,7 @@ Then dive into the pages below — start with [Getting started](usage/getting-st
|`--output-dir <dir>`| Directory to put the resulting build artifacts |
37
37
|`--shell-on-failure`| On build failure, drop into an interactive shell in the build environment when stdout is a TTY |
38
38
39
-
[`debmagic shell`](#inspecting-a-failed-build) — attach an interactive shell to a build environment
39
+
[`debmagic env shell`](#inspecting-a-failed-build) — attach an interactive shell to an Environment
40
40
41
41
## Picking a driver
42
42
@@ -54,13 +54,14 @@ There's no auto-detection; pick one and pass it explicitly every time (or config
54
54
55
55
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).
56
56
57
-
To inspect after the run finishes, pass `--persistent` up front, then:
57
+
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
61
+
debmagic env shell
62
+
# from anywhere:
63
+
debmagic env list
64
+
debmagic env shell <id>
64
65
```
65
66
66
67
This attaches an interactive shell inside the still-running (or restartable) build environment, at the package's build directory.
@@ -129,7 +130,7 @@ This flag implies `--persistent`, and cannot be combined with `--clean yes`.
129
130
The preserved build tree is kept even when the environment itself is *not* reused (e.g. a fresh CI runner where the tree was restored from a cache).
130
131
Quilt patches that a previous build or shell session left applied in the build tree are unapplied with `dpkg-source --after-build` before sources are synced, so the worktree remains the source of truth and stale `.pc` state cannot break later builds.
131
132
132
-
The work dir (`temp_build_dir`, default `/tmp/debmagic`) keeps the artifacts of builds, including their `.changes` files.
133
+
The Environment's Host root lives under `environments_dir` (default `$XDG_DATA_HOME/debmagic/environments`). Build artifacts, including `.changes` files, are exported to `output_dir`.
133
134
134
135
135
136
## Selecting a distro/release
@@ -234,4 +235,4 @@ Instead of repeating CLI flags on every invocation, drop a [config file](config.
234
235
235
236
## Internals
236
237
237
-
- 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.
238
+
- 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.
0 commit comments