Add example project with locked dependencies and tasks
- Add examples/project with orbit.toml declaring hello and greet (example channel) - Pin resolved versions and digests in orbit.lock - Add demo.sh and a demo task that calls hello and greet from .orbit/bin - Ignore the generated .orbit/ directory and document usage in its README - Link the example from the main README
This commit is contained in:
1 parent
13aa7d7f77
commit
3ca9e8ed1d
6 files changed
+83
No files matched your search
@@ -101,6 +101,8 @@ greet = { version = ">=1.0.0, <2.0.0", channel = "example" }
|
||||
hi = "greet"
|
||||
```
|
||||
|
||||
See [examples/project](examples/project/README.md) for a working example project using `hello` and `example::greet`.
|
||||
|
||||
Credentials are stored in `~/.orbit/auth.json` (`$ORBIT_ROOT/auth.json`, mode `0600`). Orbit also falls back to `~/.docker/config.json` (`$DOCKER_CONFIG/config.json`) including `credHelpers` and `credsStore`. Use `orbit logout <host>` to remove stored credentials from Orbit.
|
||||
|
||||
## Channels
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
.orbit/
|
||||
@@ -0,0 +1,26 @@
|
||||
# orbit-demo
|
||||
|
||||
An example project whose dependencies (`hello` from `main` and `greet` from `example`) are declared in [orbit.toml](orbit.toml) and pinned in [orbit.lock](orbit.lock).
|
||||
|
||||
## Files
|
||||
|
||||
- `orbit.toml` — declares the `example` channel, dependencies (`greet` and `hello`), and `[tasks]`.
|
||||
- `orbit.lock` — deterministic lockfile generated by `orbit lock`.
|
||||
- `demo.sh` — script invoked by the `demo` task that calls `hello` and `greet` from `.orbit/bin/`.
|
||||
- `.gitignore` — ignores the generated `.orbit/` environment directory.
|
||||
|
||||
## Usage
|
||||
|
||||
From this directory:
|
||||
|
||||
```sh
|
||||
orbit install --locked # sync .orbit/ from orbit.lock
|
||||
orbit list # show locked project packages
|
||||
orbit run --locked demo # run demo.sh with .orbit/bin on PATH
|
||||
orbit run --locked greet # run the greet task
|
||||
orbit run --locked hello # run the hello task
|
||||
orbit update # resolve newer versions allowed by orbit.toml
|
||||
eval "$(orbit env)" # put .orbit/bin on PATH in your current shell
|
||||
```
|
||||
|
||||
Or from the repository root with `--manifest-path examples/project`.
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
echo "Project: ${ORBIT_PROJECT:-$(pwd)}"
|
||||
echo " hello -> $(hello)"
|
||||
echo " greet -> $(greet)"
|
||||
@@ -0,0 +1,30 @@
|
||||
# Generated by orbit. Do not edit by hand.
|
||||
|
||||
version = 1
|
||||
|
||||
[[channels]]
|
||||
name = "main"
|
||||
url = "git.site.latha.org/nandi"
|
||||
|
||||
[[channels]]
|
||||
name = "example"
|
||||
url = "git.site.latha.org/nandi/example"
|
||||
|
||||
[[package]]
|
||||
name = "greet"
|
||||
version = "1.0.1"
|
||||
channel = "example"
|
||||
url = "git.site.latha.org/nandi/example"
|
||||
digest = "sha256:72f32cfa2800376cf49813e86b5ee99a853c972842e2df72e82447bd825abdb9"
|
||||
description = "Example package for the example channel"
|
||||
bin = ["bin/greet"]
|
||||
depends = { hello = "^1.0.0" }
|
||||
|
||||
[[package]]
|
||||
name = "hello"
|
||||
version = "1.0.0"
|
||||
channel = "main"
|
||||
url = "git.site.latha.org/nandi"
|
||||
digest = "sha256:30e13217f0e0475a4526a141b76c78e7f19f6c66754795dbb6636e6d251ee043"
|
||||
description = "Example orbit package"
|
||||
bin = ["bin/hello"]
|
||||
@@ -0,0 +1,18 @@
|
||||
[project]
|
||||
name = "orbit-demo"
|
||||
version = "0.1.0"
|
||||
description = "Example project with dependencies managed by orbit"
|
||||
channels = ["main", "example"]
|
||||
|
||||
[[channels]]
|
||||
name = "example"
|
||||
url = "git.site.latha.org/nandi/example"
|
||||
|
||||
[dependencies]
|
||||
greet = { version = ">=1.0.0, <2.0.0", channel = "example" }
|
||||
hello = "^1.0.0"
|
||||
|
||||
[tasks]
|
||||
demo = "sh \"$ORBIT_PROJECT/demo.sh\""
|
||||
greet = "greet"
|
||||
hello = ["hello"]
|
||||
Reference in new issue
Block a user