Add pixi-style channels configured in config.toml
The built-in main channel is always included. Priority is strict, packages remember their channel, and only a missing repository falls through to the next channel. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
32714325a7
commit
61ebc21fce
11 files changed
+639
-164
No files matched your search
@@ -35,7 +35,7 @@ mypkg/
|
||||
}
|
||||
```
|
||||
|
||||
In the registry this becomes `<registry>/mytool:1.4.0`, plus the `latest` tag:
|
||||
In a channel this becomes `<channel url>/mytool:1.4.0`, plus the `latest` tag:
|
||||
|
||||
| Part | Media type |
|
||||
|---|---|
|
||||
@@ -58,13 +58,45 @@ orbit rollback hello
|
||||
orbit remove hello
|
||||
```
|
||||
|
||||
The default registry is `git.site.latha.org/nandi`, so no setup is needed. Override it for one command or shell with `ORBIT_REGISTRY=<host>/<owner>`, or save another one with `orbit init <registry>`. The order is `ORBIT_REGISTRY`, then the saved config, then the default. Orbit doesn't record which registry a package came from, so `upgrade` looks in whichever one is active.
|
||||
## Channels
|
||||
|
||||
Use `--plain-http` (or `ORBIT_PLAIN_HTTP=1`) for a local `registry:2` without TLS:
|
||||
Packages come from **channels**, which work like channels in pixi. A channel is a name for a registry namespace. The built-in `main` channel is `git.site.latha.org/nandi`, so no setup is needed.
|
||||
|
||||
Add your own in `~/.orbit/config.toml` (`$ORBIT_ROOT/config.toml`), highest priority first. [examples/config.toml](examples/config.toml) adds the `example` channel:
|
||||
|
||||
```toml
|
||||
[[channels]]
|
||||
name = "example"
|
||||
url = "git.site.latha.org/nandi/example" # host/namespace, no https://
|
||||
|
||||
# [[channels]]
|
||||
# name = "local"
|
||||
# url = "localhost:5000/pkgs"
|
||||
# plain-http = true # registry without TLS
|
||||
```
|
||||
|
||||
`orbit channel add <name> <url> [--plain-http]` appends one at the lowest priority, and `orbit channel list` shows the order. To remove or reorder channels, edit the file. `orbit init` creates a commented starter file.
|
||||
|
||||
```sh
|
||||
orbit channel add example git.site.latha.org/nandi/example
|
||||
orbit install greet # first channel that has greet
|
||||
orbit install example::greet # from a specific channel
|
||||
orbit publish examples/greet --channel example # default: main
|
||||
```
|
||||
|
||||
- **`main` is always included.** It comes first, so another channel can't silently replace one of its packages. To lower its priority, add a block with only `name = "main"` where you want it.
|
||||
- **Strict priority.** The first channel that has a package name wins, even if a lower one has a newer or the only matching version. Dependencies are found the same way.
|
||||
- **Unreachable channels stop the lookup.** Orbit moves to the next channel only when the registry says the package doesn't exist. Network and login errors fail.
|
||||
- **Packages remember their channel.** `upgrade` and `rollback` keep it. `orbit install other::name` switches it. A package stays tied to its channel *name*, so changing that channel's URL changes where upgrades come from.
|
||||
- **Environment.** `ORBIT_REGISTRY=<host>/<namespace>` replaces the URL of `main`, and `ORBIT_PLAIN_HTTP=1` applies to `main`. Other channels aren't affected.
|
||||
|
||||
A `config.json` from an earlier version still sets the URL of `main` until a `config.toml` exists. `orbit channel add` carries it over.
|
||||
|
||||
For a local `registry:2` without TLS:
|
||||
|
||||
```sh
|
||||
docker run -d -p 5000:5000 registry:2
|
||||
orbit init localhost:5000/pkgs --plain-http
|
||||
orbit channel add local localhost:5000/pkgs --plain-http
|
||||
```
|
||||
|
||||
## Building
|
||||
@@ -89,8 +121,7 @@ package_dir=$(sh scripts/package-orbit.sh) &&
|
||||
_build/native/release/build/main/main.exe publish "$package_dir"
|
||||
```
|
||||
|
||||
This publishes to the active registry (set `ORBIT_REGISTRY` to override the
|
||||
default), so log in with `oras login <host>` first if needed. The
|
||||
This publishes to the `main` channel (use `--channel <name>` for another), so log in with `oras login <host>` first if needed. The
|
||||
package contains a native Linux binary for the build machine's architecture.
|
||||
Use the same architecture on the install machine. `oras` and `tar` are still
|
||||
system prerequisites; the package does not bundle them.
|
||||
@@ -117,6 +148,7 @@ src/main/
|
||||
model.mbt orbit.json / state.json / config.json (+ tests)
|
||||
registry.mbt oras wrappers: tags, resolve, fetch-config, pull, push
|
||||
ops.mbt dependency planner, install/remove/upgrade/rollback/gc
|
||||
channels.mbt config.toml, channel priority and lookup (+ tests)
|
||||
main.mbt CLI
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user